@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
@thebabydino @tabatkins Yes, but why do you expect the @ media rule to reach in and grab styles from the root or other element?
2
1
@thebabydino @tabatkins And the perf cost of the browser maintaining a separate cascade just for the without-@ media style on the root?

Jun 8, 2014 Β· 12:13 AM UTC

1
Replying to @davidbaron
@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