Set sass variable value in Angular 7

后端 未结 6 2663
悲哀的现实
悲哀的现实 2021-02-19 22:11

I have been working with angular for the last few weeks, and now I have a requirement to dynamically style a public site. The site admin set various color codes as well as a log

6条回答
  •  暖寄归人
    2021-02-19 22:37

    It is not possible in that way but rather than using the sass variable, you use the value of the sass variable. It may be any value.

    Why? because sass is compiled during packaging and in the end, it would still generate plane CSS.

    An example of a framework making use of this optional style processor is angular.


    In your case I would recommend looking into dynamic themeing within angular as what you require definitely needs JavaScript. Look into the guide on medium given by one of the contributors.

    https://stackoverflow.com/a/54559350/3070499

提交回复
热议问题