Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor typography mixin; remove shorthand helpers #772

Merged
merged 11 commits into from
Jun 7, 2018

Conversation

36degrees
Copy link
Contributor

@36degrees 36degrees commented Jun 7, 2018

The shorthand helpers are being removed in favour of a new mixin govuk-font throughout - this decouples the codebase from the typography scale (allowing it to be overridden by consumers in the future), reduces the number of mixins in our public API and gives us greater control over being able to e.g. warn if points in the scale are going to be deprecated.

Rather than passing font maps around, pass the 'key' from the scale instead.

These changes have been made whilst running a Jest test that expects against against a known-good snapshot of both the default and IE8 stylesheets from master, so the output should be exactly the same.

https://trello.com/c/B8OCSU8R/759-agree-on-and-document-public-api-for-govuk-frontend

Rather than passing maps around, we want to move to just passing the ‘desktop size’ e.g. `19`, `80` and doing the lookups against the map from within the helper. This will ultimately allow us to reduce the number of mixins we need to provide as part of our public API.
These are being removed in favour of using `govuk-font` throughout - this decouples the codebase from the typography scale (allowing it to be overridden by consumers in the future), reduces the number of mixins in our public API and gives us greater control over being able to e.g. warn if points in the scale are going to be deprecated.
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-772 June 7, 2018 11:23 Inactive
@kr8n3r
Copy link

kr8n3r commented Jun 7, 2018

looks good. looking forward to the changelog entry :) 📓

@NickColley
Copy link
Contributor

Nice work using the snapshots while developing!

@36degrees
Copy link
Contributor Author

looks good. looking forward to the changelog entry :) 📓

Changelog entries added!

Nice work using the snapshots while developing!

It worked really well – trying to think of a way we can turn it into a gulp task e.g. gulp refactor:start which would create a (non-committed) snapshot and run jest in watch mode. Maybe something for firebreak…

Copy link

@kr8n3r kr8n3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🅰️

@36degrees 36degrees merged commit 2988899 into master Jun 7, 2018
@36degrees 36degrees deleted the refactor-typography-mixin branch June 7, 2018 15:30
@hannalaakso hannalaakso mentioned this pull request Jun 14, 2018
36degrees added a commit that referenced this pull request Jul 5, 2022
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.
36degrees added a commit that referenced this pull request Jul 5, 2022
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.
36degrees added a commit that referenced this pull request Jul 12, 2022
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.
querkmachine pushed a commit that referenced this pull request Oct 17, 2022
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants