want to connect less
@ color: #ccc;
body {
background: @color;
}
Answer 1, authority 100%
In general, the order should be different – first we include the script, and then the less.
The link in the comments is the same.
In general, try some local compiler. Like the WinLess program.
Here on the adored webref there is an article about her – https://webref.ru/layout/less/ compile / winless
Answer 2, authority 100%
LESS just doesn’t connect like standard CSS
- Downloading the script – LESSCSS.ORG
-
We connect it to HTML – two lines of code:
& lt; link rel = "stylesheet / less" type = "text / css" href = "style.less" & gt; & lt; script src = "less.min.js" type = "text / javascript" & gt; & lt; / script & gt;
-
(we can write in less, but not in Chrome)
Downloading Winless – WINLESS.ORG
-
Install and convert our style.less & gt; style.css (In the folder
project should have 2 files .less and .css) -
Add +1 line to the code:
& lt; link rel = "stylesheet" type = "text / css" href = "style.css" & gt;
-
Result:
& lt; link rel = "stylesheet" type = "text / css" href = "style.css" & gt; & lt; link rel = "stylesheet / less" type = "text / css" href = "style.less" & gt; & lt; script src = "less.min.js" type = "text / javascript" & gt; & lt; / script & gt;
And works in Chrome! (if it is difficult to explain: google, habrim, toast, etc.)