Using Feature Queries in CSS
hacks.mozilla.org
hacks.mozilla.org
/* NOT IE */
@supports (@supports) {}
IE does not support it so it's kind of pointless, no? If I ever actually make the user of a feature query, I would need to create a backup plan for everything and then another backup plan when that backup plan fails!Now to make it even crazier say we have another feature f1 that somehow impacts the case of @supports(f). We'll need to check five different cases (@s(f) + @s(f1), !@s(f) + @s(f1), etc...). It seems like I might as well just find the minimum feature set I can use and just go ahead with that. Anything more and there would be too much mental work for me.
To be fair, I haven't used it on a production site so far.
I get what is so compelling about it, but I don't think I've ever seen anybody use such things correctly in practice. At least not on the web.
There you go !
Unless you're avoiding a broken feature, CSS will simple cascade down with the first supported property by default.
It's how we've handled browser prefixing, background gradients, wonky flexbox and pretty much everything since forever.
Im sure it'll be an unpopular opinion, but whilst I can see some edge cases where you only want to apply certain ancillary css if your markup is going to be rendering in a certain way, I honestly can't think of many (any?) real world usecases where you're not pretty much frigging it to provide 2005-tier browser sniffing.
If you want to render different content for different browsers, I'm not convinced that is a function of stylesheets, not should it be.
If my layout needs extra padding or whatever if a div is a flexbox, rather than display:table, I would consider that to be an implementation issue rather than something I would want to cover with additional code.
I might just be completely missing the point, but it feels like a bandaid.