Tailwind has made building components in React an absolute joy for me. I don't need to scroll up to find my css-in-js definitions, I don't need to change windows to find the CSS modules, it's all there, in one place.
Tailwind is a leaky abstraction
311–320 of 391 posts
Re: Tailwind is a leaky abstraction
#312Earlier quoted context omitted.
But now you just have a single-use html+stylesheet, as I wrote. No separation of concern anywhere, and both html and css can only be written by knowing the other part.
Why is the stylesheet single use? The classes can be used anywhere, as they should be. Make components in the CSS and call them by their classname in HTML. You are building generic components here. I don't see the issue with 'separate files', do people not use split view mode in their IDE? edit- this comment in another thread: https://news.ycombinator.com/item?id=33789859
I'm my experience the _vast_ majority of CSS never gets reused. Sure if all you are building is marketing websites or landing pages then I suppose some generic "cards" or whatever will get you pretty far, but for anything even moderately more complex... no chance
Re: Tailwind is a leaky abstraction
#313Re: Tailwind is a leaky abstraction
#314Tailwind has made building components in React an absolute joy for me. I don't need to scroll up to find my css-in-js definitions, I don't need to change windows to find the CSS modules, it's all there, in one place.
You could get the same benefits by using the `style` property though. The good part of tailwind is the part where it's all compiled down so it's not unnecessarily verbose in the HTML served to the client.
Re: Tailwind is a leaky abstraction
#315Tailwind has made building components in React an absolute joy for me. I don't need to scroll up to find my css-in-js definitions, I don't need to change windows to find the CSS modules, it's all there, in one place.
But you still have to have a config file, right? And the Tailwind docs. And then keeping track of when you changed something in your config that means the docs don’t apply 100%.
Re: Tailwind is a leaky abstraction
#316Re: Tailwind is a leaky abstraction
#317Eg .Btn for a bunch of styles that style a button element, then .Btn .—-large to make it large, etc, which uses more TW styles in my scss file to make it work. It saves me a ton of time and allows me to use the same template across many projects; if a color needs to change or sizes are different t I swap it out with css vars
Re: Tailwind is a leaky abstraction
#318what it really needs is an ASP.NET style ViewState!!!111
Re: Tailwind is a leaky abstraction
#319For instance: What is tailwind? Why is it important? What ecosystem does it live in and what problem does it solve?
Re: Tailwind is a leaky abstraction
#320Earlier quoted context omitted.
I've looked at tailwind as an individual, but their pay-for-documentation model is absolutely bullshit. And it doesn't seem to be doing anything different from Bootstrap or 99% of the other CSS frameworks out there. Also, it makes me sad to see people so eager to throw away separation of concerns :( Yes everything describing it is on one screen but now your HTML is filled up with hundreds of words of awful classnames…
Separation of concerns went out of the window a long time ago when frameworks (i.e. React) showed that it's better to combine business logic + markup into a neat encapsulated package. Having a neatly encapsulated component that does everything is fine in most setups. Your main challenge will be not growing these components too big. (( I really dislike Tailwind btw, mostly because I am just translating CSS into someth…