Skip to content

Commit

Permalink
Ensure not-really-private functions work with @use
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Feb 20, 2025
1 parent 2d7a639 commit 49f12b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/elements/_page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ body {
font-size: $nhsuk-base-font-size;
-moz-osx-font-smoothing: grayscale; // [2]
-webkit-font-smoothing: antialiased; // [2]
line-height: _nhsuk-line-height($nhsuk-base-line-height, $nhsuk-base-font-size);
line-height: nhsuk-line-height($nhsuk-base-line-height, $nhsuk-base-font-size);
margin: 0; // [3]
min-height: 100%; // [4]
}
4 changes: 2 additions & 2 deletions packages/core/tools/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
/// @param {Number} $font-size Font size
/// @return {Number} The line height as either a relative value or unmodified

@function _nhsuk-line-height($line-height, $font-size) {
@function nhsuk-line-height($line-height, $font-size) {
@if not math.is-unitless($line-height) and math.unit($line-height) == math.unit($font-size) {
// Explicitly rounding to 5 decimal places to match the node-sass/libsass default precision.
// This is expanded to 10 in dart-sass and results in significant line height differences
Expand Down Expand Up @@ -118,7 +118,7 @@
$font-size: map.get($breakpoint-map, "font-size");
$font-size-rem: nhsuk-px-to-rem($font-size);

$line-height: _nhsuk-line-height(
$line-height: nhsuk-line-height(
$line-height: if($override-line-height, $override-line-height, map.get($breakpoint-map, "line-height")),
$font-size: $font-size
);
Expand Down

0 comments on commit 49f12b0

Please sign in to comment.