-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
13 changed files
with
955 additions
and
18 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,51 @@ | ||
--- | ||
layout: post | ||
title: "[A11y] aria-hidden='true'μ aria-role='none'" | ||
date: 2024-03-17 00:00:00 | ||
author: Hyunbin Lee | ||
categories: A11y | ||
tags: Accessibility A11y | ||
cover: "/assets/instacode.png" | ||
--- | ||
|
||
# aria-hidden='true'μ aria-role='none' | ||
|
||
## 1. aria-hidden='true' | ||
|
||
aria-hidden μμ±μ μμλ₯Ό [μ κ·Όμ± νΈλ¦¬](https://developer.mozilla.org/ko/docs/Glossary/Accessibility_tree)μμ μ κ±°ν μ§ μ¬λΆλ₯Ό κ²°μ ν©λλ€. `aria-hidden='true'`λ‘ μ€μ νλ©΄ ν΄λΉ μμκ° μ κ·Όμ± νΈλ¦¬μ λ ΈμΆλμ§ μμ λΏλ§ μλλΌ μμ μμλ€λ λͺ¨λ μν₯ λ°μ μ¬λΌμ§κ² λ©λλ€. μ΄λ κ² μ κ·Όμ± νΈλ¦¬μμ μ¬λΌμ§λ©΄ μ€ν¬λ¦° 리λ λ± μ κ·Όμ±μ μ§μνλ 보쑰 κΈ°μ μ λμμ λ°μ μ μμ΅λλ€. | ||
|
||
aria-hidden μμ±μ μκ°μ μΈ λ λμλ μ§μ μ μΈ μ°κ΄μ΄ μμ΅λλ€. **λ€λ§ μ μμ μΌλ‘ λ λλ§λ μμλ₯Ό 무ν±λκ³ aria-hidden='true'λ‘ μ€μ νλ κ²μ μ§μν΄μΌ ν©λλ€.** μλνλ©΄ μκ°μ μΌλ‘ νμ ν μ μλ μ 보λ₯Ό μ€ν¬λ¦° 리λμ λμμ λ°μ μ μκ² λμ΄ λ³΄μ‘° κΈ°μ μ¬μ©μμ μ¬μ©μ±μ μ νμν¬ μ μκΈ° λλ¬Έμ λλ€. λ°λΌμ λΆνμνλ€κ³ νλ¨λκ±°λ μ€λ³΅λλ μ 보μ νν΄μ μ€μ ν΄μΌ ν©λλ€. | ||
|
||
<br /> | ||
|
||
## 2. aria-role='none' | ||
|
||
aria-role μμ±μ μμμ μν μ λͺ μνμ¬ μ½ν μΈ μ μλ―Έ(semantic meaning)λ₯Ό λΆμ¬ν©λλ€. μ΄λ κ² μλ―Έκ° λΆμ¬λ μμλ μ€ν¬λ¦° 리λ λ± λ³΄μ‘° κΈ°μ μ¬μ©μκ° ν΄λΉ μμμ μλ―Έλ₯Ό νμ νκ³ μνΈμμ©ν μ μκ² λμμ€λλ€. | ||
|
||
[λ€μν role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles#aria_role_types)μ΄ μ‘΄μ¬νμ§λ§ μ΄ μ€μμ `aria-role='none'`(aria-role='presentation'κ³Ό λμΌ)μ **μμμ μλ μλ§¨ν± μλ―Έλ₯Ό μ κ±°νλ λ°μ μ¬μ©ν©λλ€.** μΌλ°μ μΌλ‘ <header>, <footer>, <article>κ³Ό κ°μ μλ§¨ν± νκ·Έμλ ν¨κ» μ¬μ©νμ§ μμ΅λλ€. μλνλ©΄ μ΄λ¬ν κ²½μ°μλ λΉμλ§¨ν± νκ·ΈμΈ <div>λ₯Ό λμ μ¬μ©νλ κ²μ΄ λ μ μ νκΈ° λλ¬Έμ λλ€. λ€μ λ κ°μ§ μν©μμ aria-role='none'μ μ μ©νκ² νμ©ν μ μμ΅λλ€. | ||
|
||
#### 2-1. λ κ±°μ λ§ν¬μ μ μμ ν λ | ||
|
||
CSS λ μ΄μμ κ΄λ ¨ μμ±λ€μ΄ λ°μ νκΈ° μ΄μ μλ νμ΄μ§ λ μ΄μμμ ꡬμ±νλ λͺ©μ μΌλ‘ <table> νκ·Έλ₯Ό λ§ν¬μ μ λ§μ΄ μ¬μ©νμ΅λλ€. λ§μΌ μ΄λ¬ν μ¬μ΄νΈλ₯Ό μ μ§λ³΄μν΄μΌ νλ κ²½μ° aria-role='none'μ λΆμ¬νμ¬ μ€μ©λ <table>μ μλ§¨ν± μλ―Έλ₯Ό μ κ±°ν μ μμ΅λλ€. | ||
|
||
#### 2-2. λ§ν¬μ ꡬ쑰μμ μλ§¨ν± μλ―Έλ₯Ό μ κ±°νλ κ²μ΄ λμμ΄ λ κ²½μ° | ||
|
||
μ€νλ € aria-role='none'μΌλ‘ μλ§¨ν± μλ―Έλ₯Ό μ κ±°νλ κ²μ΄ μ κ·Όμ±μ λμμ΄ λλ κ²½μ°κ° μμ΅λλ€. μλλ role='tablist' λ§ν¬μ μμμ λλ€. | ||
<script src="https://gist.github.com/iyu88/05caa5e430a638fe465d75d9613b5c21.js?file=01_tablist_example.html"></script> | ||
tablistλ μμ μμλ‘ λ°λ‘ role='tab'μ ν΄λΉνλ μμκ° μ€λ κ²μ΄ μ μ ν©λλ€. μ΄λ¬ν κ²½μ° <li> μμλ μλ§¨ν± μλ―Έλ₯Ό κ°μ§ νμκ° μκΈ° λλ¬Έμ role='none'μΌλ‘ μ κ±°ν©λλ€. | ||
|
||
<br /> | ||
|
||
## 3. λ μμ±μ 곡ν΅μ | ||
|
||
μ λ μμ±μ **μνΈμμ© κ°λ₯ν μμμ μ€μ νλ κ²μ μ§μν΄μΌ νλ€λ 곡ν΅μ **μ κ°μ§κ³ μμ΅λλ€. μ΄λ μ κ·Όμ± λ³΄μ‘° κΈ°μ μ΄ νμ ν μ μλ μμ(aria-hidden='true')λ μλμ μΌλ‘ μλ§¨ν± μλ―Έκ° μ κ±°λ μμ(aria-role='none')μ ν€λ³΄λ focus νΉμ λ§μ°μ€ ν¬μΈν° focusκ° κ°λ₯ν κ²½μ°, κ°κ° μΉ μ κ·Όμ±μ λ¨μ΄νΈλ¦¬κ³ [role κ΄λ ¨ νμ€ μ€ν](https://www.w3.org/TR/wai-aria-1.2/#conflict_resolution_presentation_none)μ μ€μνμ§ λͺ»νλ λ¬Έμ κ° μκΈ° λλ¬Έμ λλ€. | ||
|
||
<br /> | ||
|
||
[μ°Έκ³ ] | ||
|
||
- [MDN - μ κ·Όμ± νΈλ¦¬](https://developer.mozilla.org/ko/docs/Glossary/Accessibility_tree) | ||
- [MDN - aria-hidden](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden) | ||
- [MDN - WAI-ARIA Roles](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles) | ||
- [MDN - ARIA: presentation role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/presentation_role) | ||
- [Know your ARIA: 'Hidden' vs 'None'](https://www.scottohara.me/blog/2018/05/05/hidden-vs-none.html) |
Oops, something went wrong.