Skip to content
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

Merged
merged 2 commits into from
Jul 17, 2018

Conversation

NickColley
Copy link
Contributor

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.

Thankfully, since this class is only added at runtime by JavaScript, doing this is not a breaking change.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-916 July 17, 2018 16:01 Inactive
@NickColley
Copy link
Contributor Author

Reviewers can you confirm that this is not a breaking change please.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-916 July 17, 2018 16:02 Inactive
Copy link
Contributor

@36degrees 36degrees left a 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
Copy link
Contributor

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.
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-916 July 17, 2018 16:06 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants