-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Build close button files * Update iconography adding example of .nsw-icon-button
- Loading branch information
1 parent
2a55b67
commit 84d1d28
Showing
4 changed files
with
66 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<button class="nsw-icon-button" type="button"> | ||
{{>_icon }} | ||
<span class="sr-only">{{sr}}</span> | ||
</button> |
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,40 @@ | ||
--- | ||
title: Close button | ||
width: narrow | ||
no-blank: true | ||
directory: close-button | ||
intro: A close button is a graphical element used to dismiss or close windows, dialogs, or other UI elements. | ||
meta-description: A close button is a graphical element used to dismiss or close windows, dialogs, or other UI elements. | ||
meta-index: true | ||
--- | ||
|
||
<p>A close button is a <code><button></code> element with the class <code>.nsw-icon-button</code>. We use the 'close' material icon as the X icon. This icon is wrapped in a <code><span></code> with the attribute <code>aria-hidden="true"</code>, so screen readers don't read the X icon.</p> | ||
|
||
<p>The button also includes a <code><span></code> with the <code>.sr-only</code> class to tell screen readers what the button's purpose is.</p> | ||
|
||
{{#>_docs-example separated=true}} | ||
{{>_close-button code="close" sr="Close"}} | ||
{{/_docs-example}} | ||
|
||
<h3>Sizing</h3> | ||
<p>The NSW Design System displays icons at four sizes (20px, 24px, 30px, 36px) depending on their type, use and screen size:</p> | ||
|
||
{{#>_docs-example separated=true}} | ||
<div class="nsw-list nsw-list--8"> | ||
{{>_close-button code="close" sr="Close" size="20"}} | ||
{{>_close-button code="close" sr="Close" size="24"}} | ||
{{>_close-button code="close" sr="Close" size="30"}} | ||
{{>_close-button code="close" sr="Close" size="36"}} | ||
</div> | ||
{{/_docs-example}} | ||
|
||
<h3>Accessibility</h3> | ||
<p>All components are responsive and meet WCAG 2.1 AA accessibility guidelines.</p> | ||
|
||
<p>Do:</p> | ||
<ul> | ||
<li>Wrap icons within their interactive component</li> | ||
<li>Specify if an icon is decorative and informative by assigning the appropriate property.</li> | ||
<li>Use descriptive and meaningful titles for informative icons</li> | ||
</ul> | ||
|
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