-
Notifications
You must be signed in to change notification settings - Fork 6
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 fonts + spacing in Live Blog Posts #646
base: main
Are you sure you want to change the base?
Conversation
* For legacy reasons, Origami output typography and spacing in px by default. They provide these flags to over ride this and out put rems. * When `true`, the user will be able to modify their font size using browser settings on FT.com * Reference: https://github.com/Financial-Times/origami/blob/813c8e46d9e6e423fad3a1322d043edc6422cd69/components/o-typography/src/scss/_variables.scss#L5-L12
Hmmm I've also just noticed that on the new front-page we're actively removing this base font-size: https://github.com/Financial-Times/next-home-page/blob/586c10fd5fddd2546f586ee8153cca189959c2a0/apps/home-page/client/main.scss#L26-L28 Doing the same on the article page would give us the behaviour I expected and a computed font-size of 27px if a user changes their browser font setting to 'very large'. |
I'm curious why the root font size is 0.8125em too? We should probably explicitly set Some Origami components have alignment issues when:
See o-message screenshot: |
Update - FT.com hive mind (or just Dawn) clarified that this Soooooo, as Content Innovation / Story Telling are also the code owners of |
I see, thanks for the context @CLTPayne! I'd say let's poke this bear because In the long term ft.com should work toward respecting user text size preference with relative units but since we use absolute values in most places that's not happening, so swapping |
I think that changing the root font size is likely going to need to be a bit of a project on its own so we are prepared to react to any issues that might arise from that. The storytelling team are in no position to deal with this at the moment (just lost 2 engineers). I think we should probably prioritise short term solutions so Charlotte can move forward with whats important to her team which will still be moving this component in the right direction and allow FT.com to move in its own time. The options I would suggest are
The latter is probably more work and would result in some duplicate styles (very minimal though) but it would help prevent a future forced upgrade when new features are wanted in live blogs and we can't do it until we which to relative (or backwards port any changes). |
Not sure if this has been raised anywhere but if FT.com moves towards better supporting relative font sizes we would probably want to support grid changes at the same time (I don't think we do this yet???) |
Switch from
px
torems
in Live Blog Posts (tentative as per below)Context:
px
units but has these handy flags to outputrem
units - https://github.com/Financial-Times/origami/blob/813c8e46d9e6e423fad3a1322d043edc6422cd69/components/o-typography/src/scss/_variables.scss#L5-L12.px
(so we can't override the default with the origami flags). We can override the individual element styles to all berem
but there is quite a lot of them so this feels very brittle and verbose. Thus I'm suggesting we the change as per this PR. (Note there is work in progress to change this consumption of bundled CSS but it is a few weeks away minimum).In this PR:
Override oSpacing and oTypography in the live blog post to output rem units. This PR is raised as a discussion to get better understanding of the FT.com side... and the 0.8125em base font-size.
Testing this change in the App:
With default font size selected in the app
With extra large font size selected:
Testing this change on FT.com / next-article:
This is potentially an issue because I'm reducing the 'medium' font-size... I'm not sure though as it seems odd to me (but I know nothing about ft.com and haven't managed to find a documented reason) that we set the base font-size to be 0.8125em - https://github.com/Financial-Times/n-ui-foundations/blob/8261b9c7565bd49e5988da3f7b99db64c859cc88/typography/main.scss#L19 (via
dotcom-ui-basestyles
component https://github.com/Financial-Times/dotcom-page-kit/blob/main/packages/dotcom-ui-base-styles/styles.scss#L10).With default / 'medium' font size selected in Chrome browser settings:
With 'very large' font size selected in Chrome browser settings: