Files
mediawiki-extensions-Univer…/resources/css/ext.uls.pt.less
jdlrobson 5ca2ccb58a Language button icon/button should be consistent with other buttons
This converts the language button into a mw-ui-button which is the
class we're currently using in both Vector and Minerva. In future
this can become a WVUI button using the same roadmap as Vector
and Minerva.

This fixes the issue with the icon resize, as well as the issue
with the button lacking appropriate hover/focus states.

Bug: T289630
Change-Id: I8242986e8762a8f663f8cab07c54481e14223320
2021-09-01 08:05:54 +00:00

83 lines
2.4 KiB
Plaintext

/* stylelint-disable indentation, selector-max-id */
@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 a:before {
background: no-repeat url( ../../lib/jquery.uls/images/language.svg ) left center;
}
.vector-user-links {
.uls-trigger {
// Disable additional icon on load.
background-image: none;
// Can be removed when no longer need to override rule in jquery.uls.css
padding-left: 12px;
}
}
// Vector modern = ca-uls
// Other skins = pt-uls
#pt-uls {
.mw-ui-button {
display: inline;
padding: 0;
border: 0;
}
.uls-trigger {
// 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: 0.67;
}
}
}
.skin-vector {
#ca-uls span {
font-size: 0.875em;
}
}
/* Opera for some inexplicable reason confuses right and left padding with */
/* RTL text direction here (bug T47142). x:-o-prefocus won't match anything, */
/* but will make other browsers ignore this rule. */
/* stylelint-disable selector-type-no-unknown */
x:-o-prefocus,
body.rtl li#pt-uls {
/* @noflip */
direction: ltr;
}
/* stylelint-enable selector-type-no-unknown */
/* Don't show it to users who disabled JS */
.client-nojs #pt-uls {
display: none;
}