Skip to content

Commit

Permalink
feat: default support for :focus-visible #74
Browse files Browse the repository at this point in the history
  • Loading branch information
blackfalcon authored and jason-capsule42 committed May 12, 2021
1 parent 3b63aa8 commit 323dfa0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
12 changes: 11 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,19 @@
}
}
// if $focus-visible is true, override the default focus-visible outline
@if $focus-visible {
&:focus-visible {
outline: 2px solid var(--auro-color-ui-default-on-light);
}
} @else {
&:focus-visible {
outline: 0;
}
}
// if $focus is true, override the default focus outline
@if $focus {
&:focus-visible,
&:focus {
outline: 2px solid var(--auro-color-ui-default-on-light);
}
Expand Down
13 changes: 12 additions & 1 deletion src/_core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@import 'libSupport/manageScope';

$focus: null !default;
$focus-visible: null !default;

// sass-lint:disable no-important

Expand Down Expand Up @@ -39,9 +40,19 @@ $focus: null !default;
}
}

// if $focus-visible is true, override the default focus-visible outline
@if $focus-visible {
&:focus-visible {
outline: 2px solid var(--auro-color-ui-default-on-light);
}
} @else {
&:focus-visible {
outline: 0;
}
}

// if $focus is true, override the default focus outline
@if $focus {
&:focus-visible,
&:focus {
outline: 2px solid var(--auro-color-ui-default-on-light);
}
Expand Down

0 comments on commit 323dfa0

Please sign in to comment.