diff --git a/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss b/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss index 1d7e52384d..5d5d42521a 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss @@ -17,7 +17,7 @@ display: block !important; // stylelint-disable-line declaration-no-important } - .js-enabled .govuk-accordion__section-content[hidden] { + .govuk-frontend-supported .govuk-accordion__section-content[hidden] { @supports (content-visibility: hidden) { content-visibility: auto; } diff --git a/app/assets/stylesheets/govuk_publishing_components/components/_contextual-guidance.scss b/app/assets/stylesheets/govuk_publishing_components/components/_contextual-guidance.scss index ec1f2d8bfb..377bcf2af9 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_contextual-guidance.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_contextual-guidance.scss @@ -26,7 +26,7 @@ } } -.js-enabled { +.govuk-frontend-supported { .gem-c-contextual-guidance__wrapper { display: none; diff --git a/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss b/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss index 38578bd1cf..aa3e057c64 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss @@ -13,7 +13,7 @@ background-color: #263135; } -.js-enabled .gem-c-layout-for-public__global-banner-wrapper { +.govuk-frontend-supported .gem-c-layout-for-public__global-banner-wrapper { margin-top: - govuk-spacing(2); min-height: govuk-spacing(2); position: relative; diff --git a/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss b/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss index 8401568c24..830c225691 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss @@ -87,10 +87,10 @@ display: none; } -.js-enabled .gem-c-metadata__toggle-wrap { +.govuk-frontend-supported .gem-c-metadata__toggle-wrap { display: block; } -.js-enabled .gem-c-metadata__toggle-items.js-hidden { +.govuk-frontend-supported .gem-c-metadata__toggle-items.js-hidden { display: none; } diff --git a/app/assets/stylesheets/govuk_publishing_components/components/_option-select.scss b/app/assets/stylesheets/govuk_publishing_components/components/_option-select.scss index 4f48e71571..5aadb92904 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_option-select.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_option-select.scss @@ -123,7 +123,7 @@ padding-left: 33px; } -.js-enabled { +.govuk-frontend-supported { .gem-c-option-select__heading { position: relative; padding: 10px 8px 5px 43px; diff --git a/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss b/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss index 71caa98350..b1146dc001 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss @@ -11,7 +11,7 @@ $gem-c-print-link-background-height: 18px; display: block; } -.js-enabled { +.govuk-frontend-supported { .gem-c-print-link { display: block; } diff --git a/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss b/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss index de155fce71..a54eef29fd 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss @@ -63,7 +63,7 @@ @include govuk-link-style-no-visited-state; display: none; - .js-enabled & { + .govuk-frontend-supported & { display: inline-block; } } @@ -105,7 +105,7 @@ } &.js-hidden { - .js-enabled & { + .govuk-frontend-supported & { display: none; } } diff --git a/app/assets/stylesheets/govuk_publishing_components/components/_reorderable-list.scss b/app/assets/stylesheets/govuk_publishing_components/components/_reorderable-list.scss index 28432fd8f7..6cd6afce51 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_reorderable-list.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_reorderable-list.scss @@ -74,7 +74,7 @@ } } -.js-enabled { +.govuk-frontend-supported { .gem-c-reorderable-list__item { @include govuk-media-query($from: desktop) { cursor: move; diff --git a/app/assets/stylesheets/govuk_publishing_components/components/_search.scss b/app/assets/stylesheets/govuk_publishing_components/components/_search.scss index 845f2a3b79..b759f0148b 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_search.scss @@ -37,7 +37,7 @@ $large-input-size: 50px; margin: 0; } - .js-enabled & { + .govuk-frontend-supported & { position: absolute; left: 2px; top: 2px; @@ -50,7 +50,7 @@ $large-input-size: 50px; // match label colour with the label component colour // when javascript is enabled and inline_label option is set to false - .js-enabled .gem-c-search--separate-label & { + .govuk-frontend-supported .gem-c-search--separate-label & { color: $govuk-text-colour; } } @@ -189,7 +189,7 @@ $large-input-size: 50px; } } - .js-enabled & { + .govuk-frontend-supported & { .gem-c-search__label { color: $govuk-secondary-text-colour; } @@ -245,7 +245,7 @@ $large-input-size: 50px; } } - .js-enabled & { + .govuk-frontend-supported & { .gem-c-search__label { color: $govuk-secondary-text-colour; } @@ -312,7 +312,7 @@ $large-input-size: 50px; } @include govuk-media-query($until: tablet) { - .js-enabled & { + .govuk-frontend-supported & { display: block; } } diff --git a/app/assets/stylesheets/govuk_publishing_components/components/_single-page-notification-button.scss b/app/assets/stylesheets/govuk_publishing_components/components/_single-page-notification-button.scss index dba53282d7..686f7ca7c2 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_single-page-notification-button.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_single-page-notification-button.scss @@ -31,7 +31,7 @@ margin-right: govuk-spacing(1); } -.js-enabled .gem-c-single-page-notification-button.js-personalisation-enhancement { +.govuk-frontend-supported .gem-c-single-page-notification-button.js-personalisation-enhancement { opacity: 0; &.gem-c-single-page-notification-button--visible { diff --git a/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss b/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss index f3ffefd2d1..55a9cd5570 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss @@ -56,7 +56,7 @@ $top-border: solid 1px govuk-colour("mid-grey"); } } - .js-enabled &.js-hidden { + .govuk-frontend-supported &.js-hidden { display: none; } } @@ -385,7 +385,7 @@ $top-border: solid 1px govuk-colour("mid-grey"); padding-top: govuk-spacing(2); } - .js-enabled & { + .govuk-frontend-supported & { padding: 0; } @@ -425,7 +425,7 @@ $top-border: solid 1px govuk-colour("mid-grey"); @include step-nav-font(16, $tablet-size: 19); } - .js-enabled &.js-hidden { + .govuk-frontend-supported &.js-hidden { display: none; } } diff --git a/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss b/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss index 2285fb4370..c466a5fa17 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss @@ -63,7 +63,7 @@ border: 1px solid $gem-quiet-button-colour; background-color: $gem-secondary-button-background-colour; - .js-enabled & { + .govuk-frontend-supported & { display: inline-block; } @@ -98,13 +98,13 @@ margin-bottom: govuk-spacing(3); background: govuk-colour("light-grey"); - .js-enabled &.js-hidden { + .govuk-frontend-supported &.js-hidden { display: none; } } .gem-c-subscription-links__feed-hidden-description { - .js-enabled & { + .govuk-frontend-supported & { @include govuk-visually-hidden; } } diff --git a/app/assets/stylesheets/govuk_publishing_components/components/_tabs.scss b/app/assets/stylesheets/govuk_publishing_components/components/_tabs.scss index 8e2bc4f0a4..91bbb71fc6 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_tabs.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_tabs.scss @@ -1,7 +1,7 @@ @import "govuk_publishing_components/individual_component_support"; @import "govuk/components/tabs/tabs"; -.js-enabled { +.govuk-frontend-supported { .gem-c-tabs__panel--no-border { padding-right: 0; padding-left: 0; @@ -24,7 +24,7 @@ li.govuk-tabs__list-item { // stylelint-disable-line selector-no-qualifying-type margin-left: govuk-spacing(5); } -.js-enabled { // stylelint-disable-line no-duplicate-selectors +.govuk-frontend-supported { // stylelint-disable-line no-duplicate-selectors @include govuk-media-query($from: tablet) { ul.govuk-tabs__list { // stylelint-disable-line selector-no-qualifying-type margin-bottom: 0; diff --git a/app/views/govuk_publishing_components/components/_layout_for_public.html.erb b/app/views/govuk_publishing_components/components/_layout_for_public.html.erb index a63ecd238b..c508cd76e9 100644 --- a/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +++ b/app/views/govuk_publishing_components/components/_layout_for_public.html.erb @@ -97,7 +97,7 @@ <%= tag.body class: body_css_classes do %> <%= javascript_tag nonce: true do -%> - document.body.className += ('noModule' in HTMLScriptElement.prototype ? ' js-enabled govuk-frontend-supported' : ''); + document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' govuk-frontend-supported' : ''); <% end -%> <%= render "govuk_publishing_components/components/cookie_banner", layout_helper.cookie_banner_data %> <%= render "govuk_publishing_components/components/skip_link", { diff --git a/spec/javascripts/components/contextual-guidance-spec.js b/spec/javascripts/components/contextual-guidance-spec.js index 7fa7882ade..60949da9a8 100644 --- a/spec/javascripts/components/contextual-guidance-spec.js +++ b/spec/javascripts/components/contextual-guidance-spec.js @@ -31,7 +31,7 @@ describe('Contextual guidance component', function () { '' + '' - document.body.classList.add('js-enabled') + document.body.classList.add('govuk-frontend-supported') document.body.appendChild(container) var titleContextualGuidance = document.getElementById('document-title-guidance') var summaryContextualGuidance = document.getElementById('document-summary-guidance') diff --git a/spec/javascripts/components/layout-super-navigation-header-spec.js b/spec/javascripts/components/layout-super-navigation-header-spec.js index 9741daa3b3..d59d5797b7 100644 --- a/spec/javascripts/components/layout-super-navigation-header-spec.js +++ b/spec/javascripts/components/layout-super-navigation-header-spec.js @@ -9,7 +9,7 @@ describe('The super header navigation', function () { beforeEach(function () { container = document.createElement('div') - container.className = 'js-enabled' + container.className = 'govuk-frontend-supported' container.innerHTML = '