Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy unused CSS in layout super navigation component #4228

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Update metatags for GA4 ([PR #4222](https://github.com/alphagov/govuk_publishing_components/pull/4222))
* Set aria-label text in govuk_logo.html to "GOV.UK" ([PR #4217](https://github.com/alphagov/govuk_publishing_components/pull/4217))
* Fix cookie expiration date potentially relying on user's timezone ([PR #4219](https://github.com/alphagov/govuk_publishing_components/pull/4219))
* Tidy unused CSS in layout super navigation component ([PR #4228](https://github.com/alphagov/govuk_publishing_components/pull/4228))

## 43.1.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,17 +379,6 @@ $after-button-padding-left: govuk-spacing(4);
display: none;
}

// Search and popular content dropdown.
.gem-c-layout-super-navigation-header__search-and-popular {
display: none;
padding-bottom: govuk-spacing(4);
padding-top: govuk-spacing(4);

.js-module-initialised & {
display: block;
}
}

// Styles for top level navigation toggle button.
.gem-c-layout-super-navigation-header__navigation-top-toggle-button {
font-size: 16px;
Expand Down Expand Up @@ -514,51 +503,45 @@ $after-button-padding-left: govuk-spacing(4);
}
}

// stylelint-enable max-nesting-depth
}
}

.gem-c-layout-super-navigation-header__navigation-top-toggle-button.gem-c-layout-super-navigation-header__navigation-top-toggle-button--blue-background,
.gem-c-layout-super-navigation-header__navigation-top-toggle-button {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does make sense to remove this to me, but when testing the blue background variation of the component on Safari for iOS it will cause the "Menu" text for the button to appear white instead of blue when clicked, for example:

iOS-menu-example

Likely several ways to solve this, possibly re-ordering the CSS to help set the expected precedence to avoid adding further CSS. This could take a bit of work and likely out of scope for the original intended purpose of code cleanup in the PR.

// Open button modifier
&.gem-c-layout-super-navigation-header__open-button {
// stylelint-disable max-nesting-depth
@include focus-and-focus-visible {
@include govuk-focused-text;
box-shadow: none;
// Open button modifier
&.gem-c-layout-super-navigation-header__open-button {
@include focus-and-focus-visible {
@include govuk-focused-text;
box-shadow: none;

&::after {
background-color: govuk-colour("black");
}
&::after {
background-color: govuk-colour("black");
}

.gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner {
color: govuk-colour("black");
border-color: $govuk-focus-colour;
.gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner {
color: govuk-colour("black");
border-color: $govuk-focus-colour;

@include govuk-media-query($from: 360px) {
&::before {
@include chevron(govuk-colour("black"), true);
@include prefixed-transform($rotate: 225deg, $translateY: 1px);
@include govuk-media-query($from: 360px) {
&::before {
@include chevron(govuk-colour("black"), true);
@include prefixed-transform($rotate: 225deg, $translateY: 1px);
}
}
}
}
}

@include focus-not-focus-visible {
background: govuk-colour("light-grey");
@include focus-not-focus-visible {
background: govuk-colour("light-grey");

&::after {
background-color: $govuk-link-colour;
}
&::after {
background-color: $govuk-link-colour;
}

.gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner {
color: $govuk-link-colour;
border-color: govuk-colour("light-grey");
.gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner {
color: $govuk-link-colour;
border-color: govuk-colour("light-grey");

@include govuk-media-query($from: 360px) {
&::before {
@include chevron($govuk-link-colour);
@include prefixed-transform($rotate: 225deg, $translateY: 1px);
@include govuk-media-query($from: 360px) {
&::before {
@include chevron($govuk-link-colour);
@include prefixed-transform($rotate: 225deg, $translateY: 1px);
}
}
}
}
Expand Down Expand Up @@ -780,16 +763,6 @@ $after-button-padding-left: govuk-spacing(4);
}
}

// Dropdown menu description.
.gem-c-layout-super-navigation-header__menu-description {
display: none;

@include govuk-media-query($from: "desktop") {
display: block;
padding: govuk-spacing(7) 0 govuk-spacing(7) 0;
}
}

// Dropdown menu items.
.gem-c-layout-super-navigation-header__dropdown-list-item {
box-sizing: border-box;
Expand Down Expand Up @@ -890,25 +863,6 @@ $after-button-padding-left: govuk-spacing(4);
}
}

// Popular links.
.gem-c-layout-super-navigation-header__popular-item {
position: relative;
padding: govuk-spacing(1) 0;
}

.gem-c-layout-super-navigation-header__width-container {
@include govuk-media-query($until: "desktop") {
margin: 0;
margin-top: govuk-spacing(6);
}

@include govuk-media-query($from: "desktop") {
margin: 0 auto;
max-width: 960px;
padding: govuk-spacing(5);
}
}

.gem-c-layout-super-navigation-header__column-header {
font-size: 24px;
}
Expand Down
Loading