3 ms·
Not to be too snarky: but what feature of CSS variables can't be emulated just as cleanly with a little jQuery? There is always going to be a spectrum between
by ajross 18y ago
Not to be too snarky: but what feature of CSS variables can't be emulated just as cleanly with a little jQuery? There is always going to be a spectrum between "style" and "behavior" attached to elements, and it strikes me as much more productive to try to solve the problem at the level of a programming environment instead of a no-longer-quite-as-static-as-originally-envisioned style description language.
- Hexstream 18y agoDoesn't jQuery require client-side javascript? If so that precludes its use for crucial parts of CSS in my mind. Hasn't anyone thought of implementing a "static" version of jQuery that makes modifications at compile-time on the server?
- jamesbritt 18y agoI think most Web frameworks have some means of templating CSS files.
- twism 18y agoycfeeds.com uses server-side jquery and (although ycfeeds.com does not do it much) can manipulate dom styles and add class names to elements using CSS3 at "compile time".
- bprater 18y agoElegance.
- ajross 18y agoOK, I call shenanigans here. In what was is adding a feature to a non-programmable, designed-by-commitee data format instead of using a tight, well-defined and very powerful feature of the pre-existing development environment ... elegant? My original question was, after all, an aesthetic one. I guess I just simply don't understand your thinking here.
- bprater 18y agoElegance here means having much meaning a small space. Variable replacement is hardly programmable. More of a macro expansion. To my eyes, this has lots of meaning: div { color: var(CorporateLogoBGColor) } To my eyes, this has very little meaning and forces me to consult a reference doc every time I look at it: div { color: #e852aa } I think the var() syntax is non-elegant, it's a bit fugly. I think Perl's $ might visually look more elegant. Advantages: DRY works. Designers can make sweeping changes to a page with a small change. I don't think designers are going anything but more flexibility in having this available.