Skip to content

Commit

Permalink
Remove duplicate font declarations for point 14
Browse files Browse the repository at this point in the history
We can remove the underscore in `_14` → `14` so the deprecated font declaration map continue to work without duplication
  • Loading branch information
colinrotherham committed Feb 2, 2024
1 parent a6cca27 commit 410d74c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
5 changes: 5 additions & 0 deletions packages/govuk-frontend/src/govuk/helpers/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@
// deprecated sizes used internally, for example `govuk-font($size: "_14")`
$size-internal-use-only: str-slice(#{$size}, 1, 1) == "_";

// Remove underscore from font sizes flagged for internal use
@if $size-internal-use-only {
$size: str-slice(#{$size}, 2);
}

// Check for a font map exactly matching the given size
$font-map: map-get($govuk-typography-scale, $size);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,19 +157,5 @@ $govuk-typography-scale: (
message: "14 on the type scale is deprecated and will be removed as " +
"a possible option in the next major version."
)
),
_14: (
null: (
font-size: 12px,
line-height: 15px
),
tablet: (
font-size: 14px,
line-height: 20px
),
print: (
font-size: 12pt,
line-height: 1.2
)
)
) !default;

0 comments on commit 410d74c

Please sign in to comment.