Skip to content

Commit

Permalink
feat(focus-visible): chack data-attribute instead of class to close #324
Browse files Browse the repository at this point in the history
  • Loading branch information
ffoodd committed Feb 18, 2020
1 parent 32868be commit 5255f21
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions scss/_custom-forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
}

// Boosted mod
.js-focus-visible &:focus:not(.focus-visible) ~ .custom-control-label::before {
.js-focus-visible &:focus:not([data-focus-visible-added]) ~ .custom-control-label::before {
outline: 0;
}
// end mod
Expand Down Expand Up @@ -157,7 +157,7 @@
outline-color: $black;
}

.js-focus-visible .custom-control-input:checked:focus:not(.focus-visible) ~ .custom-control-label::before {
.js-focus-visible .custom-control-input:checked:focus:not([data-focus-visible-added]) ~ .custom-control-label::before {
outline: 0;
}
//end mod
Expand Down Expand Up @@ -242,7 +242,7 @@
}
}

.js-focus-visible &:focus:not(.focus-visible) ~ .custom-control-label::after {
.js-focus-visible &:focus:not([data-focus-visible-added]) ~ .custom-control-label::after {
outline: 0;
}
}
Expand Down
2 changes: 1 addition & 1 deletion scss/_o-switches.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
outline-color: theme-color("primary");
}

.js-focus-visible &:focus:not(.focus-visible) + .toggle {
.js-focus-visible &:focus:not([data-focus-visible-added]) + .toggle {
outline: 0;
}

Expand Down
4 changes: 2 additions & 2 deletions scss/_reboot.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ body {
// Boosted mod
// Using the :focus-visible polyfill to hide outline defensively
// See https://github.com/WICG/focus-visible
.js-focus-visible :focus:not(.focus-visible),
.js-focus-visible .focus:not(.focus-visible) {
.js-focus-visible :focus:not([data-focus-visible-added]),
.js-focus-visible .focus:not([data-focus-visible-added]) {
outline: 0 !important;
}
// end mod
Expand Down

0 comments on commit 5255f21

Please sign in to comment.