-
Notifications
You must be signed in to change notification settings - Fork 3
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
Introduce web typography presets #1335
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## What are you changing? - Adds built script to generate CSS for new [web typography presets](https://theguardian.design/2a1e5182b/p/01555f-typography-presets/b/830670) from the existing definitions in the design tokens package and export these as individual variables from Source Foundations - Updates some incorrect font sizes in the design tokens ```bash pnpm nx run @guardian/source-foundations:build-type-presets ``` ```json "textSansBold15": { "$value": { "fontFamily": "{typography.fontFamily.textSans}", "fontSize": "{typography.fontSize.15}", "lineHeight": "{typography.lineHeight.regular}", "fontWeight": "{typography.fontWeight.bold}", "fontStyle": "normal" } }, ``` ⬇️ ```tsx export const textSansBold15 = ` font-family: GuardianTextSans, "Guardian Text Sans Web", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-size: 0.9375rem; line-height: 1.3; font-weight: 700; font-style: normal; `; ```
jamesmockett
added
the
🐥 Canaries
Triggers canary releases of any packages with changesets waiting.
label
Apr 9, 2024
Note The following canaries were published to NPM: 🐥 |
Note The following canaries were published to NPM: 🐥 |
sndrs
approved these changes
Apr 9, 2024
Note The following canaries were published to NPM: 🐥 |
jamesmockett
force-pushed
the
jm/type-preset-release-branch
branch
from
April 10, 2024 10:56
7205fe0
to
1080267
Compare
Note The following canaries were published to NPM: 🐥 |
jamesmockett
removed
the
🐥 Canaries
Triggers canary releases of any packages with changesets waiting.
label
Apr 10, 2024
Note The following canaries were published to NPM: 🐥 |
jamesmockett
added
the
🐥 Canaries
Triggers canary releases of any packages with changesets waiting.
label
Apr 16, 2024
Note The following canaries were published to NPM: 🐥 |
jamesmockett
removed
the
🐥 Canaries
Triggers canary releases of any packages with changesets waiting.
label
Apr 16, 2024
sndrs
reviewed
Apr 16, 2024
3 tasks
Co-authored-by: Alex Sanders <alex@sndrs.dev>
jamesmockett
added a commit
that referenced
this pull request
Apr 17, 2024
## What are you changing? - Reinstates [`article` typography presets](https://theguardian.design/2a1e5182b/p/01555f-typography-presets/b/830670/t/72b9c5) which were removed from the original PR (#1335).
This was referenced Apr 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are you changing?
Why?
Additional details
Each preset encapsulates a complete typographic style and is exported as a variable. Unlike the current API the presets have no options as there should be no need to override their styles. Values for individual properties such as weight and line height are also no longer provided for the same reason.
textSans.medium()
→textSans17
textSans.medium({ fontWeight: 'bold' })
→textSansBold17
textSans.medium({ fontStyle: 'italic' })
→textSansItalic17
headline.xlarge({ fontWeight: 'light', fontStyle: 'italic' })
→headlineLightItalic50
Each preset is available as a CSS string and an object literal.