Move styles into code

This commit is contained in:
Ian Gulliver
2024-12-22 16:52:01 -08:00
parent 81b102f44a
commit afe6eed9c2
9 changed files with 138 additions and 49 deletions

View File

@@ -1,3 +1,4 @@
import { addStyle } from "./document";
import { ElemWrapper } from "./elemwrapper";
import { SingleTimer } from "./singletimer";
@@ -20,9 +21,7 @@ export class Highlighter {
}
}
document.addEventListener("DOMContentLoaded", () => {
const sheet = new CSSStyleSheet();
sheet.replaceSync(`
addStyle(`
.preHighlight {
transition: color 0.3s ease-out;
}
@@ -31,7 +30,4 @@ document.addEventListener("DOMContentLoaded", () => {
color: var(--sl-color-primary-600);
transition: color 0.1s ease-in;
}
`);
document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
});
`);