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 Sep 28, 2023
1 parent d734ef5 commit ed6a62a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/stylesheets/components/_back-to-top.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
margin-bottom: govuk-spacing(8);
}

.js-enabled .app-back-to-top--fixed {
.govuk-frontend-supported .app-back-to-top--fixed {
position: fixed;
top: calc(100% - #{govuk-spacing(8)});
bottom: auto;
left: auto;
}

.js-enabled .app-back-to-top--hidden .app-back-to-top__link {
.govuk-frontend-supported .app-back-to-top--hidden .app-back-to-top__link {
@include govuk-visually-hidden-focusable;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/stylesheets/components/_navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@
list-style: none;
}

.js-enabled .app-navigation__subnav--active {
.govuk-frontend-supported .app-navigation__subnav--active {
display: block;
}

.app-navigation__subnav,
.js-enabled .app-navigation__subnav--active {
.govuk-frontend-supported .app-navigation__subnav--active {
@include govuk-media-query($from: tablet) {
display: none;
}
Expand Down
6 changes: 3 additions & 3 deletions src/stylesheets/components/_site-search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $icon-size: 40px;
margin-bottom: govuk-spacing(2);
float: left;

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

Expand All @@ -37,7 +37,7 @@ $icon-size: 40px;
float: right;
text-align: right;

.js-enabled & {
.govuk-frontend-supported & {
text-align: left;
}
}
Expand Down Expand Up @@ -205,7 +205,7 @@ $icon-size: 40px;
@include govuk-media-query($from: tablet) {
display: inline-block;

.js-enabled & {
.govuk-frontend-supported & {
display: none;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ pre code {
outline: $govuk-focus-width solid $govuk-focus-colour;
}

.js-enabled [data-module="app-copy"] & {
.govuk-frontend-supported [data-module="app-copy"] & {
padding-top: 45px; // Allow extra space for the copy code button
}
}
Expand Down

0 comments on commit ed6a62a

Please sign in to comment.