Skip to content

Commit

Permalink
Add docs for aria-current="page"
Browse files Browse the repository at this point in the history
Ref #240 Add styles for ARIA attributes
  • Loading branch information
EvgenyOrekhov committed Feb 23, 2023
1 parent 2d33edf commit 0db65b8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
5 changes: 4 additions & 1 deletion site/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ <h1>
</header>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#" aria-current="page">Home</a></li>
<li><a href="#">Page 1</a></li>
<li><a href="#">Page 2</a></li>
<li><a href="#">Page 3</a></li>
<li>
<span>Menu</span>
<ul>
Expand Down
22 changes: 22 additions & 0 deletions site/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,28 @@ Starting afresh? Use [Quickstart Template]({{ "/template/" | url }}).
</body>
```

### Use `aria-current="page"` to highlight current link

```html
<nav>
<ul>
<li><a href="#">Page 1</a></li>
<li><a href="#" aria-current="page">Page 2</a></li>
<li><a href="#">Page 3</a></li>
</ul>
</nav>
```

Result:

<nav>
<ul>
<li><a href="#">Page 1</a></li>
<li><a href="#" aria-current="page">Page 2</a></li>
<li><a href="#">Page 3</a></li>
</ul>
</nav>

### Use nested `<ul>` inside `<nav>` to create dropdown menus

```html
Expand Down

1 comment on commit 0db65b8

@vercel
Copy link

@vercel vercel bot commented on 0db65b8 Feb 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.