Skip to content
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

feat: use typography tokens in o-topper and o-teaser #1938

Open
wants to merge 15 commits into
base: 2025-release
Choose a base branch
from

Conversation

frshwtr
Copy link
Contributor

@frshwtr frshwtr commented Jan 20, 2025

Describe your changes

Uses typography tokens within the o-topper component

Issue ticket number and link

Link to Figma designs

Checklist before requesting a review

  • I have applied percy label for o-[COMPONENT] or chromatic label for o3-[COMPONENT] on my PR before merging and after review. Find more details in CONTRIBUTING.md
  • If it is a new feature, I have added thorough tests.
  • I have updated relevant docs.
  • I have updated relevant env variables in Doppler.

@frshwtr
Copy link
Contributor Author

frshwtr commented Jan 20, 2025

Todo: cross check topper components

@frshwtr
Copy link
Contributor Author

frshwtr commented Jan 20, 2025

Todo: there are some other private typography uses e.g oPrivateTypographyLink and one for UL too, make sure to change these.

@frshwtr frshwtr changed the title feat: use typography tokens in o-topper feat: use typography tokens in o-topper and o-teaser Jan 21, 2025
@frshwtr frshwtr force-pushed the 2025-release-use-typography-tokens-in-topper branch from 7dbc994 to 4f39f1d Compare January 21, 2025 11:55
@frshwtr frshwtr marked this pull request as ready for review January 21, 2025 15:29
@frshwtr frshwtr requested a review from a team as a code owner January 21, 2025 15:29
@frshwtr
Copy link
Contributor Author

frshwtr commented Jan 21, 2025

Increased font/line height is making the background of this text container larger
This branch
image
Main
image

@frshwtr frshwtr force-pushed the 2025-release-use-typography-tokens-in-topper branch from facabe1 to d9c80c1 Compare January 21, 2025 16:08
Copy link
Contributor

@notlee notlee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots here! I'm not convinced it's all related to this PR though...

Comment on lines 40 to 43
font-family: oPrivateFoundationGet('o3-typography-use-case-display-sm-font-family');
font-size: oPrivateFoundationGet('o3-typography-use-case-display-sm-font-size');
font-weight: 400;
line-height: oPrivateFoundationGet('o3-typography-use-case-display-sm-line-height');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2025-01-21 at 16 23 21

This isn't using the usecase properly as it's a custom font weight (400 is also too high compared with Metric is seems). I think headline-md fits better here (please double check)?

Suggested change
font-family: oPrivateFoundationGet('o3-typography-use-case-display-sm-font-family');
font-size: oPrivateFoundationGet('o3-typography-use-case-display-sm-font-size');
font-weight: 400;
line-height: oPrivateFoundationGet('o3-typography-use-case-display-sm-line-height');
font-family: oPrivateFoundationGet('o3-typography-use-case-headline-md-font-family');
font-size: oPrivateFoundationGet('o3-typography-use-case-headline-md-font-size');
font-weight: oPrivateFoundationGet('o3-typography-use-case-headline-md-line-height');
line-height: oPrivateFoundationGet('o3-typography-use-case-headline-md-line-height');

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -103,7 +118,10 @@
}

@mixin _oTopperTags {
@include oPrivateTypographySans(0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've lost the colour of the topic tags somehow? An issue with this PR or..?

Screenshot 2025-01-21 at 16 23 21
Screenshot 2025-01-21 at 16 23 56

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be related to the private foundation colour changes we did a few sprints ago. Will take a look.

Comment on lines 56 to 58
color: oPrivateFoundationGet('o3-color-palette-white');
position: absolute;
text-shadow: 1px 1px 1px oPrivateFoundationGet('o3-color-palette-slate');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comparing the latest release on npm (demo via the build service). The image credit no longer appears white with a shadow, it's along with the caption instead. I don't see an obvious change in this PR to explain it. What happened here?

Screenshot 2025-01-21 at 16 40 06

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me they display identical, though I see other issues. Can we catch up some point this week to see why it looks differently for both of us?
image

components/o-topper/src/scss/_elements.scss Outdated Show resolved Hide resolved
components/o-topper/src/scss/themes/_branded.scss Outdated Show resolved Hide resolved
@@ -8,7 +8,10 @@
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_oTopperColumnistName? 😱
Screenshot 2025-01-21 at 16 52 19

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe most of the colour issues are unrelated to the typography changes. I am happy to fix on this PR or move to a ticket. Either way it will need fixing this sprint!

Comment on lines +9 to +17
font-family: oPrivateFoundationGet('o3-typography-use-case-display-sm-font-family');
font-size: oPrivateFoundationGet('o3-typography-use-case-display-sm-font-size');
font-weight: oPrivateFoundationGet('o3-typography-use-case-display-sm-font-weight');
line-height: oPrivateFoundationGet('o3-typography-use-case-display-sm-line-height');
@include oPrivateGridRespondTo('L') {
@include oPrivateTypographyDisplay(7);
font-family: oPrivateFoundationGet('o3-typography-use-case-display-lg-font-family');
font-size: oPrivateFoundationGet('o3-typography-use-case-display-lg-font-size');
font-weight: oPrivateFoundationGet('o3-typography-use-case-display-lg-font-weight');
line-height: oPrivateFoundationGet('o3-typography-use-case-display-lg-line-height');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you've missed some oPrivateTypographyDisplay calls in o-teaser. Looks like the following screenshot is a little too bold, maybe title would be better? Think it's coming from o-teaser__heading in _oTeaserLarge.
Screenshot 2025-01-21 at 17 00 46

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A similar example here in demo core-large-opinion. But also, why does the copy colour now match the background? 😱
Screenshot 2025-01-21 at 17 12 12

@@ -4,7 +4,6 @@

@import 'src/scss/variables';
@import 'src/scss/mixins';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_oTeaserTimestamp is tiny! Let's remove its use of oLabelsTimestampContent and set to label
Screenshot 2025-01-21 at 17 10 25

@notlee notlee temporarily deployed to origami-webs-2025-relea-xdkicd January 22, 2025 09:49 Inactive
@notlee notlee temporarily deployed to origami-webs-2025-relea-xdkicd January 22, 2025 09:52 Inactive
@notlee notlee temporarily deployed to origami-webs-2025-relea-xdkicd January 22, 2025 13:27 Inactive
Comment on lines 160 to 171
@include oEditorialTypographyHeading($level: 1);
font-family: oPrivateFoundationGet('o3-typography-use-case-headline-md-font-family');
font-size: oPrivateFoundationGet('o3-typography-use-case-headline-md-font-size');
font-weight: oPrivateFoundationGet('o3-typography-use-case-headline-md-font-weight');
line-height: oPrivateFoundationGet('o3-typography-use-case-headline-md-line-height');
margin-bottom: oPrivateSpacingByIncrement(5);
}

.o-topper__headline--large {
@include oEditorialTypographyHeadline();
font-family: oPrivateFoundationGet('o3-typography-use-case-headline-lg-font-family');
font-size: oPrivateFoundationGet('o3-typography-use-case-headline-lg-font-size');
font-weight: oPrivateFoundationGet('o3-typography-use-case-headline-lg-font-weight');
line-height: oPrivateFoundationGet('o3-typography-use-case-headline-lg-line-height');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oEditorialTypographyHeading(1) / oEditorialTypographyHeadline were responsive before right? This should recreate that using tokens. o-topper__headline should match the headline o3-editorial-typography component and o-topper__headline--large should match the display component, both change the type usecase size responsively.

Copy link
Contributor

@notlee notlee Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like

		font-family: oPrivateFoundationGet('o3-typography-use-case-headline-sm-font-family');
		font-size: oPrivateFoundationGet('o3-typography-use-case-headline-sm-font-size');
		font-weight: oPrivateFoundationGet('o3-typography-use-case-headline-sm-font-weight');
		line-height: oPrivateFoundationGet('o3-typography-use-case-headline-sm-line-height');

		@include oPrivateGridRespondTo('S') {
			font-family: oPrivateFoundationGet('o3-typography-use-case-headline-md-font-family');
			font-size: oPrivateFoundationGet('o3-typography-use-case-headline-md-font-size');
			font-weight: oPrivateFoundationGet('o3-typography-use-case-headline-md-font-weight');
			line-height: oPrivateFoundationGet('o3-typography-use-case-headline-md-line-height');
		}

		@include oPrivateGridRespondTo('L') {
			font-family: oPrivateFoundationGet('o3-typography-use-case-headline-lg-font-family');
			font-size: oPrivateFoundationGet('o3-typography-use-case-headline-lg-font-size');
			font-weight: oPrivateFoundationGet('o3-typography-use-case-headline-lg-font-weight');
			line-height: oPrivateFoundationGet('o3-typography-use-case-headline-lg-line-height');
		}

@notlee notlee temporarily deployed to origami-webs-2025-relea-xdkicd January 22, 2025 15:42 Inactive
@notlee notlee temporarily deployed to origami-webs-2025-relea-xdkicd January 22, 2025 15:57 Inactive
@notlee notlee temporarily deployed to origami-webs-2025-relea-xdkicd January 23, 2025 11:23 Inactive
@notlee notlee temporarily deployed to origami-webs-2025-relea-xdkicd January 23, 2025 14:17 Inactive
@notlee notlee temporarily deployed to origami-webs-2025-relea-xdkicd January 23, 2025 15:04 Inactive
@notlee notlee temporarily deployed to origami-webs-2025-relea-xdkicd January 23, 2025 16:48 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants