Adding styled components-like syntax #225
silvestreh
started this conversation in
Ideas
Replies: 3 comments 8 replies
-
I'll try to make it so we could also pass a function alongside of tailwind class names to, potentially, do something like: const MyComponent = tw.View`
bg-black
${props => ({
'text-red-500': props.hasError
})}
`; |
Beta Was this translation helpful? Give feedback.
0 replies
-
that looks really cool! nice work 👍 |
Beta Was this translation helpful? Give feedback.
8 replies
-
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
-
I came up with a rather simple utility function for creating components much in the same way as
styled-components
. This is what it looks like:And this is how you would use it:
And one of the nicest things is that you get IntelliSense in VSCode after adding this to your config
Beta Was this translation helpful? Give feedback.
All reactions