CSS transform
based on condition
#2279
Answered
by
astahmer
RemyMachado
asked this question in
Q&A
-
I was wondering about what's the best way to achieve a css Use case: <ChevronDown
style={{
transform: `rotate(${isOpen ? 180 : 0}deg)`,
transition: 'transform 0.3s',
}}
/> With a What are your advices? |
Beta Was this translation helpful? Give feedback.
Answered by
astahmer
Feb 28, 2024
Replies: 1 comment 1 reply
-
it's fine to use <ChevronDown
style={{ transform: `rotate(${isOpen ? 180 : 0}deg)` }}
className={css({ transition: "transform 0.3s" })}
/> |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
RemyMachado
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it's fine to use
style
for dynamic styling