-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix($theme-default): Make navbar dropdown links accessible #1837
Changes from 16 commits
311f11f
44462b6
3593b4b
e996d18
510be5b
380911d
fd30a60
8bd733f
1b38f36
a5a66f1
0a27789
96b1287
c67010e
e84b6c6
6da2e5f
842157d
371af79
0ef66cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ module.exports = [ | |
}, | ||
{ | ||
text: "Learn More", | ||
ariaLabel: "Learn More", | ||
items: [ | ||
{ | ||
text: "API", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ module.exports = [ | |
}, | ||
{ | ||
text: "了解更多", | ||
ariaLabel: "了解更多", | ||
items: [ | ||
{ | ||
text: "API", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ module.exports = { | |
nav: [ | ||
{ text: 'Home', link: '/' }, | ||
{ text: 'Guide', link: '/guide/' }, | ||
{ text: 'External', link: 'https://google.com' }, | ||
{ text: 'External', link: 'https://google.com' } | ||
] | ||
} | ||
} | ||
|
@@ -72,6 +72,25 @@ module.exports = { | |
} | ||
``` | ||
|
||
You can change `aria-label` of dropdown button to with a custom aria-label. Default value is text property. if the dropdown menu consists of language items., default value is 'Select language' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need an entire section for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okey, i wil add that in existing examples :) |
||
|
||
```js | ||
module.exports = { | ||
themeConfig: { | ||
nav: [ | ||
{ | ||
text: 'Languages', | ||
ariaLabel: 'Language Menu' | ||
items: [ | ||
{ text: 'Chinese', link: '/language/chinese/' }, | ||
{ text: 'Japanese', link: '/language/japanese/' } | ||
] | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
|
||
You can also have sub groups inside a dropdown by having nested items: | ||
|
||
```js | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is kind of hard to read/understand, I'll try to find something easier for this part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I too will try to find to a more easy solution.