mouse0270 / lib-themer

A library used to create css variables for use in themes
MIT License
3 stars 2 forks source link

Move CSS Variables to Dynamic Stylesheet @MLeahy #30

Closed mouse0270 closed 1 year ago

mouse0270 commented 1 year ago

Heya.... So w/ libthemer you are putting all of the CSS variables inline in the html element. I suggest you create your own dynamic style sheet so that these variables don't clog up the developer console. Fantasy RPG UI has a metric ton of inline styles for instance. Just some code from TRL that creates / manages dynamic style sheets for CSS variables. Feel free to grab it or take inspiration. https://github.com/typhonjs-fvtt-lib/svelte-standard/blob/main/src/component/internal/StyleManager.js

In use: https://github.com/typhonjs-fvtt-lib/svelte-standard/blob/main/src/component/internal/cssVariables.js https://github.com/typhonjs-fvtt-lib/svelte-standard/blob/main/src/component/standard/index.js#L74-L79

Just a bit cleaner than stuffing everything in inline styles in a visible element in the DOM.

mouse0270 commented 1 year ago

Added in version 1.0.5 https://github.com/mouse0270/lib-themer/releases/tag/1.0.5