If I understand the question correctly, CSS variables are a possible solution for your question. Whether this makes sense for your application, you must decide on the basis of webiq-sk's remark. We use this mechanism in the template for cartesian handling system to make the colours of the widgets editable at runtime. (Light, dark & customer specific design)
Below some basic infos. For more info see: Using_CSS_custom_properties
Css variables - can be used in CSS - be read and written via JS - Names must start with "--" e.g. "--my-var"
CSS example with variable .one { background-color: var(--my-var); } // get variable let sVal = getComputedStyle(document.documentElement).getPropertyValue("--my-var")
// set variable document.documentElement.style.setProperty("--my-var", "#FFAA00");
... View more