None
EN
Comment on Feature detect CSS @starting-style support by Ben Frain
['View More Posts', 'Published Bramus', 'Bramus Is A Frontend Web Developer Belgium', 'Working As A Chrome Developer Relations Engineer At Google. The Moment He Discovered View-Source At The Age Of']
Comments for Bram.us
Drawing inspiration from my previous post on how to detect support for @property , I came up with a similar method to detect @starting-style support @property --supported { syntax: "*"; initial-value: ; inherits: false; } :root { --supported: initial; transition: --supported 0s calc(infinity * 1s) step-end; transition-behavior: allow-discrete; } @starting-style { :root { --supported: ; } } /* Usage: */ :root { --bg-if-support: var(--supported) green; --bg-if-no-support: var(--supported, red); } body { background: var(--bg-if-support, var(--bg-if-no-support)); } @property --supported { syntax: "<number>"; initial-value: 0; inherits: false; } :root { transition: --supported 0s calc(infinity * 1s); } @starting-style { :root { --supported: 1; } }