Skip to content

Commit

Permalink
Move component .js-enabled styling to .govuk-frontend-supported
Browse files Browse the repository at this point in the history
This closes the support gap for browsers without ES module support still loading JavaScript-only styles
  • Loading branch information
colinrotherham committed Jun 12, 2023
1 parent b9a4649 commit 73c692f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
margin-bottom: 0;
}

// JavaScript enabled
.js-enabled {
// GOV.UK Frontend JavaScript enabled
.govuk-frontend-supported {
.govuk-accordion {
// Border at the bottom of the whole accordion
border-bottom: $govuk-accordion-bottom-border-width solid $govuk-border-colour;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@

.govuk-checkboxes__input:disabled + .govuk-checkboxes__label,
.govuk-checkboxes__input:disabled ~ .govuk-hint {
opacity: .5;
opacity: 0.5;
}

// =========================================================
Expand Down Expand Up @@ -170,7 +170,7 @@
padding-left: $conditional-padding-left;
border-left: $conditional-border-width solid $govuk-border-colour;

.js-enabled &--hidden {
.govuk-frontend-supported &--hidden {
display: none;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@
top: govuk-spacing(3);
}

.js-enabled & {
.govuk-frontend-supported & {
display: block;
}

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

.govuk-radios__input:disabled + .govuk-radios__label,
.govuk-radios__input:disabled ~ .govuk-hint {
opacity: .5;
opacity: 0.5;
}

// =========================================================
Expand Down Expand Up @@ -186,7 +186,7 @@
padding-left: $conditional-padding-left;
border-left: $conditional-border-width solid $govuk-border-colour;

.js-enabled &--hidden {
.govuk-frontend-supported &--hidden {
display: none;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/govuk-frontend/src/govuk/components/tabs/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
@include govuk-responsive-margin(8, "bottom");
}

// JavaScript enabled
.js-enabled {
// GOV.UK Frontend JavaScript enabled
.govuk-frontend-supported {

@include govuk-media-query($from: tablet) {
.govuk-tabs__list {
Expand Down

0 comments on commit 73c692f

Please sign in to comment.