Skip to content

Commit

Permalink
Merge pull request #12 from Beg-in/sb0stn-master
Browse files Browse the repository at this point in the history
Sb0stn Screen Reader Classes
  • Loading branch information
codysherman authored Nov 10, 2019
2 parents b25cf20 + 86d6a8b commit 3fd0b0f
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 4 deletions.
12 changes: 12 additions & 0 deletions dist/frow.css
Original file line number Diff line number Diff line change
Expand Up @@ -2484,3 +2484,15 @@ textarea {
display: block !important; }
.frow.visible-print {
display: flex !important; } }

.visible-sr,
.visible-sr-focusable:not(:focus) {
position: absolute !important;
width: 1px !important;
height: 1px !important;
padding: 0 !important;
margin: -1px !important;
overflow: hidden !important;
clip: rect(0, 0, 0, 0) !important;
white-space: nowrap !important;
border: 0 !important; }
2 changes: 1 addition & 1 deletion dist/frow.min.css

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions docs/styles/frow.css
Original file line number Diff line number Diff line change
Expand Up @@ -2485,3 +2485,15 @@ textarea {
display: block !important; }
.frow.visible-print {
display: flex !important; } }

.visible-sr,
.visible-sr-focusable:not(:focus) {
position: absolute !important;
width: 1px !important;
height: 1px !important;
padding: 0 !important;
margin: -1px !important;
overflow: hidden !important;
clip: rect(0, 0, 0, 0) !important;
white-space: nowrap !important;
border: 0 !important; }
19 changes: 19 additions & 0 deletions docs/utilities.html
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,25 @@ <h5 id="media-print-shortcuts">
<!-- -->
<!-- --><span class="fake-comment">// This element would only appear when printed out</span>
<!-- --><span>&lt;div class="visible-print"&gt;&lt;/div&gt;</span>
<!-- --></pre>
<h5 id="accessibility-shortcuts">
<a href="#accessibility-shortcuts">
Accessibility Shortcuts
</a>
</h5>
<p>
Use these pre-made rules to create elements that only screenreader users can see.
</p>
<pre class="fake-code bottom-margin">
<!-- --><span class="fake-comment">// .visible-sr and .visible-sr-focusable</span>
<!-- -->
<!-- --><span class="fake-comment">// Visually hidden element which is still accessible to users with a screenreader</span>
<!-- --><span class="fake-comment">// This can be used to give context to elements, such as a "Read more" button</span>
<!-- -->&lt;a&gt;Read more &lt;span class="visible-sr"&gt;about this news article&lt;/span&gt;&lt;/a&gt;
<!-- -->
<!-- --><span class="fake-comment">// Similiar to .visible-sr, but this element will become visible when it receives focus from the user</span>
<!-- --><span class="fake-comment">// This can be used for things like "Skip to content" links at the top of the page</span>
<!-- -->&lt;a class="visible-sr-focusable"&gt;Skip to main content&lt;/a&gt;
<!-- --></pre>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frow",
"version": "3.1.4",
"version": "3.2.0",
"description": "Flexbox Toolkit & Grid",
"main": "frow.sass",
"scripts": {
Expand Down
18 changes: 16 additions & 2 deletions src/_utilities.sass
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
.grow-0
flex-grow: 0 !important

.grow-1
.grow-1
flex-grow: 1 !important

// Cursor pointer classes
Expand Down Expand Up @@ -172,4 +172,18 @@
display: block !important

.frow.visible-print
display: flex !important
display: flex !important

// Accessibility rules
// -------------------------
.visible-sr,
.visible-sr-focusable:not(:focus)
position: absolute !important
width: 1px !important
height: 1px !important
padding: 0 !important
margin: -1px !important
overflow: hidden !important
clip: rect(0, 0, 0, 0) !important
white-space: nowrap !important
border: 0 !important

0 comments on commit 3fd0b0f

Please sign in to comment.