You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 1, 2024. It is now read-only.
@@ -175,15 +176,16 @@ For the modal itself, you need a few more things.
175
176
</div>
176
177
```
177
178
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.
182
182
183
183
#### Accessibility
184
184
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
+
185
187
-`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 modaldialog 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`.
187
189
188
190
[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.
0 commit comments