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

Remove new link styles feature flag #3600

Merged
merged 2 commits into from
May 11, 2023
Merged
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ In GOV.UK Frontend v3.12.0 we introduced new link styles which:

The new link styles are now enabled by default. If you are setting `$govuk-new-link-styles` to `true` in your Sass you can now remove this.

This change was made in [pull request #3599: Enable new link styles by default](https://github.com/alphagov/govuk-frontend/pull/3599).
This change was made in [pull request #3599: Enable new link styles by default](https://github.com/alphagov/govuk-frontend/pull/3599) and [pull request #3600: Remove new link styles feature flag](https://github.com/alphagov/govuk-frontend/pull/3600).

### Breaking changes

Expand Down
14 changes: 6 additions & 8 deletions packages/govuk-frontend/src/govuk/helpers/_links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@
@mixin govuk-link-decoration {
text-decoration: underline;

@if $govuk-new-link-styles {
@if $govuk-link-underline-thickness {
text-decoration-thickness: $govuk-link-underline-thickness;
}
@if $govuk-link-underline-thickness {
text-decoration-thickness: $govuk-link-underline-thickness;
}

@if $govuk-link-underline-offset {
text-underline-offset: $govuk-link-underline-offset;
}
@if $govuk-link-underline-offset {
text-underline-offset: $govuk-link-underline-offset;
}
}

Expand All @@ -50,7 +48,7 @@
/// @access public

@mixin govuk-link-hover-decoration {
@if $govuk-new-link-styles and $govuk-link-hover-underline-thickness {
@if $govuk-link-hover-underline-thickness {
text-decoration-thickness: $govuk-link-hover-underline-thickness;
// Disable ink skipping on underlines on hover. Browsers haven't
// standardised on this part of the spec yet, so set both properties
Expand Down
51 changes: 0 additions & 51 deletions packages/govuk-frontend/src/govuk/helpers/links.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,38 +31,6 @@ describe('@mixin govuk-link-decoration', () => {
})
})

describe('when $govuk-new-link-styles are disabled', () => {
it('does not set text-decoration-thickness', async () => {
const sass = `
$govuk-new-link-styles: false;
@import "base";

.foo {
@include govuk-link-decoration;
}
`

await expect(compileSassString(sass)).resolves.toMatchObject({
css: expect.not.stringContaining('text-decoration-thickness')
})
})

it('does not set text-underline-offset', async () => {
const sass = `
$govuk-new-link-styles: false;
@import "base";

.foo {
@include govuk-link-decoration;
}
`

await expect(compileSassString(sass)).resolves.toMatchObject({
css: expect.not.stringContaining('text-underline-offset')
})
})
})

describe('when $govuk-link-underline-thickness is falsey', () => {
it('does not set text-decoration-thickness', async () => {
const sass = `
Expand Down Expand Up @@ -113,25 +81,6 @@ describe('@mixin govuk-link-hover-decoration', () => {
})
})

describe('when $govuk-new-link-styles are disabled', () => {
it('does not set a hover state', async () => {
const sass = `
$govuk-new-link-styles: false;
@import "base";

// The mixin shouldn't return anything, so this selector ends up empty and
// is omitted from the CSS
.foo:hover {
@include govuk-link-hover-decoration;
}
`

await expect(compileSassString(sass)).resolves.toMatchObject({
css: expect.not.stringContaining('.foo:hover')
})
})
})

describe('when $govuk-link-hover-underline-thickness is falsey', () => {
it('does not set a hover state', async () => {
const sass = `
Expand Down
13 changes: 0 additions & 13 deletions packages/govuk-frontend/src/govuk/settings/_links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@
/// @group settings/links
////

/// Enable new link styles
///
/// If enabled, the link styles will change. Underlines will:
///
/// - be consistently thinner and a bit further away from the link text
/// - have a clearer hover state, where the underline gets thicker to make the
/// link stand out to users
///
/// @type Boolean
/// @access public

$govuk-new-link-styles: true !default;

/// Thickness of link underlines
///
/// The default will be either:
Expand Down