@fluid-topics/ft-wc-utils 1.2.67 → 1.2.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/accessibility.styles.d.ts +32 -0
- package/build/accessibility.styles.js +57 -0
- package/build/globals.min.js +33 -9
- package/build/index.d.ts +1 -0
- package/build/index.js +3 -0
- package/package.json +3 -3
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Invisible Content Just for Screen Reader Users
|
|
3
|
+
* See more:
|
|
4
|
+
* - https://webaim.org/techniques/css/invisiblecontent/
|
|
5
|
+
* - https://webaim.org/techniques/skipnav/
|
|
6
|
+
*
|
|
7
|
+
* The following are the recommended styles for visually hiding content
|
|
8
|
+
* that will be read by a screen reader.
|
|
9
|
+
*
|
|
10
|
+
* The .sr-only CSS class should then be referenced in the tag of the
|
|
11
|
+
* element being hidden, as shown:
|
|
12
|
+
* <div class="sr-only">This text is hidden.</div>
|
|
13
|
+
*
|
|
14
|
+
* Sighted users will not see the hidden content at all—it will be hidden well
|
|
15
|
+
* to the left of the visible browser window. Because it is still part of the
|
|
16
|
+
* page content, screen readers will read it.
|
|
17
|
+
*
|
|
18
|
+
* Skip navigation links are useful to give screen reader and keyboard users the
|
|
19
|
+
* capability of navigating directly to the main content.
|
|
20
|
+
*
|
|
21
|
+
* To address the concerns that a visible skip link can be intrusive, but
|
|
22
|
+
* still create a skip link that is useful for sighted keyboard users, we
|
|
23
|
+
* recommend creating a link that is hidden until to the user navigates to it
|
|
24
|
+
* with a keyboard.
|
|
25
|
+
*
|
|
26
|
+
* This technique uses two style definitions—one to visually hide the link, and
|
|
27
|
+
* another using the a:focus pseudo-class to visually reveal the link while it has focus.
|
|
28
|
+
*
|
|
29
|
+
* These styles should then be applied to the "skip" link:
|
|
30
|
+
* <div id="skip"><a href="#content">Skip to Main Content</a></div>
|
|
31
|
+
*/
|
|
32
|
+
export declare const screenReaderStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* Invisible Content Just for Screen Reader Users
|
|
4
|
+
* See more:
|
|
5
|
+
* - https://webaim.org/techniques/css/invisiblecontent/
|
|
6
|
+
* - https://webaim.org/techniques/skipnav/
|
|
7
|
+
*
|
|
8
|
+
* The following are the recommended styles for visually hiding content
|
|
9
|
+
* that will be read by a screen reader.
|
|
10
|
+
*
|
|
11
|
+
* The .sr-only CSS class should then be referenced in the tag of the
|
|
12
|
+
* element being hidden, as shown:
|
|
13
|
+
* <div class="sr-only">This text is hidden.</div>
|
|
14
|
+
*
|
|
15
|
+
* Sighted users will not see the hidden content at all—it will be hidden well
|
|
16
|
+
* to the left of the visible browser window. Because it is still part of the
|
|
17
|
+
* page content, screen readers will read it.
|
|
18
|
+
*
|
|
19
|
+
* Skip navigation links are useful to give screen reader and keyboard users the
|
|
20
|
+
* capability of navigating directly to the main content.
|
|
21
|
+
*
|
|
22
|
+
* To address the concerns that a visible skip link can be intrusive, but
|
|
23
|
+
* still create a skip link that is useful for sighted keyboard users, we
|
|
24
|
+
* recommend creating a link that is hidden until to the user navigates to it
|
|
25
|
+
* with a keyboard.
|
|
26
|
+
*
|
|
27
|
+
* This technique uses two style definitions—one to visually hide the link, and
|
|
28
|
+
* another using the a:focus pseudo-class to visually reveal the link while it has focus.
|
|
29
|
+
*
|
|
30
|
+
* These styles should then be applied to the "skip" link:
|
|
31
|
+
* <div id="skip"><a href="#content">Skip to Main Content</a></div>
|
|
32
|
+
*/
|
|
33
|
+
export const screenReaderStyles = css `
|
|
34
|
+
.sr-only {
|
|
35
|
+
position:absolute;
|
|
36
|
+
left:-10000px;
|
|
37
|
+
top:auto;
|
|
38
|
+
width:1px;
|
|
39
|
+
height:1px;
|
|
40
|
+
overflow:hidden;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
#skip a {
|
|
44
|
+
position:absolute;
|
|
45
|
+
left:-10000px;
|
|
46
|
+
top:auto;
|
|
47
|
+
width:1px;
|
|
48
|
+
height:1px;
|
|
49
|
+
overflow:hidden;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
#skip a:focus {
|
|
53
|
+
position:static;
|
|
54
|
+
width:auto;
|
|
55
|
+
height:auto;
|
|
56
|
+
}
|
|
57
|
+
`;
|