Skip to content

Commit

Permalink
Merge pull request #2455 from alphagov/remove-base-imports
Browse files Browse the repository at this point in the history
Remove 'base' import from files in `core` and `overrides` layers
  • Loading branch information
Vanita Barrett authored Dec 6, 2021
2 parents c558ad1 + 5050b3f commit 873cc06
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 128 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,19 @@ If you're passing custom HTML into the cookie banner component (for example, usi

This change was introduced in [pull request #2432: Remove default font styles from cookie banner Sass](https://github.com/alphagov/govuk-frontend/pull/2432).

#### Import 'base' before importing Sass files from `core` or `overrides` layers

If you import individual files from the `core` or `overrides` layers, you might see the error `Undefined mixin 'govuk-exports'` or `no mixin named govuk-exports` when compiling your Sass.

To fix the error, import `node_modules/govuk-frontend/govuk/base` first. For example:

```scss
@import "node_modules/govuk-frontend/govuk/base";
@import "node_modules/govuk-frontend/core/typography";
```

This change was introduced in [pull request #2455: Remove 'base' import from files in `core` and `overrides` layers](https://github.com/alphagov/govuk-frontend/pull/2455).

### Optional changes

We've recently made some other changes to GOV.UK Frontend. While these are not breaking changes, implementing them will make your service work better.
Expand Down
6 changes: 0 additions & 6 deletions src/govuk/core/_global-styles.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
@if not mixin-exists("govuk-exports") {
@warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
}

@import "../base";

@import "links";
@import "typography";

Expand Down
6 changes: 0 additions & 6 deletions src/govuk/core/_links.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
@if not mixin-exists("govuk-exports") {
@warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
}

@import "../base";

@include govuk-exports("govuk/core/links") {

%govuk-link {
Expand Down
6 changes: 0 additions & 6 deletions src/govuk/core/_lists.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
@if not mixin-exists("govuk-exports") {
@warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
}

@import "../base";

@include govuk-exports("govuk/core/lists") {

%govuk-list {
Expand Down
6 changes: 0 additions & 6 deletions src/govuk/core/_section-break.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
@if not mixin-exists("govuk-exports") {
@warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
}

@import "../base";

@include govuk-exports("govuk/core/section-break") {

%govuk-section-break {
Expand Down
6 changes: 0 additions & 6 deletions src/govuk/core/_template.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
@if not mixin-exists("govuk-exports") {
@warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
}

@import "../base";

@include govuk-exports("govuk/core/template") {

// Applied to the <html> element
Expand Down
6 changes: 0 additions & 6 deletions src/govuk/core/_typography.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
@if not mixin-exists("govuk-exports") {
@warn "Importing items from the core layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
}

@import "../base";

@include govuk-exports("govuk/core/typography") {

// Headings
Expand Down
31 changes: 0 additions & 31 deletions src/govuk/core/core.test.js

This file was deleted.

6 changes: 0 additions & 6 deletions src/govuk/overrides/_display.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
@if not mixin-exists("govuk-exports") {
@warn "Importing items from the overrides layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
}

@import "../base";

// stylelint-disable declaration-no-important
@include govuk-exports("govuk/overrides/display") {
.govuk-\!-display-inline {
Expand Down
6 changes: 0 additions & 6 deletions src/govuk/overrides/_spacing.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
@if not mixin-exists("govuk-exports") {
@warn "Importing items from the overrides layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
}

@import "../base";

////
/// @group overrides
////
Expand Down
6 changes: 0 additions & 6 deletions src/govuk/overrides/_text-align.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
@if not mixin-exists("govuk-exports") {
@warn "Importing items from the overrides layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
}

@import "../base";

// stylelint-disable declaration-no-important
@include govuk-exports("govuk/overrides/text-align") {
.govuk-\!-text-align-left {
Expand Down
6 changes: 0 additions & 6 deletions src/govuk/overrides/_typography.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
@if not mixin-exists("govuk-exports") {
@warn "Importing items from the overrides layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
}

@import "../base";

@include govuk-exports("govuk/overrides/typography") {
// Font size and line height

Expand Down
6 changes: 0 additions & 6 deletions src/govuk/overrides/_width.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
@if not mixin-exists("govuk-exports") {
@warn "Importing items from the overrides layer without first importing `base` is deprecated, and will no longer work as of GOV.UK Frontend v4.0.";
}

@import "../base";

// stylelint-disable declaration-no-important
@include govuk-exports("govuk/overrides/width") {
.govuk-\!-width-full {
Expand Down
31 changes: 0 additions & 31 deletions src/govuk/overrides/overrides.test.js

This file was deleted.

0 comments on commit 873cc06

Please sign in to comment.