top | item 20204414

(no title)

actionscripted | 6 years ago

Not even close. Marketing has lead to some absurd uses of CSS but it's more about adaptive/responsive design.

When you need to handle an almost unlimited range of screen sizes having your visual system able to handle a little math is critical.

discuss

order

sureaboutthis|6 years ago

First there was marketing. Then there was adaptive design. And variables are new compared to almost everything else.

Bluestrike2|6 years ago

There's a CSS & FP Working Group note that listed variables--or more specifically, symbolic constants--as a proposed future extension to CSS2 back in 1998,[0] and I'd assume that there are even earlier discussions on the matter as well. The idea of using variables in CSS isn't new by any means. If you read this 2008 essay by Bert Bos[1] against extending CSS to include variables Bos makes a really intriguing comment that "macros help for authors, not for the semantic Web" in his conclusion.

Perhaps I'm reading into things, but it seems rather illuminative in terms of understanding how at least some key figures in the development of CSS may have viewed things. If you consider CSS in terms of two distinct audiences--authors/maintainers and users who consume CSS-styled documents--then at least some of the decisions with the CSS specifications seem to make a bit more sense. In which case, it's not so much that CSS didn't need the listed functionality as it is that other goals for the specifications were prioritized over the benefits of variables and other functionality. Reusability, modularity, and simplicity were some of the main priorities. They still are, but I think we've seen a redefinition of those terms with the direction front-end development has taken in the past decade; I also think that improvements in the uniformization of browser implementations and development of better debugging tools has helped erase some of the concerns given in the essay.

0. https://www.w3.org/TR/NOTE-CSS-potential#id05684046681

1. https://www.w3.org/People/Bos/CSS-variables