CSS Variables landing in Chrome 49
developers.google.com
CSS Variables landing in Chrome 49
1–10 of 70 posts
Re: CSS Variables landing in Chrome 49
#2 .foo {
&--bar {
--bar: 0;
}
}
It's a pretty contrived example, but akward to comprehend at first glance.Re: CSS Variables landing in Chrome 49
#3custom props beginning with 2 dashes is slightly annoying given the BEM syntax has already grabbed that as Modifier... .foo { &--bar { --bar: 0; } } It's a pretty contrived example, but akward to comprehend at first glance.
Re: CSS Variables landing in Chrome 49
#4Re: CSS Variables landing in Chrome 49
#5Ok, that's cool. How long until we're able to use this and not have to worry about browser incompatibilities?
Re: CSS Variables landing in Chrome 49
#6Ok, that's cool. How long until we're able to use this and not have to worry about browser incompatibilities?
Re: CSS Variables landing in Chrome 49
#7Re: CSS Variables landing in Chrome 49
#8The syntax is verbose and ugly compared to SASS
Re: CSS Variables landing in Chrome 49
#9Ok, that's cool. How long until we're able to use this and not have to worry about browser incompatibilities?
~5 years depending on who you're targetting.
Am I right in assuming that IE won't receive any more feature updates? Many enterprises will stay on Win 7 for a while and enterprises traditionally embrace IE, so thank you, "new" Microsoft, for pushing things forward.
Re: CSS Variables landing in Chrome 49
#10I would normally say, "But, at least there's been time to work out the syntax in non-core projects, so things are probably nice now." But, this syntax and behavior doesn't even resemble SASS or LESS. Is there some other tool out there that provides variables in CSS that this is modeled after? Why reinvent the wheel when so many people are already familiar with and have worked out the quirks in SASS or LESS?
Reading the explanation for why they went this way (in short, because these are nothing like SASS variables, in the sense that SASS is more like a macro): http://www.xanthir.com/blog/b4KT0
Is somewhat unconvincing. Why not implement what's already working for people in SASS/LESS (in the way it's already working), and then move on to whatever it is they've implemented here later once it is clear it's something people want/need and once it's been worked out in pre-processors? (I don't think I quite grasp the entirety of the difference, either...is it merely a matter of scope and composability?).
Actually, someone in the comments maybe sums it up:
"In fact, let me see if I've got this straight in my head:
CSS preprocessors added a feature called variables, but which would more accurately be described as macros.
Browser vendors and the working group worked sporadically on an in-browser implementation and standardisation of this macro feature, and they also called it CSS variables.
The WG's focus shifted to a feature more akin to custom properties, but which retained the name CSS variables.
So, right now we have CSS variables in preprocessors, which are macros, CSS variables in browsers, which are custom properties, and maybe at some point in the future, macros in the browser, and actual variables in the browser." (Source: http://www.xanthir.com/b4KT0#4KT0-13 )