mediawiki-skins-Vector/resources/skins.vector.styles/components/Button.less
Volker E b55d95c70c styles: Replace legacy Vector breakpoint tokens where applicable
Replacing the legacy Vector breakpoint tokens with the Codex
standard ones. All names have been unified, only some legacy values
remain for backwards compatibility.
Also
- replacing a wrongly applied min-width with the correct max-width
  token,
- replacing a width with an equal value min-width one and
- removing the now equal value mobile min-width one.

Note that we can't do some reference magic here alike
`@max-width-breakpoint-mobile: @min-width-breakpoint-tablet - 1px;` as
this would take the Codex value from skin variables and not the legacy
value.
Also note, that we could move all those Vector legacy definitions into
Vector's 'mediawiki.skin.variables.less' file(s), but that would mean
that extensions don't rely on the Codex default values, but on Vector's
and we want latter to move to the standard, also in foresight of
further standardization to build for all feature teams like a
shared Grid.

Bug: T331403
Change-Id: Ifb968b1977001edb1a79e20df387c61f27043542
2023-10-25 22:03:46 +00:00

86 lines
2.9 KiB
Plaintext

.cdx-button:not( .cdx-button--icon-only ) .vector-icon {
// Add spacing between icon and text
margin-right: @spacing-35;
}
.cdx-button {
// Needed to horizontaly center icon buttons (floating TOC button, watchstar button)
// Can be seen on small viewports due to the fact that we arent using `.cdx-button--size-large`
justify-content: center;
}
// These rules are scoped to Vector headers due to T342190 as otherwise where buttons are used alongside
// input elements the display can look "off".
// Any other instances outside headers should be targeted directly by a rule on the element itself.
#p-lang-btn-label.cdx-button--icon-only,
#vector-page-titlebar-toc-label,
.vector-header .cdx-button.cdx-button--icon-only {
// Increase padding on small viewports
// FIXME: Replace with Codex solution i.e. `.cdx-button--size-large`
@media ( max-width: @max-width-breakpoint-tablet ) {
@min-size-interactive-touch: 44px;
min-width: @min-size-interactive-touch;
min-height: @min-size-interactive-touch;
}
}
// Hide text in icon only buttons
.cdx-button.cdx-button--icon-only {
span + span {
.mixin-screen-reader-text();
}
}
.vector-button-flush-left {
@media ( min-width: @min-width-breakpoint-desktop ) {
.cdx-mixin-button-layout-flush( 'start', true );
}
@media ( max-width: @max-width-breakpoint-tablet ) {
.cdx-mixin-button-layout-flush( 'start', true, 'large' );
}
}
.vector-button-flush-right {
@media ( min-width: @min-width-breakpoint-desktop ) {
.cdx-mixin-button-layout-flush( 'end', true );
}
@media ( max-width: @max-width-breakpoint-tablet ) {
.cdx-mixin-button-layout-flush( 'end', true, 'large' );
}
}
// Handle button styles in checkbox hack, copied from Codex
// FIXME: Remove these styles when Codex supports the checkbox hack in T333394
input:hover + .cdx-button:not( .cdx-button--action-progressive ) {
background-color: @background-color-button-quiet--hover;
}
input:active + .cdx-button:not( .cdx-button--action-progressive ) {
background-color: @background-color-button-quiet--active;
color: @color-emphasized;
border-color: @border-color-interactive;
}
input:focus:not( :active ) + .cdx-button:not( .cdx-button--action-progressive ) {
border-color: @border-color-progressive--focus;
box-shadow: @box-shadow-inset-small @box-shadow-color-progressive--focus;
}
input:hover + .cdx-button.cdx-button--action-progressive {
background-color: @background-color-progressive-subtle;
color: @color-progressive--hover;
}
input:active + .cdx-button.cdx-button--action-progressive {
background-color: @background-color-progressive--active;
color: @color-inverted;
border-color: @border-color-progressive--active;
}
input:focus:not( :active ) + .cdx-button.cdx-button--action-progressive {
border-color: @border-color-progressive--focus;
box-shadow: @box-shadow-inset-small @box-shadow-color-progressive--focus @box-shadow-inset-medium @box-shadow-color-inverted;
}