-
Notifications
You must be signed in to change notification settings - Fork 332
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
Replace global js-hidden
class with tabs panel modifier
#916
Conversation
Reviewers can you confirm that this is not a breaking change please. |
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.
Great solution. Happy that this is not a breaking change. Minor suggested tweaks to changelog, but otherwise this is good to go I think.
CHANGELOG.md
Outdated
Description goes here (optional) | ||
|
||
([PR #N](https://github.com/alphagov/govuk-frontend/pull/N)) | ||
- Replace global `js-hidden` class with tabs panel modifier |
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.
Just to be super clear, what about something like:
Replace conflicting
js-hidden
class used within the tabs component with a new modifier class. Because this class is defined and used within the JavaScript, no markup changes are required.
Thoughts?
`js-hidden` is a global class that is defined by GOV.UK Template (https://github.com/alphagov/govuk_template/blob/78cbc105b564d2f4a83bb257abb98322bb851a93/source/assets/stylesheets/_accessibility.scss#L17) This could mean that if users include GOV.UK Frontend into their project it could break the JavaScript fallback in their project, since the tabs' implementation of `js-hidden` does not check for the presense of the `js-enabled` class. To avoid this problem we avoid a global class name and instead create a modifier for the panel component which is being hidden.
cdf6fa3
to
896471c
Compare
896471c
to
c74b1ad
Compare
js-hidden
is a global class that is defined by GOV.UK Template (https://github.com/alphagov/govuk_template/blob/78cbc105b564d2f4a83bb257abb98322bb851a93/source/assets/stylesheets/_accessibility.scss#L17)This could mean that if users include GOV.UK Frontend into their project it could break the JavaScript fallback
in their project, since the tabs' implementation of
js-hidden
does not check for the presense of thejs-enabled
class.To avoid this problem we avoid a global class name and instead create a modifier for the panel component which is being hidden.
Thankfully, since this class is only added at runtime by JavaScript, doing this is not a breaking change.