Skip to content

Commit 53acdb2

Browse files
committed
Add aria-current
1 parent 4a47e6c commit 53acdb2

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,29 @@ Remove the semantics from an element
548548
<h2 role="presentation">Large text, but not a heading</h2>
549549
```
550550

551+
## Current page
552+
553+
Don't highlight the current page in a table of contents by only changing the class but use `aria-current`.
554+
555+
```html
556+
<ol>
557+
<li><a href="">Some page</a></li>
558+
<li aria-current="page">Some other page</li>
559+
</ol>
560+
```
561+
562+
Then style the current page entry in the table as contents as follows
563+
564+
```css
565+
[aria-current="page"] {
566+
font-weight: bold;
567+
}
568+
```
569+
570+
`aria-current` can have the following values: `page`, `step`, `location`, `date`, `time`, `true` and `false`.
571+
See [MDN: aria-current](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current)
572+
for a detailed explanation.
573+
551574
## Toggle buttons
552575

553576
Make it clear when buttons are toggled on or off.

0 commit comments

Comments
 (0)