Skip to content

Best practices to add custom global variant #2418

Answered by chasinhues
gamegee asked this question in Q&A
Discussion options

You must be logged in to vote

AFAIK, variants are per-component (meaning you would have to create a variant for every component that you wanted to use it on).

It sounds like what you're looking for is text styles.
E.g.

! Untested

// theme
const theme = extendTheme({
  textStyles: {
    xs: {
      fontSize: 1,
      lineHeight: 1
    }
  },
})

// usage
<Text textStyle="xs" />

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by chasinhues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants