Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit 8c42a7e

Browse files
author
george
committed
Merge branch 'develop'
2 parents 9945c88 + 619f7a1 commit 8c42a7e

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

.browserslistrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
last 1 major version
22
>= 1%
3+
not dead
4+
not op_mini all
35
edge >= 15
46
firefox >= 52
57
chrome >= 49

site/docs/modals.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ Adding the `is-centered` class onto the modal overlay will vertically center the
107107
</h2>
108108
<a data-close href="#">
109109
<span aria-hidden="true">&times;</span>
110+
<span class"is-visually-hidden">close modal</span>
110111
</a>
111112
</header>
112113
<section>
@@ -128,8 +129,8 @@ Adding the `is-centered` class onto the modal overlay will vertically center the
128129
```
129130

130131
```html
131-
<div class="modal-overlay is-centered" data-modal-id="new-modal-2">
132-
<div class="modal-dialog" data-parent="new-modal-2" aria-labelledby="header-id-2" data-modal>
132+
<div class="modal-overlay is-centered" data-modal="new-modal-2">
133+
<div class="modal-dialog" data-parent="new-modal-2" aria-labelledby="header-id-2">
133134
...
134135
</div>
135136
</div>
@@ -156,8 +157,8 @@ For the modal button, it should have two main properties:
156157
For the modal itself, you need a few more things.
157158

158159
```html
159-
<div class="modal-overlay" data-modal-id="new-modal">
160-
<div class="modal-dialog" data-parent="new-modal" aria-labelledby="header-id" data-modal>
160+
<div class="modal-overlay" data-modal="new-modal">
161+
<div class="modal-dialog" data-parent="new-modal" aria-labelledby="header-id">
161162
<header>
162163
<h2 class="h6" id="header-id">...</h2>
163164
<a data-close href="#">
@@ -175,15 +176,16 @@ For the modal itself, you need a few more things.
175176
</div>
176177
```
177178

178-
- `data-modal-id`: an attribute matching your corresponding button's `data-target`. Add it to the modal overlay element.
179-
- `data-modal`: an attribute indicating the element is a modal dialog. It should be the immediate child of the modal overlay.
180-
- `data-parent`: an attribute pointing to the modal wrapper. It should equal the value of the element with `data-modal-id`.
181-
- `data-close`: an attribute indicating a button or link will close the modal dialog.
179+
- `data-modal`: an attribute matching your corresponding button's `data-modal-button` value. Add it to the modal overlay element. overlay.
180+
- `data-parent`: an attribute pointing to the modal wrapper. It should equal the value of the element with `data-modal`.
181+
- `data-close`: an attribute indicating a button or link will close the current modal dialog.
182182

183183
#### Accessibility
184184

185+
The below attributes you should add to elements yourself. They increase the content's accessibility for users with assistive technologies, such as screen readers.
186+
185187
- `aria-hidden`: an attribute that should be attached to any icons (close or otherwise) in the modal. Screen readers are inconsistent with icons, so they should be hidden instead. When using an icon, make sure you have `is-visually-hidden` text describing the action.
186-
- `aria-labelledby`: an attribute to be attached to the modal dialog element. It should have a matching value to the header element's `id`.
188+
- `aria-labelledby`: an attribute to be attached to the `modal-dialog` element. It should have a matching value to the header element's `id`.
187189

188190
[See WAI-ARIA documentation](https://www.w3.org/TR/wai-aria-practices-1.1/examples/dialog-modal/dialog.html) on best-practices for the dialog modal UI pattern.
189191

0 commit comments

Comments
 (0)