I realize this may be a dumb question because I am returning to web dev after some time anyway, so please don't be shy to enlighten me! To me it seems that the art of css hacks (like back in the day to sniff out old IE browsers) could be used to fill the gap between the new-ish @supports queries and old browsers that do not support these features. Potential to save yourself and your site from alot of javascript? Even aid in dropping javascript altogether in small projects. Is anyone aware of any projects like this? It is also possible I have failed to search with proper keywords...
1 Answer
Yes, you can do this with the next commands:
The all following examples are valid:
@supports not (not (transform-origin: 2px)) - for test browser on non-support
or
@supports (display: grid) - for test browser on support
or
@supports (display: grid) and (not (display: inline-grid)). - for test both
See MDN for more info: https://developer.mozilla.org/en-US/docs/Web/CSS/@supports
1 Comment
Tim Bilotta
<!-- legacy cascade --> <link rel="stylesheet" href="legacy.css"> <!-- modern cascade, overwrites legacy if argument is satisfied --> @supports ( color: rgb(255,255,255,0.5) ) { @import url("modern.css"); @media ... @supports ... ... } In this case I test to see if modern colors are accepted with alpha (transparency) and then safely apply more modern sugar correct? @BoltClock
@supports. caniuse.com/#feat=css-featurequeries. Only ~2% of users still have IE and will face issues: w3schools.com/browsers/browsers_explorer.asp