3 ms·
Zen Garden is a great demo that shows what you can do with the self-imposed restriction of "you're not allowed to change the HTML", all your styling fits into a
by seanwilson 5y ago
Zen Garden is a great demo that shows what you can do with the self-imposed restriction of "you're not allowed to change the HTML", all your styling fits into a single small self-contained CSS file and you only need to style an article, navbar and some side panels but this doesn't make it a good approach for styling highly custom responsive designs for single page apps that have many UI components when working in large teams.
Experienced developers that understand CSS well have tried for years to make the Zen Garden approach work for complex cases but solutions like e.g. Tailwind and Bootstrap (where semantic HTML tags should always be used regardless) have been invented and risen in popularity as they scale well to complex cases. It's not because developers are lazy, don't understand CSS and aren't aware of current (and always evolving) best practices.
When screen readers and search bots will still understand the semantic HTML tags no matter what styling approach you use and you don't need swappable themes as a core feature of your site, why would you impose the restriction on yourself that you can't modify the HTML as you're changing the styling if you find it comes at a cost to development efficiency? Your docs and data are usually going to be stored and marked up in JSON, XML, Markdown, a database etc. then transformed into semantic HTML so you're still keeping data and presentation separate in this sense (and styling this core content of articles and blog posts is the easiest part of styling), but why try to separate content and styling further than this?
- rglullis 5y agoCan we flip this for a bit? What would be of web as an application development if swappable themes was a requirement? - Wouldn't it be easier to have WebComponents as an actual useful technology? - Wouldn't it be easier for browser engine developers to have an "strict mode" of sorts that could run optimized code for actual apps? - Wouldn't it be easier to develop client-side code for other languages that would deal with nothing but business logic, instead of forcing us to come with something like WASM? - Couldn't web clients perhaps come bundles with a set of these web components and styling themes, and wouldn't perhaps the browser be efficient enough to allow us to ditch mobile-clients? - By not having to support multiple clients and platforms, wouldn't we be able to avoid re-inventing JSON as a poor version of X(HT)ML? - Wouldn't the web be a lot more programmable and mash-able and lead to a lot of these server-side functionality to not be needed in the first place?
- jmchuster 5y agoHmm, if we were to really support user-swappable themes, one of the first major problems that comes to mind, is how do you split what the user should change vs what they shouldnt. Where do you draw the line, and then how do you make sure the user doesn't break things, only styling, and styling in a manner that leaves the interface still fully workable, with the worst offense being it might be "ugly".
- rglullis 5y agoHonestly, I am not even thinking about user-styling, only about setting some stricter separation between styling and structure for the browser. My dream world would be one, like in Zen Garden, be based on two principles: - the designer has no way to alter the document body structure, only the header for CSS file declarations. - Any kind of feature/effect that the designer could only achieve by changing the structure should be considered a P0 bug by the CSS engine developers.
- udbhavs 5y agoMaybe if CSS had more features to work with pseudo element hierarchies rather than just ::before and ::after it might be viable to have the markup be the bare minimum semantic elements.
- seanwilson 5y ago> it might be viable to have the markup be the bare minimum semantic elements. Why is this goal worth prioritising though? It doesn't impact screen readers or search bots for example. The major problem with CSS + HTML in my opinion is how to write it in a way that's easy to maintain and extend. More CSS pseudo elements could easily make that worse.