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

How to Load LESS Stylesheets Dynamically After Page Load?

DDD
Release: 2024-10-25 06:01:29
Original
332 people have browsed it

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