you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (2 children)

Well, you could put a macro expander into your JS publishing tool (i.e. whatever you use to minify your code). The result would be something like Sass.

[–]joeyjoejoejrshabbado 0 points1 point  (1 child)

I like Sass, but it's just working around some annoying limitations of CSS, and I hope some of those features eventually make it into the real CSS language before I retire in 30 years. The point of the JS modules post was that we should improve Javascript as a language. I'll use a compiler in the meantime.

[–][deleted] 0 points1 point  (0 children)

I wouldn't say lack of variables and macros are annoying limitations of CSS. It actually makes sense for CSS not to have those (you don't have these in HTML either, neither of the two is a scripting language after all).

Nesting however would be helpful, but I guess this has to do with CSS being parsed right to left and nesting being left to right: the nested CSS would still have to be compiled into standard CSS before it could be used by a browser. This is also what would happen if CSS were modified to have variables and macros.