Home  >  Article  >  Web Front-end  >  How to Load LESS Stylesheets Dynamically After Page Load?

How to Load LESS Stylesheets Dynamically After Page Load?

DDD
DDDOriginal
2024-10-25 06:01:29235browse

How to Load LESS Stylesheets Dynamically After Page Load?

Dynamic LESS Stylesheet Loading

You wish to utilize LESS.js but necessitate loading specific styles dynamically following the initial page load. Although LESS convention dictates loading all stylesheets before the less.js script, you seek methods to circumvent this requirement.

To facilitate dynamic stylesheet loading, LESS.js version 1.0.31 introduces a solution. The less.refreshStyles() function can re-compile