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

Update body classes for govuk frontend v5 #337

Merged
merged 2 commits into from
Jun 28, 2024

Conversation

MartinJJones
Copy link
Contributor

@MartinJJones MartinJJones commented Jun 28, 2024

What

Update the <script> snippet in the test templates.

Why

For govuk-frontend v5, there now needs to be additional class added to the body tag to indicate that the components are supported.

This class is govuk-frontend-supported and is added if the browser supports JS of type module (which is the new browser target for govuk-frontend).

The script tag is directly taken from the documentation, see "Update the <script> snippet at the top of your <body> tag" in the release notes for govuk-frontend 5.0.0

We can safely move to the new snippet in advance of upgrading to V5 of govuk-frontend and ensure components from govuk-frontend still initialise as expect when running integration tests from apps such as smart-answers.

Trello card

@MartinJJones MartinJJones force-pushed the update-body-classes-for-govuk-frontend-v5 branch 2 times, most recently from 7b67872 to 9dcf390 Compare June 28, 2024 10:26
@MartinJJones MartinJJones marked this pull request as ready for review June 28, 2024 10:28
Copy link
Contributor

@unoduetre unoduetre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

Copy link
Contributor

@unoduetre unoduetre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before merging, please, rebase and fix the CHANGELOG.

For govuk-frontend v5, there now needs to be additional class added to the `body` tag to indicate that the components are supported.

This class is `govuk-frontend-supported` and is added if the browser supports JS of type `module` (which is the new browser target for govuk-frontend).

The script tag is directly taken from the documentation.
@MartinJJones MartinJJones force-pushed the update-body-classes-for-govuk-frontend-v5 branch from 9dcf390 to b23086c Compare June 28, 2024 11:11
@MartinJJones MartinJJones merged commit bb1edff into main Jun 28, 2024
15 checks passed
@MartinJJones MartinJJones deleted the update-body-classes-for-govuk-frontend-v5 branch June 28, 2024 11:13
@MartinJJones MartinJJones mentioned this pull request Jul 1, 2024
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