I have been looking at this for awhile. I have my application right now as it is. We have variables defined in the scss for coloring. I am trying to import the variables into Typescript so I could submit them to servers.
I have a bunch of font and color strings in my Angular component, but i figured to push them into a scss file as it is used for design. The issue is that I dont know how to fetch the colors.
I saw some people doing something similar in Javascript, but I have currently been unable to reproduce it in Typescript.
Ideally, I want do do:
Scss:
:export { myVariable:#ffffff; }
NGTypescript:
import {styles} from "./styles.scss";
and then do something akin to:
onPostRequest(){ let color = styles.myVariable; ... }
When i get to the import line above, it will state: Cannot find module './icon-picker.component.scss'.ts(2307)
I have seen in similar examples like React, which does similar, but i am having issues also porting that concept to Angular. https://github.com/css-modules/css-modules/issues/86 shows concepts I was noticing. Here is also a Javascript walkthrough which seems to also have issues with: https://til.hashrocket.com/posts/sxbrscjuqu-share-scss-variables-with-javascript