Skip to content

Shorthand use case to defining variants #796

Answered by lukemorales
kerimcet asked this question in Help
Discussion options

You must be logged in to vote

Your idea is very similar to this PR implementation: #721, they're discussing if this feature fits the plans for Stitches.

But your approach with the PR would become:

variants: {
  spaceY: (value: 1 | 5 | 10) => ({
    spaceY: value
  )}
}

or even better, if you want that to be dynamic with every space token:

variants: {
  spaceY: (value: Stitches.ScaleValue<'space'>) => ({
    spaceY: value
  )}
}

then you would be able to use:

<Component spaceY="$5" />

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kerimcet
Comment options

Answer selected by kerimcet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants