selected
view sourceApply rules to :hover
and :focus
(and, optionally, :active
) states.
- use-name
-
scut-selected
- type
- mixin only
- arguments
-
-
$active
- default
-
false
-
- @content
A content block passed to this mixin will apply to the selected states (
:hover
and:focus
— and, optionally,:active
).
Make your site more friendly for keyboard navigation, especially, by accounting for the various means of targeting elements.
example
SCSS
.eg-selected-1 {
@include scut-selected {
background-color: $eg-light;
}
}
.eg-selected-2 {
@include scut-selected(true) {
background-color: $eg-light;
}
}
compiled CSS
.eg-selected-1:hover, .eg-selected-1:focus {
background-color: #9AE9FF;
}
.eg-selected-2:hover, .eg-selected-2:focus, .eg-selected-2:active {
background-color: #9AE9FF;
}
Declare whether or not to target the
:active
state, in addition to:hover
and:focus
.