-
Notifications
You must be signed in to change notification settings - Fork 327
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
Conversation
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.
looks good. looking forward to the changelog entry :) 📓 |
Nice work using the snapshots while developing! |
Changelog entries added!
It worked really well – trying to think of a way we can turn it into a gulp task e.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
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.
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.
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