-
Notifications
You must be signed in to change notification settings - Fork 332
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
Use relative line-height #837
Conversation
f9ddfab
to
e41e82d
Compare
e41e82d
to
1f04aac
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.
good stuff
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.
can you add a changelog entry please
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.
Can we please test this:
- across browsers/devices
- where possible where we have the font text size changed (e.g. samsung browser)
before merging since it's a pretty wide reaching change.
I've tested this on the following and it looks good:
To test, I made the examples in Just need a changelog entry for the PR. |
CHANGELOG.md
Outdated
@@ -20,6 +20,10 @@ | |||
|
|||
([PR #N](https://github.com/alphagov/govuk-frontend/pull/N)) | |||
|
|||
- Use relative line-height |
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.
Since we're not changing the public api, and we're fixing a behaviour I think this might be a 'fix' instead of a 'feature'
bb6bb97
to
bcf25d0
Compare
bcf25d0
to
4a38cc7
Compare
4a38cc7
to
8a35b64
Compare
8a35b64
to
4dcfd1f
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.
This is a great improvement 👏
@@ -26,11 +26,11 @@ $govuk-typography-scale: ( | |||
80: ( | |||
null: ( | |||
font-size: 53px, | |||
line-height: 55px | |||
line-height: 1.0377358491 // 55px |
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.
I do wonder if these would have been clearer if written as:
line-height: 55px / 53px;
Thoughts?
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.
Alternatively, we could have left these as pixel values in the font-map and calculated them in the typography-responsive mixin.
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.
I tried various ways of doing this calculation but kept running into issues...Should probably refactor so it's more "automatic" / less prone to typos. If we haven't released can we carry on?
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.
If we don't expect this to change often, might be worth doing less here?
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.
Yep, happy with this. I've been playing locally with this too – looks like our font-size and line-height are ending up as strings somehow, which means using them in calculations doesn't work. It'd be great to be able to define everything in pixels and everything 'just work', but happy with this for now 👍
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.
I kind of got something interesting when spitting it out as a string if we change the output to font: 16 / 20
and not define line height independently... but this didn't play very nicely with the other PR that needed two font-size declarations.
This needs to be tested on Samsung Internet browser to see if it fixes issue brought up in Accessibility audit.