Skip to content

Commit

Permalink
better style sheet setting
Browse files Browse the repository at this point in the history
  • Loading branch information
CarelessCourage committed Jan 3, 2024
1 parent 85f88ba commit b059e55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/engine/primitives/attach.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function setColors(flattened: FlattenColor[], element?: HTMLElement | null) {
function setColorSheet(flattened: FlattenColor[]) {
const sheet = new CSSStyleSheet()
sheet.replace(`:root {${flattened.map(({ name, color }) => `${name}: ${color};`).join('')}}`)
document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet]
document.adoptedStyleSheets = [sheet]
}

function setElementColors(element: HTMLElement, colors: FlattenColor[]) {
Expand Down

0 comments on commit b059e55

Please sign in to comment.