Skip to content

Commit

Permalink
Deprecate compatibility mode settings
Browse files Browse the repository at this point in the history
This includes adding a private setting: `$_govuk-is-legacy-review-app` which is set to `true` in the legacy app stylesheets within the govuk-frontend local review app. We create this temporary dependancy so that warnings aren't fired locally but are fired for users where compatibility mode settings are true in their own sass.
  • Loading branch information
owenatgov committed Oct 14, 2022
1 parent b082be7 commit 2520a13
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ This was added in [pull request #2677: Amend error summary markup to fix page lo

### Deprecated features

#### Stop using the compatibility mode settings

In GOV.UK Frontend v5.0 we will stop supporting compatibility with legacy codebases. We are therefore deprecating the compatibility mode variables associated with legacy codebases:

- `$govuk-compatibility-govukfrontendtoolkit`
- `$govuk-compatibility-govuktemplate`
- `$govuk-compatibility-govukelements`

This was introduced in [pull request #2882: Deprecate compatibility mode settings](https://github.com/alphagov/govuk-frontend/pull/2882).

#### Stop using settings associated with legacy codebases

In GOV.UK Frontend v5.0 we will stop supporting compatibility with legacy codebases. As part of this, we are deprecating settings controlled by compatibility mode variables. This includes the `govuk-compatibility` mixin and the following settings:
Expand All @@ -95,7 +105,7 @@ In GOV.UK Frontend v5.0 we will stop supporting compatibility with legacy codeba
- `$govuk-typography-use-rem`
- `$govuk-font-family-tabular`

This was introduced in [pull request #2844: Deprecate compatibility mode settings](https://github.com/alphagov/govuk-frontend/pull/2844).
This was introduced in [pull request #2844: Remove compatibility mode from govuk-frontend](https://github.com/alphagov/govuk-frontend/pull/2844).

### Fixes

Expand Down
5 changes: 5 additions & 0 deletions app/assets/scss/app-legacy-ie8.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ $govuk-compatibility-govukfrontendtoolkit: true;
$govuk-compatibility-govuktemplate: true;
$govuk-compatibility-govukelements: true;

// Suppress compatibility mode deprecation warnings locally
$govuk-suppressed-warnings: (
"compatibility-mode"
);

// Set Elements assets path
$path: "/vendor/govuk_frontend_toolkit/assets/";

Expand Down
5 changes: 5 additions & 0 deletions app/assets/scss/app-legacy.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ $govuk-compatibility-govukfrontendtoolkit: true;
$govuk-compatibility-govuktemplate: true;
$govuk-compatibility-govukelements: true;

// Suppress compatibility mode deprecation warnings locally
$govuk-suppressed-warnings: (
"compatibility-mode"
);

// Set Elements assets path
$path: "/vendor/govuk_frontend_toolkit/assets/";

Expand Down
26 changes: 26 additions & 0 deletions src/govuk/settings/_compatibility.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,17 @@
///
/// @type Boolean
/// @access public
/// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
/// suite of tools and settings

$govuk-compatibility-govukfrontendtoolkit: false !default;

@if $govuk-compatibility-govukfrontendtoolkit == true {
@include _warning("compatibility-mode", "$govuk-compatibility-govukfrontendtoolkit " +
"is deprecated. From version 5.0, GOV.UK Frontend will not support compatibility " +
"with the legacy codebase govuk_frontend_toolkit");
}

/// Compatibility Mode: alphagov/govuk_template
///
/// Enabling this will:
Expand All @@ -41,9 +49,17 @@ $govuk-compatibility-govukfrontendtoolkit: false !default;
///
/// @type Boolean
/// @access public
/// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
/// suite of tools and settings

$govuk-compatibility-govuktemplate: false !default;

@if $govuk-compatibility-govuktemplate == true {
@include _warning("compatibility-mode", "$govuk-compatibility-govuktemplate " +
"is deprecated. From version 5.0, GOV.UK Frontend will not support " +
"compatibility with the legacy codebase govuk_template");
}

/// Compatibility Mode: alphagov/govuk_elements
///
/// Enabling this will:
Expand All @@ -56,16 +72,26 @@ $govuk-compatibility-govuktemplate: false !default;
///
/// @type Boolean
/// @access public
/// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
/// suite of tools and settings

$govuk-compatibility-govukelements: false !default;

@if $govuk-compatibility-govukelements == true {
@include _warning("compatibility-mode", "$govuk-compatibility-govukelements " +
"is deprecated. From version 5.0, GOV.UK Frontend will not support compatibility " +
"with the legacy codebase govuk_elements");
}

/// Compatibility Product Map
///
/// Maps product names to their settings that we can use to lookup states from
/// within the `@govuk-compatibility` mixin.
///
/// @type Map
/// @access private
/// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
/// suite of tools and settings

$_govuk-compatibility: (
govuk_frontend_toolkit: $govuk-compatibility-govukfrontendtoolkit,
Expand Down

0 comments on commit 2520a13

Please sign in to comment.