-
Notifications
You must be signed in to change notification settings - Fork 18
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
issue/145 Automated aria levels #146
Merged
Merged
Conversation
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
oliverfoster
changed the title
issue/145 Aautomated aria levels
issue/145 Automated aria levels
Jun 21, 2022
This was referenced Jun 21, 2022
Co-authored-by: Cahir O'Doherty <41006337+cahirodoherty-learningpool@users.noreply.github.com>
cahirodoherty-learningpool
approved these changes
Jun 22, 2022
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.
👀
joe-replin
approved these changes
Jun 23, 2022
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.
Implemented into my current build and this is brilliant. Thank you.
eleanor-heath
approved these changes
Jul 1, 2022
This was referenced Oct 30, 2023
This was referenced Oct 30, 2023
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #145
This is backward compatible, using the current defaults will produce the same outcome. Narrative and accordion will need to be updated to pass an id through for automated calculations.
Current defaults
These are static unless overridden by
_ariaLevel
on the content.Possible defaults
These aria levels are calculated dynamically, based upon the existence of a title on the defined parent and the offset through the tree, unless overridden in the tree by
_ariaLevel
.Examples:
If a component has no article or block title, its aria level will be calculated relative to the page heading level
1
, this is as the block and article offsets are not applied.If a block has an
_ariaLevel
override, the components will increment from the block override._ariaLevel
can be specified on any of the content models to override its heading level, this will then be used as the value for the heading level calculations for all descendants.Changed
a11y.ariaLevel
from flat arguments to object arguments, with backward compatibility for flat arguments, addedid
requirement to facilitate aria level calculations in the hierarchyAdded
a11y.ariaLevel
calculates the aria level if given an id and a relative descriptor@block+1
a11y_aria_level
handlebars helperDeprecated
a11y_attrs_heading
in favour ofa11y_aria_level
as it's clearer for the handlebars