CSS Variables in Firefox 29
1–10 of 31 posts
Re: CSS Variables in Firefox 29
#2Do developers actually only use this on FF29+ until all browser adapt? Is this one of those things where we will see workarounds for older browser for decades to come?
Or is this more something that CSS frameworks like LESS pick up and the actual thing is abstracted away for a couple of years still?
This does seem like a very useful feature.
Re: CSS Variables in Firefox 29
#3I wasn't paying attention the last time we had some awesome additions to CSS. How does something like this get adapted? Do developers actually only use this on FF29+ until all browser adapt? Is this one of those things where we will see workarounds for older browser for decades to come? Or is this more something that CSS frameworks like LESS pick up and the actual thing is abstracted away for a couple of years still?…
I think it will take some time until there is enough browser support to use variables on a productive site. but maybe browsers will implement this faster... there's hope
Re: CSS Variables in Firefox 29
#4CSS Variables in combination with an additional build step[1] is actually quite usable right now.
[1] https://github.com/segmentio/myth
Edit: The introduction of the new notation as mentioned by heycam, explains Chrome's behavior a bit.
Re: CSS Variables in Firefox 29
#5:root { --spacing: 16px; }
and reference them like this:
body { padding: var(--spacing); }
Re: CSS Variables in Firefox 29
#6Please note that the final syntax for CSS Variables changed recently, so in Firefox 31 and later, where the feature is enabled by default, you declare variables like this: :root { --spacing: 16px; } and reference them like this: body { padding: var(--spacing); }
Re: CSS Variables in Firefox 29
#7Ref to feature being removed: https://groups.google.com/a/chromium.org/forum/#!topic/blink...
Right now, Firefox 29, Aurora and Nightly are the only browsers that have CSS Variables shipped. (Although, there is still no CSSOM implementation present — that'll come later.)
Re: CSS Variables in Firefox 29
#8Re: CSS Variables in Firefox 29
#9After looking at the spec, I'm wondering does this really save anything for the client, vs. doing this in a CSS preprocessor? Instead of spending the time compiling once and then having clients interpret declarations, every single user who visits the site will have their browser perform the same computation, every time they visit a page that uses these . It's also another source of significant complexity to the brows…
CSS preprocessors can do only lexically scoped substitutions. With CSS "variables" you can have values inherited within DOM's scope.
Re: CSS Variables in Firefox 29
#10Please note that the final syntax for CSS Variables changed recently, so in Firefox 31 and later, where the feature is enabled by default, you declare variables like this: :root { --spacing: 16px; } and reference them like this: body { padding: var(--spacing); }