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: add high density typography scale #2646

Merged
merged 21 commits into from
Jan 15, 2024

Conversation

cf-remylenoir
Copy link
Collaborator

@cf-remylenoir cf-remylenoir commented Jan 9, 2024

Purpose of PR

To support high-density in Forma 36 we need to adjust the font-size values for each typography component based on the current density.

Ticket: https://contentful.atlassian.net/browse/CFCX-943

Header Header
Caption Screenshot 2024-01-15 at 17 34 39
Heading Screenshot 2024-01-15 at 17 34 46
Paragraph Screenshot 2024-01-15 at 17 34 52
Section Heading Screenshot 2024-01-15 at 17 35 04
Subheading Screenshot 2024-01-15 at 17 35 12

PR Checklist

  • I have read the relevant readme.md file(s)
  • All commits follow our Git commit message convention
  • Tests are added/updated/not required
  • Tests are passing
  • Storybook stories are added/updated/not required
  • Usage notes are added/updated/not required
  • Has been tested based on Contentful's browser support
  • Doesn't contain any sensitive information

Copy link

changeset-bot bot commented Jan 9, 2024

🦋 Changeset detected

Latest commit: 221d970

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 33 packages
Name Type
@contentful/f36-forms Patch
@contentful/f36-tokens Patch
@contentful/f36-typography Patch
@contentful/f36-accordion Patch
@contentful/f36-asset Patch
@contentful/f36-autocomplete Patch
@contentful/f36-badge Patch
@contentful/f36-button Patch
@contentful/f36-card Patch
@contentful/f36-collapse Patch
@contentful/f36-copybutton Patch
@contentful/f36-core Patch
@contentful/f36-datetime Patch
@contentful/f36-datepicker Patch
@contentful/f36-drag-handle Patch
@contentful/f36-entity-list Patch
@contentful/f36-empty-state Patch
@contentful/f36-icon Patch
@contentful/f36-list Patch
@contentful/f36-menu Patch
@contentful/f36-modal Patch
@contentful/f36-note Patch
@contentful/f36-notification Patch
@contentful/f36-pagination Patch
@contentful/f36-pill Patch
@contentful/f36-popover Patch
@contentful/f36-skeleton Patch
@contentful/f36-spinner Patch
@contentful/f36-table Patch
@contentful/f36-tabs Patch
@contentful/f36-text-link Patch
@contentful/f36-tooltip Patch
@contentful/f36-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cf-remylenoir cf-remylenoir self-assigned this Jan 9, 2024
Copy link

vercel bot commented Jan 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
forma-36 ✅ Ready (Inspect) Visit Preview Jan 12, 2024 1:54pm

@cf-remylenoir

This comment was marked as outdated.

Copy link

github-actions bot commented Jan 9, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
CommonJS 130.03 KB (+0.3% 🔺) 2.7 s (+0.3% 🔺) 72 ms (+50.14% 🔺) 2.7 s
Module 127.01 KB (+0.19% 🔺) 2.6 s (+0.19% 🔺) 72 ms (+54.45% 🔺) 2.7 s

@damann

This comment was marked as outdated.

@cf-remylenoir cf-remylenoir marked this pull request as ready for review January 9, 2024 16:43
@cf-remylenoir cf-remylenoir requested review from Lelith, damann and a team as code owners January 9, 2024 16:43
@cf-remylenoir cf-remylenoir marked this pull request as draft January 10, 2024 09:54
@cf-remylenoir cf-remylenoir changed the title feat(tokens): add font-size-xs feat: add high density typography scale Jan 10, 2024
@cf-remylenoir
Copy link
Collaborator Author

Will add a changeset once #2650 gets merged to get rid of the dependency warning.

@stephanLeece
Copy link
Contributor

General Question: I see that line heights remain unchanged. Could this result in visual inconsistencies when used alongside other elements that include say, Text components, where line height is smaller in high density versions?

package-lock.json Outdated Show resolved Hide resolved
Copy link
Contributor

@stephanLeece stephanLeece left a comment

Choose a reason for hiding this comment

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

All looking good otherwise :)

@damann
Copy link

damann commented Jan 12, 2024

General Question: I see that line heights remain unchanged. Could this result in visual inconsistencies when used alongside other elements that include say, Text components, where line height is smaller in high density versions?

The line heights should change, too. My apologies, I didn't annotate this explicitly.

@cf-remylenoir
Copy link
Collaborator Author

General Question: I see that line heights remain unchanged. Could this result in visual inconsistencies when used alongside other elements that include say, Text components, where line height is smaller in high density versions?

The line heights should change, too. My apologies, I didn't annotate this explicitly.

All good, I will take care of adjusting the line-height too 👍

@cf-remylenoir
Copy link
Collaborator Author

cf-remylenoir commented Jan 12, 2024

I understood what was happening for the Caption component line-height in the Storybook (the line-height seemed off and I thought Storybook's styling was overriding our CSS).

The Caption component tag is span (inline) and the DensityContainer tag is div (block).

The div inherits the line-height from the body and takes over the span because of the nature of the inline element, if we change the span to an inline-block or change the tag to a block element, it works fine.


div > span (inline)
Screenshot 2024-01-12 at 13 58 26

div > p (<Caption as="p" .../> - block)
Screenshot 2024-01-12 at 13 58 44


It is an implementation detail issue, not an issue introduced by this work.

Copy link
Contributor

@stephanLeece stephanLeece left a comment

Choose a reason for hiding this comment

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

Lookin good! Just one lil comment. Changeset coming?

Copy link
Contributor

@stephanLeece stephanLeece left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Contributor

@stephanLeece stephanLeece left a comment

Choose a reason for hiding this comment

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

Nice!

@cf-remylenoir cf-remylenoir merged commit f094b71 into main Jan 15, 2024
12 checks passed
@cf-remylenoir cf-remylenoir deleted the feat/high-density-typography-scale branch January 15, 2024 09:15
@cf-remylenoir
Copy link
Collaborator Author

I understood what was happening for the Caption component line-height in the Storybook (the line-height seemed off and I thought Storybook's styling was overriding our CSS).

The Caption component tag is span (inline) and the DensityContainer tag is div (block).

The div inherits the line-height from the body and takes over the span because of the nature of the inline element, if we change the span to an inline-block or change the tag to a block element, it works fine.

div > span (inline) Screenshot 2024-01-12 at 13 58 26

div > p (<Caption as="p" .../> - block) Screenshot 2024-01-12 at 13 58 44

It is an implementation detail issue, not an issue introduced by this work.

This was fixed as part of #2655

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.

3 participants