2018-12-17 04:23:04 +01:00
|
|
|
/*
|
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 16:43:58 +02:00
|
|
|
* Button mixin- creates a button effect with correct
|
2018-12-17 04:23:04 +01:00
|
|
|
* highlights/shadows, based on a base color.
|
|
|
|
*/
|
2019-12-05 23:12:03 +01:00
|
|
|
@mixin button( $button-color, $button-text-color: #fff ) {
|
2018-12-17 04:23:04 +01:00
|
|
|
background: $button-color;
|
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 16:43:58 +02:00
|
|
|
border-color: $button-color;
|
2019-12-05 22:32:03 +01:00
|
|
|
color: $button-text-color;
|
2018-12-17 04:23:04 +01:00
|
|
|
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
background: lighten( $button-color, 3% );
|
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 16:43:58 +02:00
|
|
|
border-color: darken( $button-color, 3% );
|
2019-12-05 22:32:03 +01:00
|
|
|
color: $button-text-color;
|
2018-12-17 04:23:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
&:focus {
|
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 16:43:58 +02:00
|
|
|
box-shadow:
|
|
|
|
0 0 0 1px #fff,
|
|
|
|
0 0 0 3px $button-color;
|
2018-12-17 04:23:04 +01:00
|
|
|
}
|
|
|
|
|
2019-10-07 20:47:05 +02:00
|
|
|
&:active {
|
|
|
|
background: darken( $button-color, 5% );
|
|
|
|
border-color: darken( $button-color, 5% );
|
2019-12-05 22:32:03 +01:00
|
|
|
color: $button-text-color;
|
2019-10-07 20:47:05 +02:00
|
|
|
}
|
|
|
|
|
2018-12-17 04:23:04 +01:00
|
|
|
&.active,
|
|
|
|
&.active:focus,
|
|
|
|
&.active:hover {
|
2019-10-07 20:47:05 +02:00
|
|
|
background: $button-color;
|
2019-12-05 22:32:03 +01:00
|
|
|
color: $button-text-color;
|
2019-10-07 20:47:05 +02:00
|
|
|
border-color: darken( $button-color, 15% );
|
|
|
|
box-shadow: inset 0 2px 5px -3px darken( $button-color, 50% );
|
2018-12-17 04:23:04 +01:00
|
|
|
}
|
|
|
|
}
|