Hacker News new | past | comments | ask | show | jobs | submit login

Users were supposed to be able to override the styles of their pages, but have you ever tried to do that lately?

That probably has more to do with the "appification" of web sites than anything else, where huge amounts of JS and CSS are used together to produce a poor imitation of a desktop application. Pages that aren't SPAs are far more amenable to styling changes, and are often quite readable (or even more readable) even with all author-CSS disabled.

When CSS is being generated by programs, you might as well have those programs generate inline styles - what would we lose? And we would gain in simplicity.

I see inline styles as being more of a "one-off" thing, while CSS selectors can affect many nodes in the tree, so I think both have their uses. The "simplicity" is offset by the increased memory consumption and overhead of parsing every inline style, when much of them will be the same. You could argue that pages could be compressed and maybe browsers could use methods to identify duplicate styles so they can also compress them in-memory, but why do all that (i.e. making every client, on every page reload, have to expend the resources to derive this information) when you can group together common styles under one selector for which the browser will naturally treat as one object?




Maybe inline is an extreme example - but suppose we didn't allow the selector syntax, only a simplified form of CSS where the only selector is a single class, and only allowed one class per element? Then the browser could share everything it can share today - it still needs to compute the final style for every element on the page, so the only way it can reuse styling information is if two elements come out with exactly the same style - but it would be much easier to see why any given element was styled the way it was, the browser implementation could be simpler, and our programmatic frameworks for styling components on the page would still be able to help us avoid repeating ourselves.


The top article on hacker news created a fuss because it's idiotic interactive book type layout made it horrible so people had to disable it




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: