UNPKG

1.55 kBtext/lessView Raw
1@import (reference) './imports/aui-theme/core/colors';
2@import (reference) './imports/aui-theme/core/borders';
3@import (reference) './imports/mixins/focus';
4
5// Only affect focusable elements inside a parent container with this class
6// https://bitbucket.org/atlassian/aui/pull-requests/2872
7.aui-browser-focus {
8 // Get rid of the outline style on <button> and <input> elements in Firefox.
9 // This doesn't have to be in our general mixin, since it only affects those two elements.
10 // See http://wtfhtmlcss.com/#buttons-firefox-outline.
11 button::-moz-focus-inner,
12 input::-moz-focus-inner {
13 border: 0;
14 }
15
16 // Affect browser's focussed-element outline colour
17 :focus {
18 // NOTE: these are all separate because Legacy Edge does not respect the CSS var in the multivalued `outline` prop.
19 outline-width: 2px;
20 outline-style: solid;
21 outline-color: @aui-focus-ring-color;
22 outline-offset: 1px;
23 // only affects Firefox, but... hey, maybe one day other browsers will support it, too!
24 -moz-outline-radius: @aui-border-radius-small;
25 outline-radius: @aui-border-radius-small;
26 }
27}
28
29// Remove default focus styles for mouse users ONLY if
30// :focus-visible is supported on this platform.
31html:not(.aui-no-focusvisible) .aui-browser-focus :focus:not(:focus-visible) {
32 outline: unset;
33 outline-offset: unset;
34}
35
36// Affect the potential CSS standard pseudo-selector
37html:not(.aui-no-focusvisible) .aui-browser-focus :focus-visible {
38 #aui.with-focus-ring();
39}