-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically calculate font-sizes in rem by adding a new setting $govuk-root-font-size, which should match the font-size on the html (root) element.
- Loading branch information
Showing
4 changed files
with
50 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//// | ||
/// @group tools | ||
//// | ||
|
||
/// Convert pixels to rem | ||
/// | ||
/// The $govuk-root-font-size must match the font-size on your root (html) | ||
/// element | ||
/// | ||
/// @param {Number} $value - Length in pixels | ||
/// @return {Number} Length in rems | ||
/// @access public | ||
|
||
@function govuk-px-to-rem($value) { | ||
@if (unitless($value)) { | ||
$value: $value * 1px; | ||
} | ||
|
||
@return $value / $govuk-root-font-size * 1rem; | ||
} |