Left-nav bar: new styles + overflow and hovering to handle long names

This commit is contained in:
Gaëlle Morin 2019-11-27 12:06:23 +01:00
parent dbf918f351
commit 1ade7ded23
3 changed files with 72 additions and 45 deletions

View File

@ -18,29 +18,30 @@ nav#main__menu
//- div.menu-icon.icon-briefcase //- div.menu-icon.icon-briefcase
//- sib-route(name='job-offer-create', hidden) //- sib-route(name='job-offer-create', hidden)
//- sib-route(name='job-offer-edit', use-id, hidden) //- sib-route(name='job-offer-edit', use-id, hidden)
//- div.divider div.divider
//- div.menu-wrapper div.menu-wrapper
//- div.menu div.menu
//- div.menu-chevron div.menu-chevron
//- div.menu-icon.icon-arrow-up div.menu-icon.icon-arrow-up
//- div.menu-label Projects div.menu-label Projects
//- div.menu-icon.icon-folder-alt div.menu-icon.icon-folder-alt
//- sib-route(name='project', rdf-type='hd:project', use-id='', hidden) sib-route(name='project', rdf-type='hd:project', use-id='', hidden)
//- div.sub-menu.menu-notification div.sub-menu.menu-notification
//- sib-display( sib-display(
//- data-src=`${endpoints.projects}` data-src=`${endpoints.projects}`
//- fields='project(customer.name, dash, name), badge' fields='project(customer.name, name), badge'
//- empty-widget='hd-create' class-customer.name='project-customer'
//- empty-value='project' class-name='project-name'
//- value-dash=' - ' empty-widget='hd-create'
//- search-fields='team' empty-value='project'
//- search-widget-team='sib-form-hidden' search-fields='team'
//- search-value-team='-' search-widget-team='sib-form-hidden'
//- hd-inherit-user-id='search-value-team' search-value-team='-'
//- hd-inherit-widgets hd-inherit-user-id='search-value-team'
//- widget-badge='hd-counter' hd-inherit-widgets
//- action-badge='badge' widget-badge='hd-counter'
//- ) action-badge='badge'
)
div.divider div.divider
div.menu-wrapper div.menu-wrapper
div.menu div.menu

View File

@ -20,12 +20,11 @@ $breakpoints: (phone: 480px,
background-color: $color-210-25-95; background-color: $color-210-25-95;
color: $color-213-4-50; color: $color-213-4-50;
font-size: 1.6rem; font-size: 1.6rem;
overflow: hidden; overflow-y: scroll;
overflow-wrap: break-word; }
display: flex;
flex-direction: column; html {
height: 100vh; overflow-y: scroll;
overflow: hidden;
} }
main { main {

View File

@ -2,8 +2,8 @@
background-color: $color-233-18-29; background-color: $color-233-18-29;
color: $color-0-0-100; color: $color-0-0-100;
display: block; display: block;
overflow: auto; height: calc(100vh - 82px);
flex: 0 0 16em; max-width: 250px;
transition: flex-basis 0.5s ease-in-out; transition: flex-basis 0.5s ease-in-out;
&.open { &.open {
@ -90,6 +90,43 @@
} }
.sub-menu { .sub-menu {
sib-set-default[name='project'] {
padding: 10px;
.project-customer,
.project-name {
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.project-customer {
font-weight: bold;
width: 150px;
}
.project-name {
padding-left: 14px;
width: calc(150px - 10px); /* 10px = padding of the sib-set-default = better alignment */
}
&:hover {
background-color: #a2a8bb;
border-radius: 2px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
color: #3D4057;
padding: 10px;
/* transition: all 0.6s cubic-bezier(0.39, 0.575, 0.565, 1); Need better animation */
width: auto;
.project-customer,
.project-name {
width: auto;
}
}
}
sib-display>div { sib-display>div {
@ -108,20 +145,10 @@
color: $color-244-10-70; color: $color-244-10-70;
cursor: pointer; cursor: pointer;
padding: 10px 10px 10px 32px; padding: 10px 10px 10px 32px;
} }
sib-route[name='project'] { &[fields="project(customer.name, name), badge"]>div {
display: flex; padding: 0 0 0 22px;
flex: 3;
sib-display-value {
display: block;
height: 20px;
}
sib-display-value[name='dash'] {
margin: 0 0.4em;
}
} }
} }