@starting-style – exemple de base

Démos

@starting-style – exemple de base

Aperçu seul
01

HTML

index.html
<div class="box"></div>
02

CSS

style.css
@layer demo { .box { transition: background-color 10s; background: blue; @starting-style { background-color: red; } } } @layer demoStyles { :root { --border-color: green; } *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } body { color: white; } .box { width: 200px; height: 100px; border-radius: 15px; } }