6 ms·
It's not shortsighted at all. CSS is declarative because if its programmatic, you might as well generate it with a real language.
by smrtinsert 13y ago
It's not shortsighted at all. CSS is declarative because if its programmatic, you might as well generate it with a real language.
- jcutrell 13y agoThe same could probably be said of most of the HTML generators out there. HAML, in particular, has a lot of similarities. I agree that programmatic things should be done with programming. I also think that for those who are coming from CSS, the barriers are lower with something that has the shape of CSS. And, the other part of this argument for pre-processors is that they "work." If I were to approach most junior front-end devs with a given programming language versus SASS to generate their CSS, most of them would pick SASS simply because of syntactic familiarity. Not a particularly compelling reason methodologically speaking, but the natural shift does make it a reasonably easy transition from purely declarative to pseudo-dynamic. The purist in me agrees, but the practical implementation says these things are valuable.
- lucisferre 13y agoIt's a superset of CSS language that provides an additional DSL that extends it in a number of ways that provide significant productivity and design benefits. Exactly why would a "real" language make more sense than that?
- mr_luc 13y agoThat might be the opposite of what you want if there's any chance you'll be working with a heterogenous web stack. Define your styling framework in scss, use it from multiple backends. A common case is to share between a static site generator for a public site, and an app framework for the app, which may well be written in different languages.