2020-05-16 13:36:08 -07:00
|
|
|
:focus {
|
2019-09-22 20:11:40 -07:00
|
|
|
outline: var(--focus-width) solid var(--focus-outline);
|
2019-09-21 13:45:48 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
.container:focus {
|
|
|
|
// the outline causes choppy rendering on Edge and isn't visible or necessary anyway
|
|
|
|
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/17343598/
|
|
|
|
outline: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Special class to make focus outlines easier to see in some odd
|
|
|
|
* cases where the outline would be clipped. */
|
2019-09-22 20:11:40 -07:00
|
|
|
/* TODO: use box-sizing:border-box everywhere so we can get rid of this hack */
|
2019-09-24 00:50:35 -07:00
|
|
|
.focus-fix:focus {
|
|
|
|
outline-offset: calc(-1 * var(--focus-width)); /* TODO: this is hacky, switch to box-sizing:border-box */
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Another hack to make some focus styles appear better */
|
2019-09-21 13:45:48 -07:00
|
|
|
.focus-after {
|
|
|
|
position: relative;
|
|
|
|
|
2019-09-24 18:46:58 -07:00
|
|
|
&:focus {
|
|
|
|
outline: none;
|
|
|
|
}
|
2019-09-21 13:45:48 -07:00
|
|
|
|
2019-09-24 18:46:58 -07:00
|
|
|
&:focus::after {
|
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
top: 0;
|
|
|
|
content: '';
|
|
|
|
border: var(--focus-width) solid var(--focus-outline);
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
2019-09-21 13:45:48 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// For KaiOS, do some additional things to improve the focus styles, which don't show up well
|
|
|
|
// for some reason
|
2019-09-21 18:16:55 -07:00
|
|
|
@media (max-width: 240px) {
|
2019-09-24 00:50:35 -07:00
|
|
|
a:not(.button):focus, span:focus {
|
2019-09-21 13:45:48 -07:00
|
|
|
background: var(--focus-bg) !important;
|
|
|
|
}
|
|
|
|
|
2019-09-24 00:50:35 -07:00
|
|
|
button:focus, .button:focus {
|
2019-09-21 13:45:48 -07:00
|
|
|
opacity: 0.7;
|
|
|
|
}
|
2019-09-21 18:16:55 -07:00
|
|
|
|
2019-09-24 00:50:35 -07:00
|
|
|
button.primary:focus, .button.primary:focus {
|
|
|
|
opacity: 0.8;
|
|
|
|
}
|
|
|
|
|
2019-09-24 18:46:58 -07:00
|
|
|
// add extremely visible styles for buttons, ala .focus-after
|
|
|
|
button, .button, a.main-nav-link {
|
2019-09-21 18:16:55 -07:00
|
|
|
position: relative;
|
|
|
|
|
2019-09-24 18:46:58 -07:00
|
|
|
&:focus {
|
|
|
|
outline: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:focus::after {
|
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
top: 0;
|
|
|
|
content: '';
|
|
|
|
border: var(--focus-width) solid var(--focus-outline);
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
2019-09-21 18:16:55 -07:00
|
|
|
|
|
|
|
}
|
2019-09-21 13:45:48 -07:00
|
|
|
}
|