Live data from Hacker News

Why I'm Excited About Native CSS Variables

philipwalton.com

31–33 of 33 posts

Re: Why I'm Excited About Native CSS Variables

#31
post #18

Earlier quoted context omitted.

CSS Variables have been in Firefox for a year and a half now, and I’ve been using them in my own projects for at least a year, while I’m producing the thing in the first place—then when I have it as I like it, if it’s not purely for me, I rewrite it for inferior browsers (though I believe I could use something like PostCSS instead; I just haven’t). They really are a marvellous thing; my favourite example would be the…

> They really are a marvellous thing; my favourite example would be the construction of truly responsive interfaces, tweaked for optimality at many levels and continuous, rather than just things with three or four breakpoints; with preprocessors, it’s tedious and painful; Anything with preprocessors is tedious and painful, yet I've been hand-writing fluidly responsive layouts for years without predefined 'breakpoint'…

By using percentage values?

Re: Why I'm Excited About Native CSS Variables

#32

These look neat. I wonder what they will be like to debug. I spend a lot of my job fixing problems that the designers have left in the CSS, like "Why on this page is the button margin 2em, but on all the other pages it's 1.5em." I guess with variables thrown into the mix, it'll make this debugging harder.

Why harder? Surely if people actually use them, you’ll at least have labels attached to things—semantic labels, hopefully, rather than simple and opaque values? (I wish people would use `calc()` too where appropriate.)

I wonder what the css insight would show? Both the computed value and variable name?

Re: Why I'm Excited About Native CSS Variables

#33
post #18

Earlier quoted context omitted.

> They really are a marvellous thing; my favourite example would be the construction of truly responsive interfaces, tweaked for optimality at many levels and continuous, rather than just things with three or four breakpoints; with preprocessors, it’s tedious and painful; Anything with preprocessors is tedious and painful, yet I've been hand-writing fluidly responsive layouts for years without predefined 'breakpoint'…

By using percentage values?

Are you asking me if I use percentage values to do fluidly responsive designs? There's definitely some of that but most of the time it's even simpler than that - just defining a max width or height on something and letting things expand to fill their containers. Then you only have a few big containers in the entire layout to worry about :)
Post reply on HN