mediawiki-skins-Citizen/skinStyles/mediawiki/ui/mediawiki.ui.button.less

205 lines
4.8 KiB
Plaintext
Raw Normal View History

/*
* Citizen
*
* SkinStyles for MediaWiki
* Module: mediawiki.ui.button
* Version: REL1_39
*
* Date: 2022-11-30
*/
.mw-ui-button {
2022-12-01 02:42:28 +00:00
border-color: var( --color-surface-2 );
background-color: var( --color-surface-2 );
color: var( --color-base--emphasized );
font-weight: var( --font-weight-semibold );
&:not( :disabled ) {
&:visited {
color: var( --color-base--emphasized );
}
// Simplify hover style to only change background color
&:hover {
border-color: var( --border-color-base );
background-color: var( --color-surface-2--hover );
color: var( --color-base--emphasized );
}
&:focus {
border-color: var( --color-primary );
box-shadow: inset 0 0 0 1px var( --color-primary ), inset 0 0 0 2px var( --color-surface-0 );
color: var( --color-base--emphasized );
}
&:active,
&.is-on {
2022-12-01 02:42:28 +00:00
border-color: var( --color-surface-2--active );
background-color: var( --color-surface-2--active );
2022-12-01 02:42:28 +00:00
color: var( --color-base--subtle );
}
}
&:disabled {
border-color: var( --color-surface-4 );
background-color: var( --color-surface-4 );
color: var( --color-base--subtle );
}
&.mw-ui-quiet,
&.mw-ui-quiet.mw-ui-progressive,
&.mw-ui-quiet.mw-ui-destructive {
color: var( --color-base--emphasized );
font-weight: var( --font-weight-semibold );
input[ type='checkbox' ]:hover + &,
&:hover {
background-color: var( --background-color-quiet--hover );
color: var( --color-base--emphasized );
}
input[ type='checkbox' ]:focus + &,
&:focus {
border-color: var( --color-primary );
box-shadow: inset 0 0 0 1px var( --color-primary ), inset 0 0 0 2px var( --color-surface-0 );
color: var( --color-base--emphasized );
}
input[ type='checkbox' ]:active + &,
&:active {
border-color: transparent;
background-color: var( --background-color-quiet--active );
2022-12-01 02:42:28 +00:00
color: var( --color-base--subtle );
}
&:disabled,
&:disabled:hover,
&:disabled:active {
color: var( --color-base--subtle );
}
}
&.mw-ui-progressive {
&:not( :disabled ) {
border-color: var( --color-primary );
background-color: var( --color-primary );
&:hover {
border-color: var( --color-primary--hover );
background-color: var( --color-primary--hover );
2022-12-01 02:42:28 +00:00
color: #fff;
}
&:focus {
box-shadow: inset 0 0 0 1px var( --color-primary ), inset 0 0 0 2px #fff;
}
&:active,
&.is-on {
border-color: var( --color-primary--active );
background-color: var( --color-primary--active );
2022-12-01 02:42:28 +00:00
color: #fff;
}
}
&:disabled {
border-color: var( --color-surface-4 );
background-color: var( --color-surface-4 );
color: var( --color-base--subtle );
}
&.mw-ui-quiet {
color: var( --color-primary );
input[ type='checkbox' ]:hover + &,
&:hover {
// Simplify quiet hover style
background-color: var( --background-color-quiet--hover );
color: var( --color-primary--hover );
}
input[ type='checkbox' ]:focus + &,
&:focus {
border-color: var( --color-primary );
color: var( --color-primary );
}
input[ type='checkbox' ]:active + &,
&:active {
border-color: var( --color-primary--active );
background-color: var( --color-primary--active );
}
}
}
&.mw-ui-destructive {
&:not( :disabled ) {
border-color: var( --color-destructive );
background-color: var( --color-destructive );
&:hover {
border-color: var( --color-destructive--hover );
background-color: var( --color-destructive--hover );
2022-12-01 02:42:28 +00:00
color: #fff;
}
&:focus {
box-shadow: inset 0 0 0 1px var( --color-destructive ), inset 0 0 0 2px #fff;
}
&:active,
&.is-on {
border-color: var( --color-destructive--active );
background-color: var( --color-destructive--active );
2022-12-01 02:42:28 +00:00
color: #fff;
}
}
&:disabled {
border-color: var( --color-surface-4 );
background-color: var( --color-surface-4 );
color: var( --color-base--subtle );
}
&.mw-ui-quiet {
color: var( --color-destructive );
input[ type='checkbox' ]:hover + &,
&:hover {
// Simplify quiet hover style
background-color: var( --background-color-quiet--hover );
color: var( --color-destructive--hover );
}
input[ type='checkbox' ]:focus + &,
&:focus {
border-color: var( --color-destructive );
color: var( --color-destructive );
}
input[ type='checkbox' ]:active + &,
&:active {
border-color: var( --color-destructive--active );
background-color: var( --color-destructive--active );
}
}
}
&.mw-ui-big {
// Smaller font size since MW UI assume a 14px base font size
font-size: 1.125em;
}
& > * {
&:first-child {
border-bottom-left-radius: var( --border-radius--small );
border-top-left-radius: var( --border-radius--small );
}
&:last-child {
border-bottom-right-radius: var( --border-radius--small );
border-top-right-radius: var( --border-radius--small );
}
}
}