Styled Components not applying styles #419
Unanswered
terraincognitas
asked this question in
Q&A
Replies: 1 comment
-
The const RichText = tw.div`...`
// or
const RichText= styled.div([tw`...`])
// Usage
const StyledRichText = tw(RichText)`
text-white
` If it can't be a styled-component, then add const RichText = ({ className }) => <div className={className} />
// or
const RichText = ({ className }) => <div className={className} />
// Usage
<RichText tw="text-white" /> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
According to the docs for twin.macro, it should be possible to style existing components, but neither the syntax
tw(Component)
orstyled(Component)
applies Tailwind styles in my case.The syntax below ignores the "text-white" property on the StyledRichText component.
Is there some type of config/settings needed in order to make styled components work? Maybe I'm missing some syntax thing but I feel I've tried everything.
Thanks for the help.
Beta Was this translation helpful? Give feedback.
All reactions