-
Notifications
You must be signed in to change notification settings - Fork 844
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aea12fa
commit 06fe023
Showing
6 changed files
with
95 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
import { EuiScreenReaderOnlyProps } from '../../../../src/components/accessibility/screen_reader'; | ||
|
||
export const ScreenReaderOnlyDocsComponent: FunctionComponent< | ||
EuiScreenReaderOnlyProps | ||
> = () => <div />; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,44 @@ | ||
import React from 'react'; | ||
|
||
import { EuiScreenReaderOnly } from '../../../../src/components/accessibility/screen_reader'; | ||
import { EuiCode } from '../../../../src/components/code'; | ||
import { EuiText } from '../../../../src/components/text'; | ||
import { EuiTitle } from '../../../../src/components/title'; | ||
|
||
export default () => ( | ||
<div> | ||
<p>This is the first paragraph. It is visible to all.</p> | ||
<EuiScreenReaderOnly> | ||
<EuiText> | ||
<p> | ||
This is the second paragraph. It is hidden for sighted users but visible | ||
to screen readers. | ||
<em> | ||
Use a screenreader to verify that there is a second paragraph in this | ||
example: | ||
</em> | ||
</p> | ||
</EuiScreenReaderOnly> | ||
<p>This is the third paragraph. It is visible to all.</p> | ||
<p>This is the first paragraph. It is visible to all.</p> | ||
<EuiScreenReaderOnly> | ||
<p> | ||
This is the second paragraph. It is hidden for sighted users but | ||
visible to screen readers. | ||
</p> | ||
</EuiScreenReaderOnly> | ||
<p>This is the third paragraph. It is visible to all.</p> | ||
<EuiTitle size="xxs"> | ||
<h4>Show on focus</h4> | ||
</EuiTitle> | ||
<p> | ||
<em> | ||
In certain cases, such as a <strong>Skip to content</strong> link, you | ||
can use the <EuiCode>showOnFocus</EuiCode> prop to display | ||
screenreader content upon focus. For example, tabbing to this section | ||
with your keyboard will display a link. | ||
</em> | ||
</p> | ||
<p> | ||
This link is visible to all on focus:{' '} | ||
<EuiScreenReaderOnly showOnFocus> | ||
<a href="#">Skip content</a> | ||
</EuiScreenReaderOnly> | ||
</p> | ||
</EuiText> | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
.euiScreenReaderOnly { | ||
@include euiScreenReaderOnly; | ||
} | ||
|
||
.euiScreenReaderOnly--showOnFocus:focus { | ||
position: static; | ||
left: auto; | ||
width: auto; | ||
height: auto; | ||
overflow: visible; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters