Home css Connect less

Connect less

Author

Date

Category

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

  1. Downloading the script – LESSCSS.ORG
  2. 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;
    
  3. (we can write in less, but not in Chrome)

    Downloading Winless – WINLESS.ORG

  4. Install and convert our style.less & gt; style.css (In the folder
    project should have 2 files .less and .css)

  5. Add +1 line to the code:

    & lt; link rel = "stylesheet" type = "text / css" href = "style.css" & gt;
    
  6. 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.)

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions