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

Add support for defining fontSizes #310

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

kaltoft
Copy link

@kaltoft kaltoft commented Dec 19, 2024

Description

This PR adds support for defining font sizes in the theme. With this implementation fontSize is strictly set by referencing theme tokens, like with colors and spacing.

const theme = createTheme({
  fontSizes: {
    title: 34,
    h1: 28,
    h2: 22,
    h3: 20,
    body: 16,
  },
  textVariants: {
    defaults: {
      fontSize: 'body',
    },
    heading: {
      fontSize: 'h1',
    },
});

Checklist

@kaltoft
Copy link
Author

kaltoft commented Dec 19, 2024

I have signed the CLA!

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.

1 participant