less.js lazy sheet load

前端 未结 6 1252
天涯浪人
天涯浪人 2021-02-06 00:07

I\'m wondering if there is a way to load a single less sheet sometime after a page load. This question has an answer that explains how to reload all the sheets, but for my use-

6条回答
  •  我寻月下人不归
    2021-02-06 00:42

    Alternatively you could write some server-side code which would convert your .less stylesheet into .css on the fly. From the client you would load it lazily as if it were any other .css stylesheet. This is the approach used by http://www.dotlesscss.org/ although it could be used by any flavor of .less.

    Maybe not what you're looking for, but it's an option for some I think.

提交回复
热议问题