@starting-style {
/* rulesets */
}`@starting-style` CSS at-rule / notebook
`@starting-style` CSS at-rule
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
selector {
/* existing ruleset */
/* ... */
@starting-style {
/* declarations */
}
}[popover]:popover-open {
opacity: 1;
transform: scaleX(1);
}@starting-style {
[popover]:popover-open {
opacity: 0;
transform: scaleX(0);
}
}[popover]:popover-open {
opacity: 1;
transform: scaleX(1);
@starting-style {
opacity: 0;
transform: scaleX(0);
}
}#target {
transition: background-color 1.5s;
background-color: green;
}
@starting-style {
#target {
background-color: transparent;
}
}#target {
transition-property: opacity, display;
transition-duration: 0.5s;
display: block;
opacity: 1;
@starting-style {
opacity: 0;
}
}
#target.hidden {
display: none;
opacity: 0;
}<button>Display <code><div></code></button>