mediawiki-skins-Vector/resources/common/mixins.less
Jon Robson e62062631d Restrict margin between arrow and icon to feature flag
Follow up to 1bb0a0e8f

Bug: T319070
Change-Id: I850088abdf815c0c65a05aa2a7dfd9445aa688f6
2022-10-05 19:18:55 +00:00

79 lines
2 KiB
Plaintext

/**
* Less mixins shared between both legacy and Vector 2022.
*/
// Defines the arrow beside dropdown headings.
.mixin-vector-menu-heading-arrow() {
content: '';
background: url( ../common/images/arrow-down.svg ) 100% 50% no-repeat;
width: unit( 16 / @font-size-tabs / @font-size-browser, em );
height: unit( 16 / @font-size-tabs / @font-size-browser, em );
// FIXME: This can be folded into the main mixin as soon as wgVectorVisualEnhancementNext
// is default. This rule should not apply to the current master as is part of a larger
// set of changes that must go out together.
.vector-feature-visual-enhancement-next-enabled & {
// https://phabricator.wikimedia.org/T319070#8284272
margin-left: -1px;
}
}
.mixin-vector-dropdown-menu-item() {
//NOTE: using px instead of em's due to difference in font-size
// across dropdowns (i.e tabs 13px vs. personal menu 14px).
min-height: 32px;
display: flex;
align-items: center;
padding: 0 12px;
&:visited {
color: @color-link;
}
&.selected a,
&.selected a:visited {
color: @color-link-selected;
}
}
// Copied from mediawiki.ui.icons
// (Ifccaadabd72a12814d3d4d01200931f7254c6cd5)
// but converted to px to match `mw-ui-button`
@icon-padding-md: 12px;
// Copied from mediawiki.ui.icons,
// (Ifccaadabd72a12814d3d4d01200931f7254c6cd5)
// but converted to px to match `mw-ui-button`
@icon-padding-md-next: 5px;
.mixin-vector-flush-right-margin-left() {
margin-left: @icon-padding-md;
.vector-feature-visual-enhancement-next-enabled & {
margin-left: @icon-padding-md-next;
}
}
.mixin-vector-flush-left-margin-left() {
margin-left: -@icon-padding-md;
.vector-feature-visual-enhancement-next-enabled & {
margin-left: -@icon-padding-md-next;
}
}
.mixin-vector-flush-right-margin-right() {
margin-right: -@icon-padding-md;
.vector-feature-visual-enhancement-next-enabled & {
margin-right: -@icon-padding-md-next;
}
}
.mixin-vector-flush-left-left() {
left: -@icon-padding-md;
.vector-feature-visual-enhancement-next-enabled & {
left: -@icon-padding-md-next;
}
}