Skip to content

Commit

Permalink
PR Change: use .govuk-frontend-supported instead of .js-enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
AshGDS committed Jul 26, 2024
1 parent 63d9aac commit f53a936
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}
}

.js-enabled {
.govuk-frontend-supported {
.gem-c-contextual-guidance__wrapper {
display: none;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
padding-left: 33px;
}

.js-enabled {
.govuk-frontend-supported {
.gem-c-option-select__heading {
position: relative;
padding: 10px 8px 5px 43px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $gem-c-print-link-background-height: 18px;
display: block;
}

.js-enabled {
.govuk-frontend-supported {
.gem-c-print-link {
display: block;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
@include govuk-link-style-no-visited-state;
display: none;

.js-enabled & {
.govuk-frontend-supported & {
display: inline-block;
}
}
Expand Down Expand Up @@ -105,7 +105,7 @@
}

&.js-hidden {
.js-enabled & {
.govuk-frontend-supported & {
display: none;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
}
}

.js-enabled {
.govuk-frontend-supported {
.gem-c-reorderable-list__item {
@include govuk-media-query($from: desktop) {
cursor: move;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $large-input-size: 50px;
margin: 0;
}

.js-enabled & {
.govuk-frontend-supported & {
position: absolute;
left: 2px;
top: 2px;
Expand All @@ -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;
}
}
Expand Down Expand Up @@ -189,7 +189,7 @@ $large-input-size: 50px;
}
}

.js-enabled & {
.govuk-frontend-supported & {
.gem-c-search__label {
color: $govuk-secondary-text-colour;
}
Expand Down Expand Up @@ -245,7 +245,7 @@ $large-input-size: 50px;
}
}

.js-enabled & {
.govuk-frontend-supported & {
.gem-c-search__label {
color: $govuk-secondary-text-colour;
}
Expand Down Expand Up @@ -312,7 +312,7 @@ $large-input-size: 50px;
}

@include govuk-media-query($until: tablet) {
.js-enabled & {
.govuk-frontend-supported & {
display: block;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ $top-border: solid 1px govuk-colour("mid-grey");
}
}

.js-enabled &.js-hidden {
.govuk-frontend-supported &.js-hidden {
display: none;
}
}
Expand Down Expand Up @@ -385,7 +385,7 @@ $top-border: solid 1px govuk-colour("mid-grey");
padding-top: govuk-spacing(2);
}

.js-enabled & {
.govuk-frontend-supported & {
padding: 0;
}

Expand Down Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
</head>
<%= 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", {
Expand Down
2 changes: 1 addition & 1 deletion spec/javascripts/components/contextual-guidance-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Contextual guidance component', function () {
'</div>' +
'</div>'

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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
'<nav aria-labelledby="super-navigation-menu-heading" class="gem-c-layout-super-navigation-header__content js-module-initialised" data-module="super-navigation-mega-menu" data-super-navigation-mega-menu-module-started="true">' +
'<h2 id="super-navigation-menu-heading" class="govuk-visually-hidden">' +
Expand Down
2 changes: 1 addition & 1 deletion spec/javascripts/components/reorderable-list-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Reorderable list component', function () {
'</li>' +
'</ol>'

document.body.classList.add('js-enabled')
document.body.classList.add('govuk-frontend-supported')
document.body.appendChild(container)
element = document.querySelector('[data-module="reorderable-list"]')
})
Expand Down

0 comments on commit f53a936

Please sign in to comment.