4 ms·
he misses out 2 of the major disadvantages, 1. you add a dependancy / stage of complexity in the build stage, 2. you lose a direct mapping from your dom ele
by daleharvey 17y ago
he misses out 2 of the major disadvantages,
1. you add a dependancy / stage of complexity in the build stage,
2. you lose a direct mapping from your dom elements to your css, ie I can click inspect something in firebug and see on what line of what css file I need to change
and to be honest since I dont find css that hard to manage those tradeoffs are enough to put me off using one.
also worth mentioning css variables have been introduced, just waiting for ie? now
- chriseppstein 17y agoThese are good points but they are a downside to the approach of code generation, not to abstraction itself. If Sass was interpreted by the browser it wouldn't be the case, so while it's true for the world we live in today, it's not a fundamental issue with the approach itself of having the power of abstraction. So while I accept these as criticism of Sass, I do not accept them as downsides of abstraction. BTW, Sass will emit comments to your CSS to help you track down the original source of your styles. Nevertheless, I think I will add them to the list of downsides, because I don't think we'll have wide browser support for "Abstract Style Sheets" any time soon.
- misuba 17y agoIs there a client-side Sass-to-CSS parser? Seems totally doable, and it would address build-complexity problems.
- chriseppstein 17y agoThere's this: http://github.com/clr/sassijs/ http://github.com/clr/sassijs/ But I've not tried it yet and it's not provided by the Sass team so YMMV. It probably doesn't support the most recent sass syntax.
- tptacek 17y agoIt it certainly possible that by getting fancy with Sass you could lose track of your selectors and styles, but having spent the last several days debugging (Compass-unrelated) style issues with our app, it seems unlikely. Here's the deal: * Raw CSS looks exactly like the raw CSS you always had. * Sass CSS looks like the raw CSS, but is 1000x more readable. So, the only problem I've noticed is the throbbing pain behind my left eyeball that I get when I have to look at "real" CSS anymore. (Yes, I do have to search for selector names in my CSS instead of literally jumping to line numbers, but my workflow was never very line-number-centric to begin with.)