The Debate Around “Do We Even Need CSS Anymore?”
css-tricks.com
The Debate Around “Do We Even Need CSS Anymore?”
1–10 of 67 posts
Re: The Debate Around “Do We Even Need CSS Anymore?”
#2You of course want to build up abstractions within your codebase to keep things DRY, but you get to use the normal tools for that (variables, functions, objects, classes) etc, rather than CSS.
Re: The Debate Around “Do We Even Need CSS Anymore?”
#3Great. Now simply reading a page without JS will become impossible, let alone interacting with it.
Re: The Debate Around “Do We Even Need CSS Anymore?”
#4The biggest problem with CSS is it's really easy to add, and close to impossible to delete (detecting potential repercussions is hard).
Sure there's performance issues, but most of the time your developer/maintenance time is worth the the extra bytes.
Re: The Debate Around “Do We Even Need CSS Anymore?”
#5> The idea is you apply styles to elements through JavaScript. Great. Now simply reading a page without JS will become impossible, let alone interacting with it.
Re: The Debate Around “Do We Even Need CSS Anymore?”
#6Re: The Debate Around “Do We Even Need CSS Anymore?”
#7There are two real reasons to use CSS for your styles. One is that your page should work without javascript, and doing your styles in javascript is a completely stupid reason to break support for no-javascript environments. The other is user choice. If a user doesn't like something about how your page is presented, they can fix it using userstyles. Maybe some text is too small for them to comfortably read but when they zoom in the layout breaks or other text gets too big. It's hostile to break this standard feature of the web just for whatever silly gains you get from doing your styles in javascript.
Re: The Debate Around “Do We Even Need CSS Anymore?”
#8Inlining CSS is stupid, it makes your page bigger, less flexible, doesn't use browser caching technics, and didn't solve the problem at all (or make it worse...).
CSS with Javascript is even worse, as it will be slow as fuck, hard to maintain, and equivalent to directly write CSS by hand anyway.
flex-boxes, box-model, table display, and more... solve most of problems you will ever had.
Re: The Debate Around “Do We Even Need CSS Anymore?”
#9The principle of least power is an incredibly important axiom of the web's architecture, and when people break it, lots of things become more difficult or impossible. If you don't like CSS, then by all means, propose a replacement – but please don't propose replacing it with executable code.
See:
Rule of Least Power – https://en.wikipedia.org/wiki/Rule_of_least_power
Principle of Least Power – http://c2.com/cgi/wiki?PrincipleOfLeastPower
Re: The Debate Around “Do We Even Need CSS Anymore?”
#10I've been using inline everything since templates (ejs) came into existence. Once you have templates you're only editing one location anyway. The biggest problem with CSS is it's really easy to add, and close to impossible to delete (detecting potential repercussions is hard). Sure there's performance issues, but most of the time your developer/maintenance time is worth the the extra bytes.
Hopefully, there are few enough classes and styles injected from a long js code chain that you can manually check the things the IDE misses. JetBrains IDEs are surprisingly good at finding things connected via common libraries in code, so I'm hopeful that IDE makers could recognize common patterns in libraries such as React and Angular (e.g. - ng-class)