Font customisation and pairings#189
Merged
Merged
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR makes typography a little bit more first-class citizen in this project.
As a basis for design systems, it's important that we have good ergonomics for updating the look and feel for the entire project. This is what drove the decision of introducing border radius and inset CSS vars that control the "roundness" of the entire library.
Similarly, now we introduce a bit more thoughtful way of controlling the design system's typography system (while keeping the surface area as minimal as possible).
We introduce a few typography tokens in a way it doesn't requires us to change all components to opt-in:
The mechanism is:
This way we don't have to retro-fit all of our library to use
font-ui.it actually makes sense:
we want UI chrome to be the default inheritance (so every Button/Badge/Input etc. just works without opt-in classes). That means the body element MUST resolve to "chrome font", because everything inherits from body.
Another thing I considered was to name the css var
--font-proseinstead of--font-body, but I'll believe that people think of "body" as in "heading text / body text" and not the DOM element.