update: left-menu - responsive ok

This commit is contained in:
gaelle morin 2020-06-04 18:15:43 +02:00
parent 9d83093165
commit 8f49cbdcd7
No known key found for this signature in database
GPG Key ID: 028426702B95CF9C
3 changed files with 110 additions and 99 deletions

View File

@ -100,7 +100,7 @@ sib-router#navbar-router(default-route='dashboard')
div.menu-icon.icon-folder-alt div.menu-icon.icon-folder-alt
sib-route(name='circle', rdf-type='hd:circle', use-id='', hidden) sib-route(name='circle', rdf-type='hd:circle', use-id='', hidden)
div.sub-menu.menu-notification div.sub-menu.menu-notification
sib-display( sib-display.circle-tab(
bind-user bind-user
nested-field='circles' nested-field='circles'
fields='circle' fields='circle'
@ -120,7 +120,7 @@ sib-router#navbar-router(default-route='dashboard')
div.menu-icon.icon-envelope-letter div.menu-icon.icon-envelope-letter
sib-route(name='messages', rdf-type='foaf:user', use-id='', hidden) sib-route(name='messages', rdf-type='foaf:user', use-id='', hidden)
div.sub-menu.menu-notification div.sub-menu.menu-notification
sib-display.nosub( sib-display.nosub.message-tab(
data-src=`${endpoints.users || (endpoints.get && endpoints.get.users)}` data-src=`${endpoints.users || (endpoints.get && endpoints.get.users)}`
fields='name, chatProfile.jabberID, badge' fields='name, chatProfile.jabberID, badge'
search-fields="name" search-fields="name"

View File

@ -10,14 +10,14 @@
.unread { .unread {
font-weight: bolder; font-weight: bolder;
} }
sib-router { sib-router {
.menu-wrapper { .menu-wrapper {
&.is-closed { &.is-closed {
.sub-menu { .sub-menu {
display: none; display: none;
} }
.menu-chevron { .menu-chevron {
transform: rotate(180deg); transform: rotate(180deg);
} }
@ -27,22 +27,22 @@
sib-link { sib-link {
width: 100%; width: 100%;
} }
.menu { .menu {
cursor: pointer; cursor: pointer;
display: flex; display: flex;
flex-direction: row-reverse; flex-direction: row-reverse;
font-weight: bold; font-weight: bold;
padding: 1.2rem; padding: 1.2rem;
&[active] { &[active] {
background-color: var(--color-menu-highlight-primary); background-color: var(--color-menu-highlight-primary);
.menu-icon:before { .menu-icon:before {
background-color: var(--color-menu-icon-background-active); background-color: var(--color-menu-icon-background-active);
} }
.menu-notification > sib-display > div:first-child { .menu-notification>sib-display>div:first-child {
background-color: var(--color-menu-badge-background); background-color: var(--color-menu-badge-background);
} }
} }
@ -55,7 +55,7 @@
flex-shrink: 0; flex-shrink: 0;
font-size: 1.7rem; font-size: 1.7rem;
width: 3.2em; width: 3.2em;
&:before { &:before {
border-radius: 100%; border-radius: 100%;
height: 1.9em; height: 1.9em;
@ -63,7 +63,7 @@
width: 1.9em; width: 1.9em;
} }
} }
.menu-label { .menu-label {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -84,63 +84,89 @@
justify-content: center; justify-content: center;
width: 2em; width: 2em;
} }
> sib-display { >sib-display {
display: block; display: block;
} }
} }
.sub-menu { .sub-menu {
/* Specific styles for the "Projects" tab */ /* Ellipsis for project tab */
.project-tab>div>sib-display>div:nth-child(1) { .project-tab>div>sib-display>div:nth-child(1) {
sib-set-default[name='project'] { sib-set-default[name='project'] {
flex: 3;
.project-customer,
.project-name {
box-sizing: border-box;
display: block;
width: calc(80vw - 76px); /*76px = padding of the element + width and margin of counter */
@include breakpoint(lg) {
width: 150px;
}
}
.project-customer, .project-customer,
.project-name>div { .project-name>div {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.project-customer {
width: 100%;
@include breakpoint(lg) { @include breakpoint(lg) {
width: 150px; display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
} }
.project-name {
display: block;
width: calc(80vw - 50px);
@include breakpoint(lg) {
width: 150px;
}
}
}
hubl-counter {
margin-top: 16px;
} }
} }
/* End of specific styles of "Projects" tab */
/* Ellipsis for circle tab */
.circle-tab>div>sib-display>div {
sib-display-div[name='name'] {
flex: 3;
>div[name='name'] {
box-sizing: border-box;
padding-left: 0.2em;
width: calc(80vw - 76px); /*76px = padding of the element + width and margin of counter */
@include breakpoint(lg) {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 150px;
}
}
}
}
/* Ellipsis for message tab */
.message-tab>div>sib-display>div>sib-display-div>div {
box-sizing: border-box;
width: calc(80vw - 76px); /*76px = padding of the element + width and margin of counter */
@include breakpoint(lg) {
width: 150px;
}
}
sib-display.nosub>sib-form[fields="name"]>hubl-search-users>input { sib-display.nosub>sib-form[fields="name"]>hubl-search-users>input {
margin-left: 30px; margin-left: 30px;
max-width: 87%; max-width: 82%;
width: 87%; width: 82%;
display: block; display: block;
background-color: var(--color-secondary); background-color: var(--color-secondary);
color: var(--color-grey-6); color: var(--color-grey-6);
border: 1px solid var(--color-grey-4); border: 1px solid var(--color-grey-4);
border-radius: 3px; border-radius: 3px;
padding: 4px; padding: 4px;
@include breakpoint(lg) { @include breakpoint(lg) {
margin: auto; margin: auto;
width: auto; width: auto;
@ -153,15 +179,19 @@
display: grid; display: grid;
grid-template-columns: auto 50% auto; grid-template-columns: auto 50% auto;
grid-template-areas: "left middle right"; grid-template-areas: "left middle right";
>* { >* {
color: var(--color-grey-6); color: var(--color-grey-6);
} }
>[data-id="prev"] { >[data-id="prev"] {
grid-area: left; grid-area: left;
} }
>[data-id="next"] { >[data-id="next"] {
grid-area: right; grid-area: right;
} }
>span { >span {
grid-area: middle; grid-area: middle;
} }
@ -170,6 +200,7 @@
hubl-menu-publicprivate { hubl-menu-publicprivate {
display: inline-block; display: inline-block;
text-align: center; text-align: center;
div { div {
font-family: simple-line-icons; font-family: simple-line-icons;
width: 20px; width: 20px;
@ -188,16 +219,16 @@
color: var(--color-white); color: var(--color-white);
margin: 1rem 1rem 2.2rem 3.2rem; margin: 1rem 1rem 2.2rem 3.2rem;
} }
&>sib-display { &>sib-display {
&:last-child>div { &:last-child>div {
margin-bottom: 2.2rem; margin-bottom: 2.2rem;
} }
>div { >div {
color: var(--color-grey-6); color: var(--color-grey-6);
cursor: pointer; cursor: pointer;
>hubl-menu-fix-url-circle>sib-display>div, >hubl-menu-fix-url-circle>sib-display>div,
>hubl-menu-fix-url-project>sib-display>div { >hubl-menu-fix-url-project>sib-display>div {
padding: 1rem 1rem 1rem 3rem; padding: 1rem 1rem 1rem 3rem;
@ -219,54 +250,40 @@
} }
&.menu-notification { &.menu-notification {
> sib-display > div > sib-display > div > hubl-menu-fix-url-circle,
> sib-display > div > sib-display > div > hubl-menu-fix-url-project { >sib-display>div>sib-display>div>hubl-menu-fix-url-circle,
>sib-display>div>sib-display>div>hubl-menu-fix-url-project {
flex: 1; flex: 1;
} }
> sib-display > div > sib-display > div,
> sib-display > div > sib-display > div > hubl-menu-fix-url-circle > sib-display > div,
> sib-display > div > sib-display > div > hubl-menu-fix-url-project > sib-display > div {
display: flex;
sib-display-div {
flex: 3;
@include breakpoint(lg) { >sib-display>div>sib-display>div,
max-width: 150px; >sib-display>div>sib-display>div>hubl-menu-fix-url-circle>sib-display>div,
} >sib-display>div>sib-display>div>hubl-menu-fix-url-project>sib-display>div {
} display: flex;
hubl-counter { justify-content: space-between;
height: 20px; }
width: 20px;
margin-right: 1em;
div.counter:not([data-nb-unread="0"]) {
text-align: center;
display: block;
background-color: var(--sib-notifications-theme, gray);
border-radius: 50%;
font-size: 12px;
line-height: 20px;
width: 20px;
height: 20px;
padding-bottom: 0;
color: var(--color-secondary);
}
}
sib-display-div { hubl-counter {
background-color: turquoise;
height: 20px;
width: 20px;
margin-right: 1em;
@include breakpoint(lg) { div.counter:not([data-nb-unread="0"]) {
max-width: 150px; text-align: center;
display: block;
>div[name='name'] { background-color: var(--sib-notifications-theme, gray);
white-space: nowrap; border-radius: 50%;
overflow: hidden; font-size: 12px;
text-overflow: ellipsis; line-height: 20px;
} width: 20px;
} height: 20px;
} padding-bottom: 0;
color: var(--color-secondary);
} }
} }
} }
}
.divider { .divider {
height: 1px; height: 1px;
@ -278,9 +295,7 @@
/* Styles for hovering (only on large screens) */ /* Styles for hovering (only on large screens) */
#main__menu sib-router .sub-menu.menu-notification>sib-display>div>sib-display>div>hubl-menu-fix-url-project>sib-display>div:hover, #main__menu sib-router .sub-menu.menu-notification>sib-display>div>sib-display>div>hubl-menu-fix-url-project>sib-display>div:hover,
#main__menu sib-router .sub-menu.menu-notification>sib-display>div>sib-display>div>hubl-menu-fix-url-circle>sib-display>div:hover, #main__menu sib-router .sub-menu.menu-notification>sib-display>div>sib-display>div>hubl-menu-fix-url-circle>sib-display>div:hover {
#main__menu sib-router .sub-menu.menu-notification>sib-display.nosub>div>sib-display>div:hover {
@include breakpoint(lg) { @include breakpoint(lg) {
background-color: var(--color-secondary); background-color: var(--color-secondary);
color: var(--color-white); color: var(--color-white);
@ -291,7 +306,6 @@
box-sizing: border-box; box-sizing: border-box;
font-weight: normal; font-weight: normal;
>hubl-menu-publicprivate { >hubl-menu-publicprivate {
display: none; display: none;
} }
@ -302,16 +316,17 @@
/* Hover for projects */ /* Hover for projects */
>sib-set-default[name='project']>.project-customer { >sib-set-default[name='project']>.project-customer {
width: 250px;
white-space: break-spaces;
text-align: left;
font-weight: normal; font-weight: normal;
padding-left: 1rem;
text-align: left;
width: 150px;
white-space: break-spaces;
} }
sib-set-default[name='project']>.project-name { sib-set-default[name='project']>.project-name {
padding-left: 0; padding-left: 1rem;
width: 100%; width: 100%;
&>div { &>div {
white-space: break-spaces; white-space: break-spaces;
text-align: left; text-align: left;
@ -320,14 +335,10 @@
/* Hover for circles */ /* Hover for circles */
>sib-display-div[name="name"] { >sib-display-div[name="name"] {
padding-left: 0;
width: 100%; width: 100%;
}
/* Hover for private messages */ &>div {
sib-display-div { padding-left: 1rem;
>div[name="name"] {
white-space: normal; white-space: normal;
} }
} }
@ -349,4 +360,4 @@ sib-fix-badge {
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
padding-bottom: 0; padding-bottom: 0;
} }

0
src/styles/base/new.scss Normal file
View File