mediawiki-skins-Citizen/resources/skins.citizen.styles/Drawer.less
2021-01-12 14:31:35 -05:00

244 lines
4.2 KiB
Plaintext

#mw-drawer {
&-button {
&-icon {
display: flex;
overflow: hidden;
width: @icon-size;
height: @icon-size;
flex-direction: column;
align-items: center;
justify-content: center;
margin: (@header-height - @icon-size) / 2 @icon-padding (@header-height - @icon-size) / 2 (@icon-margin * 2 + @margin-side * 2) / 2;
&-1 {
transform-origin: 0 0;
}
&-2 {
transform-origin: 0 100%;
}
}
&:checked {
// Transform all the slices of the button into a crossmark
~ #mw-drawer-button-icon {
#mw-drawer-button-icon {
&-1 {
opacity: 0;
/* @noflip */
transform: rotate( 0deg ) scale( 0.2, 0.2 );
}
// Reflect line
&-2 {
/* @noflip */
transform: rotate( -45deg ) translate( -2px, 6px );
}
// Hide line
&-3 {
/* @noflip */
transform: rotate( 45deg ) translate( -5px, -7px );
}
}
}
// Show drawer
~ #mw-drawer-menu {
transform: none;
will-change: unset;
}
}
&:hover {
~ #mw-drawer-button-icon {
#mw-drawer-button-icon {
&-1 {
transform: translate( -50%, 0 );
}
}
.mw-drawer-button-icon {
&-div {
background-color: var( --background-color-icon--hover );
}
}
}
}
&:active {
~ #mw-drawer-button-icon {
.mw-drawer-button-icon {
&-div {
background-color: var( --background-color-icon--active );
}
}
}
}
}
&-menu {
position: fixed;
z-index: 4;
top: 0;
display: flex;
width: @drawer-width;
max-width: 100vw; // in case if someone has super small screen
height: 100%;
flex-direction: column;
background-color: var( --background-color-dp-16 );
border-radius: 0 @border-radius-large @border-radius-large 0;
transform: translate( -110%, 0 ); // shadow bleeding with 100%
transform-origin: 0 0;
transition: @transition-transform;
will-change: transform; // help with performance
.boxshadow(3);
&-logo {
display: flex;
flex-direction: column;
padding: @header-height @margin-side @margin-side / 2 @margin-side;
border-bottom: 1px solid var( --border-color-base );
}
&-main {
overflow: auto;
flex-grow: 1;
padding: @margin-side / 2 0;
overscroll-behavior: contain;
h3 {
padding: @margin-side / 2 @margin-side;
margin: @margin-side / 2 0 0 0;
color: var( --color-base--subtle );
font-size: inherit;
font-weight: normal;
letter-spacing: 0.75px;
}
}
&-main,
&-user {
font-size: @ui-menu-text;
a {
.menu-item-link;
align-items: center;
justify-content: space-between;
padding: @padding-menu-item-big;
&:after {
.resource-loader-list-icon;
display: block;
margin-left: @icon-padding;
background-size: contain;
opacity: 0.4;
transition: @transition-opacity-quick;
}
&:hover {
.menu-item-link-hover;
&:after {
opacity: 0.6;
}
}
&:active {
.menu-item-link-active;
}
}
}
}
}
.mw-drawer {
&-button {
&-icon {
&-div {
z-index: 5;
display: block;
width: @icon-size;
height: 2px;
margin: 1.5px 0;
background-color: var( --background-color-icon );
border-radius: @border-radius-large;
transform-origin: 4px 0;
transition: @transition-transform-quick, @transition-background-quick, @transition-opacity-quick;
}
}
}
}
#p-personal {
padding-top: @margin-side / 2;
border-top: 1px solid var( --border-color-base );
#pt-userpage {
margin-bottom: @margin-side / 2;
a {
flex-direction: row-reverse;
justify-content: flex-end;
&:after {
width: @icon-box-size;
height: @icon-box-size;
margin: 0;
margin-right: @margin-side;
}
}
span {
order: 2;
padding-left: @margin-side;
}
}
#pt-login {
a {
.button-blue;
&:hover,
&:active,
&:focus {
.button-blue-active;
}
}
}
#pt-logout {
a {
.button-red;
&:hover,
&:active,
&:focus {
.button-red-active;
}
}
}
// Rounded edge for the last button
#pt-login,
#pt-logout {
a {
border-radius: 0 0 @border-radius-large 0;
}
}
}
.skin-citizen-dark {
#mw-drawer {
&-menu {
&-main,
&-user {
a {
&:after {
filter: invert( 1 );
}
}
}
}
}
}