-
Notifications
You must be signed in to change notification settings - Fork 325
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
Allow govuk-font
mixin to bypass responsive typography
#2456
Comments
You can currently pass .app-my-class {
@include govuk-font($size: false);
} .app-my-class {
font-family: "GDS Transport", arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-weight: 400; }
@media print {
.app-my-class {
font-family: sans-serif; } } Possible improvements to this might include:
|
I'm going to close this as it's going to be superseded by work being done as part of alphagov/govuk-design-system#2289 |
Proposal
Add an option to the
govuk-font
sass mixin to allow for bypassing of the design system responsive typography.The desired outcome would be a way to use
govuk-font
in such a way that it includes all the desired helpers like anti-aliasing and print styles but doesn't produce additional media queries where the font size goes down at lower screen sizes. How this might look:The above element would have a font size of
16px
and theem
equivalent at all screen sizes.Context
On govuk, we've recently been doing some work to set a new design tone for govuk that provides a better experience on smaller devices. We'll be able to see this soon in the launch of the new homepage design. Something we've run into however is that there are instances where we want to maintain font size across screen sizes in order to both create a consistent experience for users and to adhere to good designs across screen sizes.
In order to meet our needs, we've had to bypass
govuk-font
and manually enter font values and associated extra attributes.Examples of govuk components where we've done this:
Pull requests that illustrate the problem:
We're conscious that there are mixins like
govuk-typography-common
that help with this approach, however the ideal would be to usegovuk-font
as it reduces risk of maintenance chain reactions in our code ifgovuk-font
or any of it's settings ever change and means our code is cleaner.There is also an accessibility concern as
govuk-font
encourages font size going below16px
on mobile if you want a small font size on desktop.This issue is tangentially related #2418 but feels separate enough to this ask not to combine then, in my opinion.
The text was updated successfully, but these errors were encountered: