-
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
Refactor heading logic in radio component #2051
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
danacotoran
changed the title
Retire is_page_heading parameter (part 1)
Retire is_page_heading parameter (step 1)
May 7, 2021
danacotoran
force-pushed
the
retire_is_page_heading_param_1
branch
from
May 7, 2021 11:02
34c0963
to
5c2d7a9
Compare
danacotoran
force-pushed
the
retire_is_page_heading_param_1
branch
from
May 7, 2021 14:39
5c2d7a9
to
a72ab5e
Compare
alex-ju
reviewed
May 7, 2021
app/assets/stylesheets/govuk_publishing_components/components/_radio.scss
Outdated
Show resolved
Hide resolved
This was referenced May 7, 2021
alex-ju
reviewed
May 7, 2021
alex-ju
approved these changes
May 7, 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! One suggestion for the changelog and I'm not sure we earn much by removing the vowels in heading_lvl
, but since this is not exposed in the component API, I'll let you decide on a final name.
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
force-pushed
the
retire_is_page_heading_param_1
branch
from
May 7, 2021 16:46
e00ca31
to
71167d5
Compare
danacotoran
changed the title
Retire is_page_heading parameter (step 1)
Refactor heading logic in radio component
May 7, 2021
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.
What
This is step 1 towards removing the
is_page_heading
parameter from the radio component.Why
Due to a need for more flexibility, 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 flag that dictates that the heading should be ah1
of sizexl
.This used to solve a problem when the component did not use to support
heading_level
, however now that we can useheading_level
andheading_size
to achieve the same result, theis_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
withheading_level: 1
andheading_size: 'xl'
Related issue: #1953
Visual Changes
None