File tree 1 file changed +20
-10
lines changed
1 file changed +20
-10
lines changed Original file line number Diff line number Diff line change 1
1
<style webc:scoped>
2
- /* https://www.a11yproject.com/posts/how-to-hide-content/ */
3
- :host {
4
- clip: rect(0 0 0 0);
5
- clip-path: inset(50%);
6
- height: 1px;
7
- overflow: hidden;
8
- position: absolute;
9
- white-space: nowrap;
10
- width: 1px;
11
- }
2
+ /**
3
+ * Visually hide elements while allowing them to remain focusable
4
+ *
5
+ * Learn more:
6
+ * - https://www.a11yproject.com/posts/how-to-hide-content/
7
+ * - https://blog.logrocket.com/design-accessibility-css-visually-hidden-class/
8
+ * - https://front-end.social/@joshwcomeau/112574609127860924
9
+ */
10
+ :host:not(:has(:is(a:active, a:focus))) {
11
+ clip: rect(0 0 0 0);
12
+ clip-path: inset(50%);
13
+ height: 1px;
14
+ overflow: hidden;
15
+ position: absolute;
16
+ white-space: nowrap;
17
+ width: 1px;
18
+ }
19
+ :host:has(:is(a:active, a:focus)) {
20
+ margin: var(--box-margin);
21
+ }
12
22
</style>
You can’t perform that action at this time.
0 commit comments