Skip to content

Commit 0141b47

Browse files
Remove focus-visible polyfill (#2032)
1 parent c3029cd commit 0141b47

File tree

7 files changed

+15
-23
lines changed

7 files changed

+15
-23
lines changed

.changeset/tasty-points-speak.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cloudfour/patterns': patch
3+
---
4+
5+
Remove focus-visible polyfill

.storybook/preview.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import twig from 'react-syntax-highlighter/dist/esm/languages/prism/twig';
55
import { withTheme } from './theme-decorator';
66
import { withTextFlow } from './text-flow-decorator';
77
import tokens from '../src/compiled/tokens/js/tokens';
8-
import 'focus-visible';
98
import '../src/index-with-dependencies.scss';
109
import './preview.scss';
1110
import { makeTwigInclude } from '../src/make-twig-include';

package-lock.json

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"!src/index.scss"
4141
],
4242
"dependencies": {
43-
"focus-visible": "5.2.0",
4443
"prismjs": "1.29.0"
4544
},
4645
"devDependencies": {

src/design/defaults.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ More options are available via [the Heading component](/docs/components-heading-
2525
<Canvas>
2626
<Story name="Inline elements">
2727
{`<p>
28-
<b>Progressive Web Apps</b> are awesome, <em>especially</em> when they make the <del>best</del> <ins>most</ins> of the web! That means using both tried and true <abbr title="HyperText Markup Language">HTML</abbr> techniques like <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a">links</a> alongside new techniques like <code>display: grid</code> or <a href="https://github.com/WICG/focus-visible"><code>focus-visible</code></a>! You can use <kbd>ctrl</kbd> + <kbd>c</kbd> on Windows and <kbd>⌘</kbd> + <kbd>c</kbd> on Mac.
28+
<b>Progressive Web Apps</b> are awesome, <em>especially</em> when they make the <del>best</del> <ins>most</ins> of the web! That means using both tried and true <abbr title="HyperText Markup Language">HTML</abbr> techniques like <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a">links</a> alongside new techniques like <code>display: grid</code> or <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible"><code>:focus-visible</code></a>! You can use <kbd>ctrl</kbd> + <kbd>c</kbd> on Windows and <kbd>⌘</kbd> + <kbd>c</kbd> on Mac.
2929
</p>`}
3030
</Story>
3131
</Canvas>

src/design/demo/theme-content.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% embed '@cloudfour/objects/rhythm/rhythm.twig' %}
22
{% block content %}
33
<p>
4-
<b>Progressive Web Apps</b> are awesome, <em>especially</em> when they make the <del>best</del> <ins>most</ins> of the web! That means using both tried and true <abbr title="HyperText Markup Language">HTML</abbr> techniques like <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a">links</a> alongside new techniques like <code>display: grid</code> or <a href="https://github.com/WICG/focus-visible"><code>focus-visible</code></a>!
4+
<b>Progressive Web Apps</b> are awesome, <em>especially</em> when they make the <del>best</del> <ins>most</ins> of the web! That means using both tried and true <abbr title="HyperText Markup Language">HTML</abbr> techniques like <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a">links</a> alongside new techniques like <code>display: grid</code> or <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible"><code>:focus-visible</code></a>!
55
</p>
66

77
<p>

src/mixins/_focus.scss

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
@mixin focus-visible {
2-
.js-focus-visible & {
3-
&::-moz-focus-inner {
4-
border: 0;
5-
}
2+
&::-moz-focus-inner {
3+
border: 0;
4+
}
65

7-
&:focus {
8-
outline: 0;
6+
&:focus {
7+
outline: 0;
8+
}
99

10-
&.focus-visible {
11-
@content;
12-
}
13-
}
10+
&:focus-visible {
11+
@content;
1412
}
1513
}

0 commit comments

Comments
 (0)