Use :focus-visible instead of :focus for focus markers
In this way, after the user clicked with a pointer and moved that pointer away, the focus marker will no longer show a focused style. As Safari remains the only major browser engine that does not support :focus-visible, a fallback to :focus is used if there is no browser support for :focus-visible. https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible
This commit is contained in:
parent
378ed3682e
commit
97951fccfd
5 changed files with 23 additions and 10 deletions
|
@ -168,11 +168,12 @@
|
|||
color: var(--text, $fallback--text);
|
||||
}
|
||||
|
||||
.focus-marker {
|
||||
.focus-marker,
|
||||
&:focus:not(:focus-visible):not(:hover) .focus-marker {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
&:hover, &:focus {
|
||||
&:hover, &:focus, &:focus-visible {
|
||||
.focus-marker {
|
||||
visibility: visible;
|
||||
}
|
||||
|
|
|
@ -78,11 +78,16 @@
|
|||
color: var(--cOrange, $fallback--cOrange);
|
||||
}
|
||||
|
||||
.focus-marker {
|
||||
.focus-marker,
|
||||
&:focus:not(:focus-visible):not(:hover) .focus-marker {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
&:hover, &:focus {
|
||||
&:focus:not(:focus-visible):not(:hover) .active-marker {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
&:hover, &:focus, &:focus-visible {
|
||||
.focus-marker {
|
||||
visibility: visible;
|
||||
}
|
||||
|
|
|
@ -141,11 +141,12 @@
|
|||
color: var(--text, $fallback--text);
|
||||
}
|
||||
|
||||
.focus-marker {
|
||||
.focus-marker,
|
||||
&:focus:not(:focus-visible):not(:hover) .focus-marker {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
&:hover, &:focus {
|
||||
&:hover, &:focus, &:focus-visible {
|
||||
.focus-marker {
|
||||
visibility: visible;
|
||||
}
|
||||
|
|
|
@ -67,11 +67,12 @@
|
|||
color: var(--cBlue, $fallback--cBlue);
|
||||
}
|
||||
|
||||
.focus-marker {
|
||||
.focus-marker,
|
||||
&:focus:not(:focus-visible):not(:hover) .focus-marker {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
&:hover, &:focus {
|
||||
&:hover, &:focus, &:focus-visible {
|
||||
.focus-marker {
|
||||
visibility: visible;
|
||||
}
|
||||
|
|
|
@ -85,11 +85,16 @@
|
|||
color: var(--cGreen, $fallback--cGreen);
|
||||
}
|
||||
|
||||
.focus-marker {
|
||||
.focus-marker,
|
||||
&:focus:not(:focus-visible):not(:hover) .focus-marker {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
&:hover, &:focus {
|
||||
&:focus:not(:focus-visible):not(:hover) .active-marker {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
&:hover, &:focus, &:focus-visible {
|
||||
.focus-marker {
|
||||
visibility: visible;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue