How to control Sass Variable with javascript

前端 未结 8 1624
予麋鹿
予麋鹿 2020-12-01 17:47

I have a Sass file which is generating a CSS file. I have used many variables in my sass file for background color, font-size, now I want to control my all variables through

8条回答
  •  南方客
    南方客 (楼主)
    2020-12-01 18:52

    JavaScript runs client-side (in the web browser), while Sass is generated server-side, so you have to find some way to bridge that gap. One way to do this would be to set up some AJAX-style listening to send JavaScript events over to your server, and then have the server edit and re-compile your style.sass file.

提交回复
热议问题