@keyframes slide-in {
from {
transform: translateX(0%);
}
}CSSKeyframesRule: appendRule() method / notebook
CSSKeyframesRule: appendRule() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
let myRules = document.styleSheets[0].cssRules;
let keyframes = myRules[0]; // a CSSKeyframesRule
keyframes.appendRule("to {transform: translateX(100%);}");
console.log(keyframes.cssRules); // a CSSRuleList object with two rules