-
Notifications
You must be signed in to change notification settings - Fork 231
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
Remove unnecessary uses of govuk-font #3516
Conversation
✅ You can preview this change here:
To edit notification comments on pull requests, go to your Netlify site configuration. |
b6ff759
to
879c0d8
Compare
@include govuk-font($size: 24); | ||
@include govuk-responsive-padding(6); | ||
|
||
display: block; | ||
margin: 0; | ||
|
||
color: govuk-colour("white"); | ||
background-color: govuk-colour("blue"); | ||
|
||
text-align: center; |
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.
Confirming that these styles were duplicated in grid-annotate.scss
👍
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.
Always good to see 🙌
Added a few comments, maybe that 1 kilobyte could be more?
879c0d8
to
00ff587
Compare
3c8b1cf
to
c2408ea
Compare
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.
Looks good to me, approving with one comment
The code text looks a bit "thick" now we've lost these two:
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
Shall we add it to the pre, code
block here?
govuk-design-system/src/stylesheets/main.scss
Lines 117 to 120 in 5a5db22
pre, | |
code { | |
font-family: ui-monospace, Menlo, "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", monospace; | |
} |
In case you’re unaware, here are plugins for 2 popular Markdown parsers that do this post-processing:
|
c2408ea
to
592522b
Compare
@colinrotherham Resolved! I forgot you could pass a custom |
592522b
to
538c78b
Compare
538c78b
to
ff0c3a2
Compare
What/Why
Removes uses of
govuk-font
which are unnecessary, typically because typographic elements such as the font family are cascading from elsewhere and only a font size change may be necessary.Similar to alphagov/govuk-frontend#4267
Notes
Impact on CSS output is fairly minimal. Running
build
against this branch vsmain
shows that this branch's CSS is1 kilobyte2 kilobyets lighter. I would still argue this is a useful change on the basis that it's ensuring we don't duplicate CSS unnecessarily.Several removes of
govuk-font
are because that element'stypography-common
is being defined byapp-prose
and cascading down. In some cases this is convenient but not intentional eg:app-tabs__item
only needinggovuk-typography-responsive
becauseapp-prose
is applying typography to lists, whichapp-tabs
are semantically but not necessarily typographically. There have been unofficial chats about replacingapp-prose
with marked post-processing to apply govuk classes to typographic elements in content. If this happens then we would want to putgovuk-font
back on these elements.