Files
mediawiki-extensions-Univer…/resources/css/ext.uls.pt.less
Volker E d5285655fd styles: Replace 'mediawiki.ui/variables' call with skin variables
- Replacing 'mediawiki.ui/variables.less' `@import`
  with new Codex design tokens as external library. We're using the
  legacy values as UniversalLanguageSelector has been a desktop first
  extension and those values are also used by Vector skin.
  The values replaced are anyways only touching colors, borders or
  transitions which are the same in normal and legacy.
  These will be replaced by skin-aware 'mediawiki.skin.variables.less'
  standard with dependency of UniversalLanguageSelector upped
  to MW 1.42.0.
- Replacing several static values with new Codex design token featuring
  skin variables, in categories `background-color`, `color`,
  `border-*`, `box-shadow`, `opacity` and `transition`.

Note, that this change should result in same rendering of the
extension, only properties that already have an equal token are
replaced.

Bug: T332541
Co-Authored-by: Volker E. <volker.e@wikimedia.org>
Change-Id: Ic563fa84bf8e76fd62f14487924d7d6fd5c1a065
2023-05-04 04:44:44 +00:00

57 lines
2.1 KiB
Plaintext

// TODO: Replace with @import 'mediawiki.skin.variables.less'; with MW core LTS v1.42 dependency.
@import '../../lib/codex-design-tokens/theme-wikimedia-ui-legacy.less';
@import 'mediawiki.mixins';
// Similar to from Vector's 'personalMenu.less' file.
@font-size-browser: 16; // Assumed browser default of `16px`
// ULS personal tool menu
@background-position-menu-uls-icon: left ( 1 / @font-size-browser / @font-size-menu-uls );
@background-size-menu-uls-icon: 16 / @font-size-browser / @font-size-menu-uls;
@padding-top-menu-uls-icon: 4 / @font-size-browser / @font-size-menu-uls;
@padding-left-menu-uls-icon: 20 / @font-size-browser / @font-size-menu-uls;
@font-size-menu-uls: 0.75em;
/*
* The trigger can be placed in the personal toolbar near the username
* or near the interlanguage links.
*/
/*
* A hack to load the icon before the rest of the module is lazy-loaded.
* Copied from jquery.uls.css with the path changed.
*/
.uls-trigger {
background: no-repeat url( ../../lib/jquery.uls/images/language.svg ) left center;
// Let the SVG image fit without cropping or stretch
background-size: contain;
padding-left: 24px;
}
/* stylelint-disable indentation, selector-max-id */
#pt-uls {
padding-top: 0 !important; // stylelint-disable-line declaration-no-important
.uls-trigger {
background-image: none;
// Same values as Vector's `#p-personal li`.
display: inline-block;
padding-top: 0.5em !important; // stylelint-disable-line declaration-no-important
padding-left: 0;
// Putting the icon in before in order to apply `opacity`.
&::before {
content: '';
background-image: url( ../../lib/jquery.uls/images/language.svg );
// Same values as Vector's `#pt-userpage a`.
background-position: @background-position-menu-uls-icon;
// Support Edge: Can't be `contain`, see T207075.
background-repeat: no-repeat;
background-size: @background-size-menu-uls-icon @background-size-menu-uls-icon;
padding-top: @padding-top-menu-uls-icon;
padding-left: @padding-left-menu-uls-icon;
// Equals `#555`, closest to `#54595d` on background-color `#fff`.
opacity: @opacity-icon-subtle;
}
}
}