Skip to content

Commit

Permalink
Update docs for typography helpers
Browse files Browse the repository at this point in the history
As part of #772 we updated the `govuk-typography-responsive` mixin to accept a point from the spacing scale rather than a map (1ea1353, 93a0f33).

However the associated SassDocs were not updated at the same time, and still talk about accepting a $font-map param which is incorrect.

Update the SassDocs to reflect the way the mixin works.

Also update the SassDocs for the `govuk-font` mixin to use the same terminology, and correct ‘as it would appear on desktop’ to ‘as it would appear on tablet’ which is the breakpoint where the font-size actually changes.
  • Loading branch information
36degrees committed Jul 5, 2022
1 parent 8456499 commit 5744e0b
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/govuk/helpers/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,13 @@

/// Responsive typography helper
///
/// Takes a 'font map' as an argument and uses it to create font-size and
/// line-height declarations for different breakpoints, and for print.
/// Takes a point from the responsive 'font map' as an argument (the size as it
/// would appear on tablet and above), and uses it to create font-size and
/// line-height declarations for different breakpoints, and print.
///
/// Example font map:
///
/// $my-font-map: (
/// 19: (
/// null: (
/// font-size: 16px,
/// line-height: 20px
Expand All @@ -106,12 +107,15 @@
/// )
/// );
///
/// @param {Map} $font-map - Font map
/// @param {Number} $size - Point from the spacing scale (typically the size as
/// it would appear on tablet and above)
/// @param {Number} $override-line-height [false] - Non responsive custom line
/// height. Omit to use the line height from the font map.
/// @param {Boolean} $important [false] - Whether to mark declarations as
/// `!important`.
///
/// @throw if `$size` is not a valid point from the spacing scale
///
/// @access public

@mixin govuk-typography-responsive($size, $override-line-height: false, $important: false) {
Expand Down Expand Up @@ -167,11 +171,12 @@

/// Font helper
///
/// @param {Number} $size - Size of the font as it would appear on desktop -
/// uses the responsive font size map
/// @param {Number} $size Point from the spacing scale (the size as it would
/// appear on tablet and above)
/// @param {String} $weight [regular] - Weight: `bold` or `regular`
/// @param {Boolean} $tabular [false] - Whether to use tabular numbers or not
/// @param {Number} $line-height [false] - Line-height, if overriding the default
/// @param {Number} $line-height [false] - Line-height, if overriding the
/// default
///
/// @access public

Expand Down

0 comments on commit 5744e0b

Please sign in to comment.