Skip to content

TwStyle[] Typescript #857

Answered by ben-rogerson
debatz asked this question in Q&A
Apr 10, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Unfortunately Goober doesn't have the array styles capability like Emotion or Styled components - that's why I've used a slightly different example, but it does allow object styles.
Try something like this:

<div
  className={css({
    ...tw`relative z-0 col-span-1 px-5 pt-5 text-gray-800 bg-white border border-gray-200 shadow-sm max-h-fit`,
    ...(design === "1" && tw`rounded-3xl max-w-[250px]`),
    ...(design === "2" && tw`rounded-3xl max-w-[300px]`),
    ...(design === "3" && tw`rounded-none max-w-[350px]`),
  })}
/>

Replies: 1 comment 1 reply

Comment options

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

Answer selected by debatz
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