@starting-style – exemple de base
@starting-style – exemple de base
HTML
index.html <div class="box"></div>
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;
}
}