Skip to content

Commit

Permalink
Remove $govuk-use-legacy-font and $govuk-font-family-tabular settings
Browse files Browse the repository at this point in the history
  • Loading branch information
querkmachine authored and colinrotherham committed May 4, 2023
1 parent e157c7b commit 5ab273d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 91 deletions.
16 changes: 5 additions & 11 deletions src/govuk/helpers/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,11 @@

@mixin govuk-font($size, $weight: regular, $tabular: false, $line-height: false) {
@if $tabular {
// if govuk-font-family-tabular is set use $govuk-font-family-tabular
@if $govuk-font-family-tabular {
@include govuk-typography-common($font-family: $govuk-font-family-tabular);
} @else {
@include govuk-typography-common;
font-feature-settings: "tnum" 1;

@supports (font-variant-numeric: tabular-nums) {
font-feature-settings: normal;
font-variant-numeric: tabular-nums;
}
@include govuk-typography-common;
font-feature-settings: "tnum" 1;
@supports (font-variant-numeric: tabular-nums) {
font-feature-settings: normal;
font-variant-numeric: tabular-nums;
}
} @else {
@include govuk-typography-common;
Expand Down
21 changes: 0 additions & 21 deletions src/govuk/settings/_typography-font-families.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,3 @@
/// @access public

$govuk-font-family-gds-transport: "GDS Transport", arial, sans-serif;

/// List of font families to use if using NTA (old font 'stack' for
/// GOV.UK)
///
/// @type List
/// @access public
/// @deprecated To be removed once support for compatibility mode is dropped

$govuk-font-family-nta: "nta", arial, sans-serif;

/// List of font families to use if using the 'tabular numbers' subset of NTA
/// (the default font 'stack' for GOV.UK)
///
/// Because ntatabularnumbers only includes the digits 0-10, all other glyphs
/// will 'fall-through' the stack to NTA.
///
/// @type List
/// @access public
/// @deprecated To be removed once support for compatibility mode is dropped

$govuk-font-family-nta-tabular: "ntatabularnumbers", $govuk-font-family-nta;
60 changes: 1 addition & 59 deletions src/govuk/settings/_typography-font.scss
Original file line number Diff line number Diff line change
@@ -1,42 +1,9 @@
@import "compatibility";
@import "typography-font-families";

////
/// @group settings/typography
////

/// Use 'legacy' fonts
///
/// Whether or not to use v1 nta font from GOV.UK Elements / Frontend
/// Toolkit, for teams that are migrating to GOV.UK Frontend and may be using
/// components from both places in a single application.
///
/// @type Boolean
/// @access public
/// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
/// suite of tools and settings

$govuk-use-legacy-font: if(
(
$govuk-compatibility-govukfrontendtoolkit or
$govuk-compatibility-govuktemplate or
$govuk-compatibility-govukelements
),
true,
false
) !default;

// Only show the deprecation warning if user is setting $govuk-use-legacy-font
// manually instead of automatically via compatibility variables
@if $govuk-use-legacy-font == true and
$govuk-compatibility-govukfrontendtoolkit == false and
$govuk-compatibility-govuktemplate == false and
$govuk-compatibility-govukelements == false {
@include _warning(legacy-font, "$govuk-use-legacy-font is deprecated. " +
"From version 5.0, GOV.UK Frontend will only support the included version " +
"of GDS Transport.");
}

// =========================================================
// Font families
// =========================================================
Expand All @@ -46,32 +13,7 @@ $govuk-use-legacy-font: if(
/// @type List
/// @access public

$govuk-font-family: if(
$govuk-use-legacy-font,
$govuk-font-family-nta,
$govuk-font-family-gds-transport
) !default;

/// Font families to use when displaying tabular numbers
///
/// @type List
/// @access public
/// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
/// suite of tools and settings

$govuk-font-family-tabular: if(
$govuk-use-legacy-font,
$govuk-font-family-nta-tabular,
false
) !default;

// Only show the deprecation warning if user is setting $govuk-font-family-tabular
// manually instead of automatically via $govuk-use-legacy-font
@if $govuk-font-family-tabular != false and $govuk-use-legacy-font == false {
@include _warning(tabular-font-face, "$govuk-font-family-tabular is deprecated. " +
"From version 5.0, GOV.UK Frontend will not support using a separate " +
"font-face for tabular numbers.");
}
$govuk-font-family: $govuk-font-family-gds-transport !default;

/// Font families to use for print media
///
Expand Down

0 comments on commit 5ab273d

Please sign in to comment.