Skip to content

Commit

Permalink
Clarify purpose of .govuk-frontend-supported snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Dec 8, 2023
1 parent 21be7b3 commit af6fb2c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/importing-css-assets-and-javascript/index.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ You can also use your own function to generate paths, for example if you're usin

You'll need to add the following to the top of the `<body class="govuk-template__body">` section of your page template if you're not [using our Nunjucks macros](/use-nunjucks/).

This snippet adds the `.govuk-frontend-supported` class in supported browsers:

```html
<script>document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' govuk-frontend-supported' : '');</script>
```
Expand Down

0 comments on commit af6fb2c

Please sign in to comment.