简体   繁体   中英

How to set SCSS variables' values from Angular/TypeScript

I have gone through other same type of questions and couldn't get clarity. I have an API which give me primary and secondary colors. I have to dynamically set my $primary and $secondary colors in SCSS file based on that. Also, I'm using some Angular Material components and I want those colors should also be updated as my other parts of app. Is there any way to achieve this?

In that case you have to overwrite the theme for change the primary and accent colors. Here you have a good example of to do it https://medium.com/@chrishouse/custom-material-theme-with-angular-5-f8ad0409bf44

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM