kopia lustrzana https://github.com/wagtail/wagtail
Use focus-visible for switch component
Prevent unnecessary outline when clicking on the componentpull/10209/head
rodzic
6ec6895f4f
commit
b0896ef53b
|
@ -89,10 +89,17 @@ $switch-border-radius: math.div(($switch-height + $switch-border * 2), 2);
|
|||
opacity: 0.3;
|
||||
}
|
||||
|
||||
[type='checkbox']:focus + &__toggle {
|
||||
[type='checkbox']:focus-visible + &__toggle {
|
||||
outline: $color-focus-outline solid $switch-outline;
|
||||
}
|
||||
|
||||
@supports not selector(:focus-visible) {
|
||||
/* Fallback for browsers without :focus-visible support */
|
||||
[type='checkbox']:focus + &__toggle {
|
||||
outline: $color-focus-outline solid $switch-outline;
|
||||
}
|
||||
}
|
||||
|
||||
[type='checkbox'] {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
|
|
Ładowanie…
Reference in New Issue