How to control Sass Variable with javascript

前端 未结 8 1630
予麋鹿
予麋鹿 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:36

    If you're looking to do what bootstrap do (ie editing fields to download a theme).

    You'd have to:

    1. Have the files on hand that you want to edit
    2. Store these variables as a string, and use .replace() to search and replace variables
    3. Output this string and compile it to a file and or zip it up for download.

    I'd personally do this with php.

提交回复
热议问题