| ▲ | christophilus 19 hours ago | ||||||||||||||||||||||
CSS requires discipline, or you end up accidentally styling something completely unrelated because you were overly general, or overly specific, or accidentally reused a class name. CSS disallows local reasoning. If you’re writing markup for a component, you have to jump between two files. There are plenty of other problems Tailwind solves, but these two alone make me never want to go back. | |||||||||||||||||||||||
| ▲ | benjiro 18 hours ago | parent | next [-] | ||||||||||||||||||||||
Ignoring that Tailwind requires that same discipline... Pay close attention how often you end up in a situation where a different color was used, or how dark theme tags have been missing, and so much more. What if you need to copy a element with tailwind, this later gets altered to include a slightly different style, but wait, now you have a original somewhere else in your code base, that is missing those updates. So you require the discipline just like CSS to keep things up to date. Tailwind is great if you use it sporadically ... but have you looked at the source code of so many websites that use tailwind? Often their entire html file is a horrible mess million miles long tags. I am amazed how often people do not even realizes that CSS supports nested Selectors? With nested Selectors, you get the benefit of creating actual component level structures, that can be isolated and shareable. Yet almost nobody uses them. I noticed that most people lack a lot of CSS knowledge, and they find it hard because they never stepped beyond the basics. Nor do they keep up to date. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | azangru 19 hours ago | parent | prev | next [-] | ||||||||||||||||||||||
I agree with you about discipline; but... was it not interesting to discover how to build such a discipline? Was it not intriguing to learn how people who had been writing CSS for years had made it tolerable? Besides, there recently have been several crucial improvements to CSS to address these pain points. One is CSS layers, which lets define custom layers of specificity that help with the discipline (e.g. resets or some baseline styles go in a low layer, component styles go in a higher layer, and finally overrides end up in the highest layer). The other is CSS scope, which prevents the leakage of the styles. These should greatly help with the specificity issues; and @layer is now sufficiently broadly supported that it is safe to use. > If you’re writing markup for a component, you have to jump between two files. Yeah; one of the reasons for my question about the groups in which tailwind saw the biggest growth was that in some ecosystems jumping between files was not a problem to begin with. Vue, for instance, had single-file components, where css could be written in the same file as javascript. So did svelte. So does astro. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | tisdadd 19 hours ago | parent | prev [-] | ||||||||||||||||||||||
This is why I loved polymer 1 and it's adoption of the shadow dom. | |||||||||||||||||||||||