Ignore your users’ needs. Call them stupid instead.
glyphobet.net
glyphobet.net
Indeed, instead of Bos ignoring this guy's argument, it seems to me it's the other way around. The standards body's response to "add variables to CSS" is "why? that's an application-layer concern, easily handled by any web development framework, which has nothing to do how browsers actually process style information". The onus is in fact on the advocates of extending CSS to explain why this feature is so important browsers should be required to implement it.
It's also just bad engineering to add features at lower layers that are just as effectively handled at higher layers. The end to end argument in systems design doesn't just apply to network protocols.
If they, and Bos, have any clue about what they are doing, they should tell us how to solve this problem, instead if asking the inane question you put in their mouths. What Bos comes up with in his essay is basically 'search-and-replace' and other 'tooling'. Well, why don't we just drop variables in our programming languages as well? We can just 'search-and-replace', can't we?
"adding another step to the build process"
is worse than
"permanently standardizing one group's notion of what variables should look like when less than 1% of all web applications use any form of CSS templates"
I don't have to agree with Bos that high-level stylesheets are a bad idea (I don't; I think they're a great idea) to agree with him that we shouldn't be inflicting them on everything that renders or interprets styled HTML.
And hey --- for what it's worth --- I can see how Bos didn't do his argument a big favor by writing an essay-length rant about why variables are a bad idea. I think he raises some good points. For instance, have these proposals really thought scoping through, and have we really thought about how this will impact authorship tools? But these aren't the reasons we shouldn't be in the business of standardizing the idea.
On the other hand, Matt's argument is just as wrongheaded. It is absolutely not the case that standards groups should be rushing to alleviate web developer pain. Like I said, if they took that approach, we'd be stuck with QuickSilver templates, baked permanently into the HTML standard.
It's not just about the effort for browser developers. It's also about the effort of getting all the browsers in use to be more-or-less compatible with the standard.
Really?
Never ?
I've got to disagree with this.
All possible changes that one might make to a codebase should be evaluated in terms or ROI (return on investment).
If a 1 day project creates X value, and a 3 day project creates 5 X value, then the latter project delivers more bang for the buck, and that's where resources should be allocated.
To ignore the amount of work that a task takes is to blind oneself and discard rationality.
However, if the customers have a specific pain point, our jobs are to alleviate that pain, not sit around and say, "It's too hard."
The question isn't whether to implement higher-level stylesheets. It's where to implement them.
The only big design decision would be whether to allow writing to document.variables from JS (or, to rephrase, whether to parse the JS entities permanently upon recognition into their textual values before parsing can continue, or to have them continue to exist as a special kind of DOM node—though rendered as their current textual equivalent—that will reflow the document if their dependent values are altered.)
If JS entities aren't parsed away, it would change the way we interact with the DOM entirely—we probably wouldn't bother defining any constants in CSS itself any more; we'd just inject them. It would reverse the data-flow between Javascript and mark-up, even beyond how much AJAX already has: we wouldn't need to set specific things in the DOM, but instead just have those DOM nodes be an observer of our actual, working value. For example, "document.body.styles.background-color = document.createVariableElement(spinner.color);" as a line of Javascript would make the background-color of the page "watch" the current value of the spinner. In fact, if this method were used, you technically wouldn't need a separate variables.json document, because you could just dynamically create all the JS entities in JS (which is probably how it should be.) However, you could create one on top of JS entities, if you wished, using a library.