WordPress/wp-admin/css/colors/_mixins.scss
Andrea Fercia 618883f6f4 Accessibility: Improve and modernize user interface controls for better contrast. First part: buttons and links.
- 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
2019-09-23 14:43:58 +00:00

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;
}
}