Hi All -- Wondering if anyone could recommend resources that might help me figure out how to efficiently create themes for an Angular application.
(We are not using Angular Material/this is not a question about theming Material components)
By efficiently what I mean is: given that I sometimes need color values in TS which with to do calculations (you can't do calculations on var(--my-color), what is the best way to make theme colors available in both SCSS and in JS without duplicating values?
Are people reading in a single JSON with values so as to have a single source of truth?
(Can you import JSON to SCSS?)
My current (/preliminary) strategy is to create a bunch of CSS vars in SCSS using Sass maps that are provided at the root level based on two theming options (one is set on app load, the other is triggered by user interaction), i.e.
html[data-theme-one] {
@sass-utils.make-scss-vars-from-maps($myMap)
}
But them I'm providing the same hex codes again in JS.
Is there a way around this?