mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-12-02 19:26:51 +00:00
8fb8731c04
Adds hue-rotate( 180deg ) to the .mixin-vector-arrowed-dropdown-toggle() mixin so that the language icon doesn't appear with an orange chevron in dark-mode. Bug: T366337 Change-Id: If8f07e5924a31d761ac0af7efe0d982886bf6984
108 lines
2.8 KiB
Plaintext
108 lines
2.8 KiB
Plaintext
/**
|
|
* Less mixins.
|
|
*/
|
|
@import 'mediawiki.mixins.less';
|
|
|
|
.mixin-vector-page-container-sizing() {
|
|
// Set a min-width to make explicit we do not support anything below this threshold.
|
|
// For devices too small, they should be more useable with horizontal scrolling.
|
|
// e.g. Portrait on an iPad
|
|
min-width: @min-width-supported;
|
|
max-width: @max-width-page-container;
|
|
padding-left: @padding-horizontal-page-container;
|
|
padding-right: @padding-horizontal-page-container;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.mixin-vector-arrowed-dropdown-toggle() {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
|
|
&::after {
|
|
content: '';
|
|
background: url( ../skins.vector.styles/images/arrow-down.svg ) 100% 50% no-repeat;
|
|
width: unit( 12 / @font-size-browser, rem );
|
|
height: unit( 12 / @font-size-browser, rem );
|
|
// https://phabricator.wikimedia.org/T319070#8284272
|
|
margin-left: 7px;
|
|
|
|
html.skin-theme-clientpref-night & {
|
|
// For night-mode, invert icons so they go from black to white.
|
|
// Since invert( 1 ) changes the hue (e.g. from blue to orange)
|
|
// hue-rotate( 180deg ) changes the hue back to that of the original color.
|
|
// This slightly corrects progressive/destructive colored icons
|
|
// (although their lightness & saturation are still different, e.g. language button).
|
|
filter: invert( 1 ) hue-rotate( 180deg );
|
|
}
|
|
|
|
/**
|
|
* Auto night mode.
|
|
*
|
|
* Applies the night mode color palette only in response to system settings.
|
|
*/
|
|
@media ( prefers-color-scheme: dark ) {
|
|
html.skin-theme-clientpref-os & {
|
|
filter: invert( 1 ) hue-rotate( 180deg );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.mixin-vector-content-box() {
|
|
background-color: @background-color-base;
|
|
}
|
|
|
|
.mixin-vector-dropdown-menu() {
|
|
.mixin-vector-content-box();
|
|
padding: @padding-horizontal-dropdown-menu @padding-vertical-dropdown-menu;
|
|
font-size: @font-size-dropdown;
|
|
box-shadow: 0 2px 6px -1px rgba( 0, 0, 0, 0.2 );
|
|
transition-property: opacity;
|
|
transition-duration: @transition-duration-base;
|
|
// TODO Add consistent min/max values for dropdowns in T316055
|
|
width: max-content;
|
|
max-width: 200px;
|
|
}
|
|
|
|
.mixin-vector-dropdown-menu-item() {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: @padding-vertical-dropdown-menu-item 0;
|
|
|
|
&:not( .mw-selflink ):visited {
|
|
color: @color-link;
|
|
}
|
|
|
|
.vector-icon {
|
|
margin-right: @spacing-35;
|
|
}
|
|
|
|
&.selected a,
|
|
&.selected a:visited {
|
|
color: @color-link-selected;
|
|
}
|
|
}
|
|
|
|
.mixin-vector-scrollable-with-fade() {
|
|
overflow-x: hidden;
|
|
overflow-y: auto;
|
|
|
|
&::after {
|
|
content: '';
|
|
display: block;
|
|
position: sticky;
|
|
bottom: 0;
|
|
left: 0;
|
|
right: 0;
|
|
height: @padding-vertical-dropdown-menu;
|
|
background: linear-gradient( rgba( 255, 255, 255, 0 ), @background-color-page-container );
|
|
background-repeat: no-repeat;
|
|
pointer-events: none; // Make the link below the fade clickable
|
|
}
|
|
}
|
|
|
|
.mixin-vector-dropdown-content-flip() {
|
|
left: auto;
|
|
right: 0;
|
|
}
|