mirror of
https://github.com/WordPress/WordPress.git
synced 2024-07-10 22:04:43 +02:00
- Introduces new styles for the buttons, with better contrast for borders and better focus style. - Introduces a new focus style for links. - The new styles improve consistency with the ones used in the new Block Editor (Gutenberg). Props michaelarestad, truchot, mor10, kellychoffman, adamsoucie, paaljoachim, Joen, kjellr, melchoyce, karmatosed, audrasjb, afercia. Fixes #34904. Built from https://develop.svn.wordpress.org/trunk@46241 git-svn-id: http://core.svn.wordpress.org/trunk@46053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
41 lines
879 B
SCSS
41 lines
879 B
SCSS
/*
|
|
* Button mixin- creates a button effect with correct
|
|
* highlights/shadows, based on a base color.
|
|
*/
|
|
@mixin button( $button-color, $text-color: #fff ) {
|
|
background: $button-color;
|
|
border-color: $button-color;
|
|
color: $text-color;
|
|
|
|
&:hover,
|
|
&:focus {
|
|
background: lighten( $button-color, 3% );
|
|
border-color: darken( $button-color, 3% );
|
|
color: $text-color;
|
|
}
|
|
|
|
&:focus {
|
|
box-shadow:
|
|
0 0 0 1px #fff,
|
|
0 0 0 3px $button-color;
|
|
}
|
|
|
|
&:active,
|
|
&.active,
|
|
&.active:focus,
|
|
&.active:hover {
|
|
background: darken( $button-color, 5% );
|
|
border-color: darken( $button-color, 5% );
|
|
}
|
|
|
|
&[disabled],
|
|
&:disabled,
|
|
&.button-primary-disabled,
|
|
&.disabled {
|
|
color: hsl( hue( $button-color ), 10%, 80% ) !important;
|
|
background: lighten( $button-color, 15% ) !important;
|
|
border-color: lighten( $button-color, 15% ) !important;
|
|
text-shadow: none !important;
|
|
}
|
|
}
|