Dynamically load set style on the fly normal css script let css div color red let link document createElement link link type text css link rel stylesheet document head appendChild link let myBlob new Blob css type text css link href URL createObjectURL myBlob script div HELLO Hello div Dynamically load set style on the fly less file script async let css ColorN red div color ColorN let link document createElement link link type text less link rel stylesheet less let myBlob new Blob css type text less link href URL createObjectURL myBlob document head appendChild link let s document createElement script s src https cdnjs cloudflare com ajax libs less js 1 2 0 less js document head appendChild s script div HELLO Hello div style file as less note hte type and rel uses less not css link rel stylesheet less type text css href styles less style type text less rel stylesheet less ColorN red div color ColorN style script src https cdn jsdelivr net npm less script div Hello div
css type text less link href URL createObjectURL myBlob document head appendChild link let s document createElement script s src https cdnjs cloudflare com ajax libs less js 1 2 0 less js document head appendChild s script div HELLO Hello div style file as less note hte type and rel uses less not css link rel stylesheet less type text css href styles less style type text less rel stylesheet less ColorN red div color ColorN style script src https cdn jsdelivr net npm less script div Hello div