How to pass a variable from PHP to LESS?

后端 未结 2 1228
小鲜肉
小鲜肉 2021-01-05 08:53

I use PHP (lessphp) to compile LESS files into CSS files on the serverside. I would like to pass a variable to the LESS file, like a color or a language:

com         


        
相关标签:
2条回答
  • 2021-01-05 09:26

    This is a built in feature of lessphp, here's the documentation: http://leafo.net/lessphp/docs/#setting_variables_from_php

    0 讨论(0)
  • 2021-01-05 09:51

    I don't know less or lessphp so this may not be helpful and you may have already looked at it, but on the site I notice someone else has asked the same question and there are a couple of responses:

    http://leafo.net/lessphp/#dsq-comment-132897969 (You'll have to wait for it to load the comments from disqus)

    It looks like Nico-B has developed a patch to do this: https://github.com/Nico-B/lessphp/commit/aacc195fff4ec0075226a29bc832de371a8001ce#diff-1

    0 讨论(0)
提交回复
热议问题