Hearing à lot about Tailwind CSS recently. Is there a React implementation and is it better than Material-ui ?
For further actions, you may consider blocking this person and/or reporting abuse
Hearing à lot about Tailwind CSS recently. Is there a React implementation and is it better than Material-ui ?
For further actions, you may consider blocking this person and/or reporting abuse
Full-stack Software Engineer -
Guillaume Sere -
Scofield Idehen -
Aral Roca -
Top comments (6)
I've used it a couple of times on Gatsby sites recently, as well as a React-based admin.
The nature of Tailwind means the idea of having a React-specific implementation like Bootstrap has react-bootstrap simply doesn't make sense - it's based around utility classes that map fairly closely to individual CSS rules.
It should be easy enough to integrate into most stacks - I have used it with Laravel Mix and Gatsby, and integrating it with create-react-app should be straightforward too as it's just a PostCSS plugin.
What does it mean by "utility classes"? (background: I've never used tailwind).
How does it differ from Bootstrap?
Basically, most of the classes only apply one CSS rule.
For instance, you apply padding of 1rem by adding the class
p-4
, and that's all that class does. Adding margin-x of auto ismx-auto
. Applying a dark green background can be done withbg-green-900
.It's possible to amend the size and colour presets if you need more or different colours and sizes.
It sounds weird, but it works surprisingly well for prototyping. Later on it's easy to extract the styles for easier reuse. I also find it fits well with component-based UI libraries like React or Vue, and there's less tendency for the end results to look same-y like many sites that use Bootstrap.
Thank you, Matthew.
I got the gist and seems pretty useful.
Thanks Matthew for really elaborating. If I pick Tailwind up it will be in large part cuz of u
Tailwind is so awesome. First time I see it I was not sell to the idea of using utility like this in my class. But now it make so much sense. Feel so natural now. Try it you will not regret it :)