-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add custom heading level option to radio component #1951
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
andysellick
approved these changes
Mar 2, 2021
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.
Looks good, +1 for using the shared helper. I've approved but noted a few minor things.
app/views/govuk_publishing_components/components/_radio.html.erb
Outdated
Show resolved
Hide resolved
app/views/govuk_publishing_components/components/docs/radio.yml
Outdated
Show resolved
Hide resolved
Currently if the radio component is passed a heading, and the heading is not a "Page heading", then that heading is always a h2. This is not always appropriate; there are instances where more flexibility is necessary in order to maintain a correct hierarchical heading structure. This introduces the shared helper's heading level function to the radio component. This way we can ensure the default remains h2, while also having the ability to pass a custom heading level where necessary.
danacotoran
force-pushed
the
custom-heading-lvl-for-radio
branch
from
March 2, 2021 14:50
1d95d90
to
8e90d32
Compare
Merged
This was referenced Mar 11, 2021
Closed
Closed
Closed
Closed
Closed
This was referenced Mar 17, 2021
Closed
Closed
Closed
Closed
Closed
danacotoran
added a commit
that referenced
this pull request
May 6, 2021
This is step 1 towards removing the is_page_heading parameter from the radio component. The reason behind this is that the ability to pass a custom heading level was introduced to the radio component some time back #1951 The is_page_heading parameter is a specialised parameter that dictates that the heading should be a h1 of size xl. This used to solve a problem when the component did not use to support heading_level, however now that we can use heading_level and heading_size to achieve the same result, the is_page_heading parameter becomes redundant. The reason we have to do this in steps is that the component is referenced with the is_page_heading parameter in several applications. Due to the way the logic in this component is structured, it would be a breaking change if we simply went ahead with replacing is_page_heading: true with heading_level: 1 and heading_size: 'xl'
danacotoran
added a commit
that referenced
this pull request
May 7, 2021
This is step 1 towards removing the is_page_heading parameter from the radio component. The reason behind this is that the ability to pass a custom heading level was introduced to the radio component some time back #1951 The is_page_heading parameter is a specialised parameter that dictates that the heading should be a h1 of size xl. This used to solve a problem when the component did not use to support heading_level, however now that we can use heading_level and heading_size to achieve the same result, the is_page_heading parameter becomes redundant. The reason we have to do this in steps is that the component is referenced with the is_page_heading parameter in several applications. Due to the way the logic in this component is structured, it would be a breaking change if we simply went ahead with replacing is_page_heading: true with heading_level: 1 and heading_size: 'xl'
danacotoran
added a commit
that referenced
this pull request
May 7, 2021
This is step 1 towards removing the is_page_heading parameter from the radio component. The reason behind this is that the ability to pass a custom heading level was introduced to the radio component some time back #1951 The is_page_heading parameter is a specialised parameter that dictates that the heading should be a h1 of size xl. This used to solve a problem when the component did not use to support heading_level, however now that we can use heading_level and heading_size to achieve the same result, the is_page_heading parameter becomes redundant. The reason we have to do this in steps is that the component is referenced with the is_page_heading parameter in several applications. Due to the way the logic in this component is structured, it would be a breaking change if we simply went ahead with replacing is_page_heading: true with heading_level: 1 and heading_size: 'xl'
danacotoran
added a commit
that referenced
this pull request
May 7, 2021
This is step 1 towards removing the is_page_heading parameter from the radio component. The reason behind this is that the ability to pass a custom heading level was introduced to the radio component some time back #1951 The is_page_heading parameter is a specialised parameter that dictates that the heading should be a h1 of size xl. This used to solve a problem when the component did not use to support heading_level, however now that we can use heading_level and heading_size to achieve the same result, the is_page_heading parameter becomes redundant. The reason we have to do this in steps is that the component is referenced with the is_page_heading parameter in several applications. Due to the way the logic in this component is structured, it would be a breaking change if we simply went ahead with replacing is_page_heading: true with heading_level: 1 and heading_size: 'xl'
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.
If the radio component is passed a heading, and the heading is not a "Page heading", then that heading is always a
h2
.This is not always appropriate; there are instances where more flexibility is necessary in order to maintain a correct hierarchical heading structure.
For example, on the Account information consent page:
This introduces the shared helper's heading level function to the radio component. This way we can ensure the default
remains
h2
, while also having the ability to pass a custom heading level where necessary.Relevant card: https://trello.com/c/lNkwruEi/647-fix-accessibility-issues-raised-by-dac