Why "variables" in CSS are harmful
1–10 of 13 posts
Re: Why "variables" in CSS are harmful
#2Re: Why "variables" in CSS are harmful
#3I tried to read the essay but as soon as I saw the page my eyes started burning
Re: Why "variables" in CSS are harmful
#4Re: Why "variables" in CSS are harmful
#5How patronising.
Re: Why "variables" in CSS are harmful
#6So having to retain the same values 100 different places in the stylesheet(s) makes them more reusable and maintainable than having the ability to define constants once?
What a joke.
Re: Why "variables" in CSS are harmful
#7Re: Why "variables" in CSS are harmful
#8The point that this can be done as a separate, server side processing phase has merit. Too bad it had to be wrapped in a ridiculously long, patronising article, containing such gems as the observation that style-sheets are rarely longer than a hundred lines. Right. And I'm not even going to comment on the choice of background.
It's called XSLT.
Re: Why "variables" in CSS are harmful
#9The point that this can be done as a separate, server side processing phase has merit. Too bad it had to be wrapped in a ridiculously long, patronising article, containing such gems as the observation that style-sheets are rarely longer than a hundred lines. Right. And I'm not even going to comment on the choice of background.
Also, it is much harder to do CGI scripting than to deal with possible constants in CSS.
Re: Why "variables" in CSS are harmful
#10He used reusability as an argument. So having to retain the same values 100 different places in the stylesheet(s) makes them more reusable and maintainable than having the ability to define constants once ? What a joke.
That said, I'm not sure if that potential problem alone justifies its lack of introduction - there are legitimate use cases as well where they will improve clarity, the ability to provide complex CSS as boilerplate and get people to change the constants to suit their needs would be useful (e.g. easy recycling of complex column code) and I think their argument about code reuse is pretty much nonsense too.