Table of Contents
Dynamic LESS Stylesheet Loading
Home Web Front-end CSS Tutorial How to Load LESS Stylesheets Dynamically After Page Load?

How to Load LESS Stylesheets Dynamically After Page Load?

Oct 25, 2024 am 06:01 AM

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