Load variables into LESS CSS preprocessor from JSON file

后端 未结 4 1168
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-05 04:47

Is it possible to load variables into LESS CSS preprocessor from a JSON file like you can do with Stylus?

With contents of file myvars.json

         


        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-05 05:36

    When using LESS in browser, there is also 'globalVars' option that can be used to set variables before loading the LESS files: http://lesscss.org/usage/#using-less-in-the-browser-options

提交回复
热议问题