Move highlighter styles out of app.css

This commit is contained in:
Ian Gulliver
2024-12-22 15:05:12 -08:00
parent 822a4891d0
commit 81b102f44a
4 changed files with 47 additions and 12 deletions

View File

@@ -18,4 +18,20 @@ export class Highlighter {
this.elem.classList.add("highlight");
this.timer.start();
}
}
}
document.addEventListener("DOMContentLoaded", () => {
const sheet = new CSSStyleSheet();
sheet.replaceSync(`
.preHighlight {
transition: color 0.3s ease-out;
}
.highlight {
color: var(--sl-color-primary-600);
transition: color 0.1s ease-in;
}
`);
document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
});