mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-27 00:50:08 +00:00
3c0559a71d
Consolidates the CSS responsible for styling chevrons into one implementation. This removes the need for custom padding and background positioning for the following components: - "more" menu - user menu - watchstar - language button - languge button in sticky header Instead of absolutely positioning the chevron on these components, the parent label element is set to `display: inline-flex` so that the chevron is vertically aligned and given enough space by default. The watchstar, although not a chevron, is also given the `display: inline-flex` treatment so that it can be aligned with other elements in the toolbar. This new implementation requires splitting the watchstar component into legacy and modern due to a quirk in Firefox that causes a bug with the watchstar in legacy Vector. NOTE: This change causes visual changes due to the difference in centering the chevrons via flexbox vs percentage positions. Bug: T308344, T310838 Change-Id: Ie9e0fce1366cd25a5899fee49770de4a09424fe2
73 lines
2.2 KiB
Plaintext
73 lines
2.2 KiB
Plaintext
@import '../../common/variables.less';
|
|
@import 'mediawiki.mixins.less';
|
|
@import 'mediawiki.mixins.rotation.less';
|
|
|
|
/* Watch/Unwatch Icon Styling */
|
|
/* Only use icon if the menu item is not collapsed into the "More" dropdown
|
|
* (in which case it is inside `.vector-menu-dropdown` instead of `.vector-menu-tabs`). */
|
|
.vector-menu-tabs {
|
|
// `#ca-unwatch` & `#ca-watch` both carry `.mw-watchlink` as well.
|
|
@width-watchlink: unit( 28 / @font-size-tabs / @font-size-browser, em );
|
|
@height-watchlink: unit( 40 / @font-size-tabs / @font-size-browser, em );
|
|
@size-watchlink-icon: unit( 16 / @font-size-tabs / @font-size-browser, em );
|
|
|
|
.mw-watchlink.icon a {
|
|
width: @width-watchlink;
|
|
/* This hides the text but shows the background image */
|
|
/* Must not exceed parent's height, otherwise the background disappears on Chrome (T196610) */
|
|
height: 0;
|
|
padding: @height-watchlink 0 0 0;
|
|
overflow: hidden;
|
|
|
|
&:before {
|
|
background-repeat: no-repeat;
|
|
background-position: 50% 50%;
|
|
content: '';
|
|
display: block;
|
|
position: absolute;
|
|
top: unit( 14 / @font-size-tabs / @font-size-browser, em );
|
|
left: unit( 5 / @font-size-tabs / @font-size-browser, em );
|
|
width: @size-watchlink-icon;
|
|
height: @size-watchlink-icon;
|
|
}
|
|
}
|
|
|
|
#ca-unwatch.icon a:before {
|
|
background-image: url( ../common/images/unwatch-icon.svg );
|
|
}
|
|
|
|
#ca-unwatch.mw-watchlink-temp.icon a:before {
|
|
background-image: url( ../common/images/unwatch-temp-icon.svg );
|
|
}
|
|
|
|
#ca-watch.icon a:before {
|
|
background-image: url( ../common/images/watch-icon.svg );
|
|
}
|
|
|
|
#ca-unwatch.icon a:hover:before,
|
|
#ca-unwatch.icon a:focus:before {
|
|
background-image: url( ../common/images/unwatch-icon-hl.svg );
|
|
}
|
|
|
|
#ca-unwatch.mw-watchlink-temp.icon a:hover:before,
|
|
#ca-unwatch.mw-watchlink-temp.icon a:focus:before {
|
|
background-image: url( ../common/images/unwatch-temp-icon-hl.svg );
|
|
}
|
|
|
|
#ca-watch.icon a:hover:before,
|
|
#ca-watch.icon a:focus:before {
|
|
background-image: url( ../common/images/watch-icon-hl.svg );
|
|
}
|
|
|
|
// Loading watchstar link class.
|
|
#ca-unwatch.icon .loading:before,
|
|
#ca-watch.icon .loading:before {
|
|
.rotation( 700ms );
|
|
/* Suppress the hilarious rotating focus outline on Firefox */
|
|
outline: 0;
|
|
cursor: default;
|
|
pointer-events: none;
|
|
transform-origin: 50% 50%;
|
|
}
|
|
}
|