3 ms·
The designer doesn't work semantically. Working with tailwind is like digging the hole for a pool with a spoon instead of a bulldozer. They repeat the same ta
by PaulHoule 3y ago
The designer doesn't work semantically. Working with tailwind is like digging the hole for a pool with a spoon instead of a bulldozer.
They repeat the same tailwind classes 20,000 times and if the application gets bigger they repeat it 40,000 times and if they have to change the way it looks it is the mother of all cut and paste jobs.
There is an unholy convergence of the tools being almost but not quite adequate, the platform being driven by companies that have overly favorable unit economics (Google could care less if it cost $2M to make a simple web site) and a designer mindset that is all too comfortable with trading a bulldozer for a spoon.
Tailwind would be a lot more appealing to me if it was coupled with some system where I could say "class X inherits from tailwind classes A, B and C" and thus have a layer of abstraction over just writing properties.
- unclebucknasty 3y agoExactly. It's the frameworks driving the abuse. I actually think CSS is the wrong tool for modern webdev. Or rather, it should be the output of a compile process instead of something that designers and developers wrestle with. In general, we're building these complex SPAs, and still working directly in standards that were intended for a static document model. Part of the reason is we somehow believe we need infinite customizability, so for that we're writing in Assembly. But, the truth is that user interfaces are largely consistent and should be. Still, even if we did want maximal customizability, we should use tooling that generates the CSS, etc. And that tooling should be visual. I mean think about the fact that we're trying to hand code visual designs with text. Or that it was so accepted that we're only recently trying to generate the code from design tools like Figma, which is still imperfect. So many thousands of developer hours lost to this effort. Bass-ackwards to be sure.
- PaulHoule 3y agoMaybe it is the properties that are good and the selectors that are bad. One could point to a trend in the last 15 years of HTML and CSS being tuned up as an application platform. I'd point out the grid layout and flexbox as being features ideal for application work and https://www.w3.org/TR/2011/WD-html5-20110405/forms.html#forms https://www.w3.org/TR/2011/WD-html5-20110405/forms.html#form... is practically a love letter for applications.
- unclebucknasty 3y agoAgreed on grid layout and flexbox. Took them a while to "fully" land, but now that they're here, they also represent a good model for visual design tools to work with as output.
- deleted 3y ago[deleted]
- e12e 3y ago> Tailwind would be a lot more appealing to me if it was coupled with some system where I could say "class X inherits from tailwind classes A, B and C" How is that different from: D { @apply A B C; } Or creating a new utility? https://tailwindcss.com/docs/adding-custom-styles#using-modifiers-with-custom-css https://tailwindcss.com/docs/adding-custom-styles#using-modi...
- threatofrain 3y agoNote that the Tailwind team strongly anti-recommends @apply and regrets ever putting it in there. As for creating utility classes, well, those are still utility classes. If you do semantic classes then you are fighting against the philosophy of Tailwind as detailed in the Refactoring UI book.
- mhitza 3y ago> Note that the Tailwind team strongly anti-recommends @apply and regrets ever putting it in there Please link to something that supports this claim, because it's not the first time I've seen it made on HN, but only found it on HN
- e12e 3y agoI think "regrets putting it in there" is a bit strong - I'd be interested in a quote. That said, the documentation does lean heavily away from @apply: https://tailwindcss.com/docs/reusing-styles#extracting-classes-with-apply https://tailwindcss.com/docs/reusing-styles#extracting-class... > If you’re going to use @apply, use it for very small, highly reusable things like buttons and form controls — and even then only if you’re not using a framework like React where a component would be a better choice. Personally I think @apply is a useful tool - and I'm not sold on it being always evil.
- henbruas 3y agoIt's accurate. Here you go: https://twitter.com/adamwathan/status/1559250403547652097?lang=en https://twitter.com/adamwathan/status/1559250403547652097?la... https://twitter.com/adamwathan/status/1226511611592085504?lang=en https://twitter.com/adamwathan/status/1226511611592085504?la... https://twitter.com/adamwathan/status/1296770370209566720?lang=en https://twitter.com/adamwathan/status/1296770370209566720?la...
- zoogeny 3y agoI am a reluctant convert to tailwind. I've been doing HTML since the 90s, before CSS was even really usable for things like page layout. I mean, we didn't even use div in those days - it was table based layouts and spacer gifs. CSS appeals to a programmers mindset. Cascading seems like a good idea. Having classes that are reusable seems like a good idea. Complex selectors seem like a good idea. These are all forms of abstraction, almost like functional composition but not quite. But after decades of fighting with it, I have to admit that it just doesn't work. The myth that you could change an entire site design just by changing the CSS is a complete myth. I've been party to more than a few whole site redesigns and I can assure anyone unfamiliar that it involved a heck of a lot more than updating CSS (and more than HTML in almost every case as well). In fact, almost all advancements in CSS (including Sass and Less) seemed to tend toward isolating the effect of changes. Pretty soon most projects had a compenent.html/component.scss pair for every fragment and naming conventions like BEM [1] became the norm. Reusability for things like fonts and colors were handled with CSS variables. Tailwind is proof to me that isolation is more important for visual design than abstraction/inheritance/cascading. Inline styles would be the same advantage but they are way too verbose. 1. https://getbem.com/ https://getbem.com/
- PaulHoule 3y agoBEM sucks then you die.
- zoogeny 3y agoI wasn't a huge fan of BEM but it solved a real problem. The fact that sucky BEM was better for large teams than being without it shows how bad CSS design is. There was nothing more annoying than including a component on a page and some aspect of the component was visually broken. Like a margin inflated somewhere or a wrong color. And then time would be wasted trying to figure out what was cascading/inheriting. Worse case it was some CSS included at runtime by some JS script that was forced onto the team by marketing. But on large teams there was just a constant collision between page authors, component authors and other stakeholders. HTML Web Components tried to solve the problem by making the shadow dom isolated but in our experimentation the support was just too inconsistent across browsers. It was also a major pain to debug at the time (maybe this has gotten better?) I was completely against Tailwind, absolutely hated looking at it and I even used my position as a senior engineer at a company to block its adoption. I felt it flew in the face of the entire premise of CSS and the high-ideal of separating form and content. I now believe I was wrong.
- chiefalchemist 3y ago> Tailwind would be a lot more appealing to me if it was coupled with some system where I could say "class X inherits from tailwind classes A, B and C" and thus have a layer of abstraction over just writing properties. I feel the same. Give the component a class and then in the SCSS assign the setting there. But inlining each individual CSS setting? I don't get it. Sure maybe great for a quick prototype / MVP. But as a permanent tool? I don't see it.
- naasking 3y ago> Tailwind would be a lot more appealing to me if it was coupled with some system where I could say "class X inherits from tailwind classes A, B and C" and thus have a layer of abstraction over just writing properties. This mindset is the problem. You don't want or need this abstraction in the CSS, what you want is to encapsulate these styles properties in a reusable "HTML component", and then use that component wherever needed. It then carries those style properties into every instantiation. What use are semantic style classes in this context? Atomic CSS makes perfect sense in this context and makes composable development a breeze by comparison.
- naasking 3y ago> Atomic CSS makes perfect sense in this context and makes composable development a breeze by comparison. I should have also mentioned that your "semantic CSS" is necessarily anti-composable by contrast. Any reusable HTML components with semantic classes now require you to manually lift their CSS definitions into your CSS top-level context, which is a step that isn't required with atomic CSS / tailwind.
- unclebucknasty 3y agoWhat happens when you move on to the next project—which may have a completely different design motif—and you want to reuse those components? Do you have to restyle each component independently?