@tabatkins Shouldn't I be able to do something like `@​media (max-width: var(--w)) { /* stuff */ }`? :( codepen.io/thebabydino/pen/D…
1
@thebabydino @tabatkins What element does --w come from, and which CSS rules are used when deciding its value?
1
@davidbaron @tabatkins :root { --w: 500px } .boo { width: var(--w); } /*ok*/ @​media (max-width: var(--w)) { .boo { color: tan; } } /*NO:(*/
2
Replying to @anatudor
@thebabydino @tabatkins Yes, but why do you expect the @ media rule to reach in and grab styles from the root or other element?

Jun 8, 2014 Β· 12:11 AM UTC

2
1
@thebabydino @tabatkins And the perf cost of the browser maintaining a separate cascade just for the without-@ media style on the root?
1
@davidbaron @tabatkins That I don't know. I just wanted to do a version of this codepen.io/thebabydino/pen/I… using CSS variables instead of Sass.
1
1
Replying to @davidbaron
@davidbaron @tabatkins Because all elements would inherit from the root, except in this case it's not an element, now I get the question...
1