Hacker News new | ask | show | jobs
by viddi 1294 days ago
Maybe I'm going out of a limb here, but wasn't the whole point of CSS to not have to touch the markup when changing the styling? Not trying to talk Tailwind down, I have just missed a lot of the evolution of web design in the past 15 or so years.
5 comments

I've never understood the point of separating markup from the design. I've seen CSS Zen Garden and... neat? But I don't get the point in real-world use. I've never had to redesign a UI in a way where I'd only change CSS and not also be moving around markup in the process. And once you're changing both of those things, there's the overhead of cross-referencing and keeping names and hierarchy in sync. At that point I don't know why I'd want the 2 separate.

The most magical moment for me when I started using Tailwind was realizing you can simply cut-and-paste an arbitrary block of HTML from one place to another and have it just render exactly as you'd expect. You don't have to additionally copy-paste a block of CSS, and then fudge around with the selectors because in the previous place it expected to be in some parent container or what have you.

The question of where to put the styles boils down to "do your content and style people work in completely separate teams?" For a newspaper, this is true. For someone who got their mate to set up their blog, this is true. Early days web was mostly like that. Not any more. If it's the same person doing it, put it in the same place. Separation will just be a hindrance.
It still is mostly like that, the content is not the html, the html is the presentation layer, as much as the css.

The content will be inserted from an API or with a templating system.

I want to see the company where the HTML and CSS are handled by separate teams.
That reminds me the pitch for the first time I discovered css zen garden: "you can redesign your website without changing the HTML!"

I sort of liked it at first. I even added the opportunity for my users to modify the CSS to add new styles, and share these to other members of the community via a configuration page. It was a neat thing but not many people bothered and in the end it made everything more complicated (and I guess I was really scared of vulnerabilities the whole time, what can go wrong with letting your users set the stylesheet.)

Worse, I think this new approach broke the web as it was: an explosion of flash-layout or photoshop--or-fireworks-cut-layout websites. It used to be beautiful. Now the web is just a series of websites styled by CSS. It's sad.

phones (and their screen size + apple killing flash) really killed the beauty of the web IMO. Now everything's an app.

Well you have that CSS zen garden thing nowadays. It's all the different media, screen sizes, user preferences. And instead of writing multiple classes that defines styles for different outputs you just have one and let CSS handle the differences. No need to duplicate classes, just semantic names.
it really only would make sense if we were serving pure xml and the webpage was the api for literally every webpage.

since that is not the case, tail wind is great, even the biggest complaint about tailwind, bloated html size seems like something you can just compile away.

> it really only would make sense if we were serving pure xml and the webpage was the api for literally every webpage.

This is, of course, XSLT, which was supposed to take over the web at one point.

https://en.wikipedia.org/wiki/XSLT

Yes but the way we do HTML has also changed–for example by using JSX and reusable components. The issue of having to change markup in a lot of places to change styling doesn't exist anymore if you abstract that away in reusable components.
And using tailwind without a reusable components system is cumbersome to say the least. What is suggested in the documentation is to use editor features (multi-cursor, research and replace, ...) https://tailwindcss.com/docs/reusing-styles#using-editor-and...
Yes. Tailwind inverts that axiom to great effect. It's leaky on purpose.
Everything on the web became a lot more dynamic. Stuff like web apps obviously but even relatively straight forward info pages end up with dynamic filtering and elements of app like functionality often.

Given that, the separation becomes more of a pointless burden than actually doing anything useful.

That was back when XML was supposed to take over the world. We were going to style the same semantic content for print and web with CSS and/or XSLT. XHTML was the next big thing. Every web page was actually just a page.

We're not living in that future.

But the CSS ecosystem is still useful, and still adapting to our needs today. Tailwind might be considered one of those adaptations.

The sad thing is, the one good thing to come out of that swamp (xpath) isn’t used nearly widely enough.