4 ms·
I just can't see what the path to adoption of this looks like. How do you achieve backward compatibility? You put a box-shadow on your elements today and while
by simonrobb 13y ago
I just can't see what the path to adoption of this looks like. How do you achieve backward compatibility?
You put a box-shadow on your elements today and while it won't look quite as shiny in browsers that don't support it, it's not going to affect usability. If you put a variable in that stylesheet, say to make the background of all your clickable elements blue, how do you provide a fallback for the browsers that don't understand the directive? If my elements aren't blue in anything except the latest build of FF, there's no way I can justify using the feature, obviously (as much as I like the idea of it).
- yuchi 13y agoOptions: - use only variables, and put `body { background: #eee; color: #333; }` so this is the 'fallback' - prepend a fallback style: `color: red; color: var(main-color);` - use a css preprocessor to mangle all the things -- somehow.
- simonrobb 13y agoPrepending the fallback style was the option I was considering, but it does really defeat the whole purpose of the idea. You'd end up with the same styles that you would have without variables, plus all the duplicate rules using variables, all for no gain. If I were using a preprocessor, I'd just use the in-built variables of that preprocessor I guess.