Skip to content

Commit

Permalink
chore: remove SCSS code for :focus-visible polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbert committed Oct 6, 2024
1 parent e177ced commit c1f8d63
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
8 changes: 8 additions & 0 deletions .changeset/forty-months-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@utrecht/focus-ring-css": major
---

Remove the SCSS variable `$utrecht-focus-visible-fallback` and remove the following mixins:

- `utrecht-focus-ring-reset`
- `utrecht-focus-pseudo-classes-backwards-compatible`
19 changes: 0 additions & 19 deletions components/focus-ring/src/_mixin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* Copyright (c) 2021 Robbert Broersma
*/

$utrecht-focus-visible-fallback: true !default;

@mixin utrecht-focus-ring {
/* - The browser default focus ring should apply when these CSS custom properties are not set.
* - Make the `box-shadow` value available, so components that have their own `box-shadow`
Expand All @@ -21,12 +19,6 @@ $utrecht-focus-visible-fallback: true !default;
outline-width: var(--utrecht-focus-outline-width, revert);
}

@mixin utrecht-focus-ring-reset {
/* undo focus ring */
box-shadow: none;
outline-style: revert;
}

/* stylelint-disable-next-line block-no-empty */
@mixin utrecht-focus {
}
Expand All @@ -43,14 +35,3 @@ $utrecht-focus-visible-fallback: true !default;
@include utrecht-focus-visible;
}
}

// When support is needed for Safari versions that do not support :focus-visible,
// use this mixin instead of the `utrecht-focus-pseudo-classes` mixin.
@mixin utrecht-focus-pseudo-classes-backwards-compatible {
&:focus {
@include utrecht-focus-ring;
}
&:focus:not(:focus-visible) {
@include utrecht-focus-ring-reset;
}
}

0 comments on commit c1f8d63

Please sign in to comment.