K
K
Karina2014-06-30 19:47:37
css
Karina, 2014-06-30 19:47:37

How to use .less?

I watch a video about less. - The guy includes less-1.7.3.js in his html, creates a .less file and starts editing the style there; the browser works in parallel - everything works on the fly - when saving data in .less, the content changes.
It doesn't work for me - it turns out - you first need to compile .less and connect the resulting .сss to html. - But it's okay, be patient.
The problem is that the .less functions do not work for me. -

@darkRed: #B20000;
@LdarkRed: lighten (@maincolor, %30);

Where the lighten function is, there is a stable error. Compiler - SimpLESS. What could be the problem? I didn't include anything in .css.
I also don't understand why you need to include less-1.7.3.js in html when this file is not used at all.
Thanks everyone for the replies

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pavel Gogolinsky, 2014-07-01
@iKapex

Well, here are a few points
1) First, include the .less file with styles, then the less library

<link rel="stylesheet/less" href="/css/style.less">
    <script src="/js/less.js"></script>

2) Be sure to specify rel for the .less file
Everything should be fine after that

R
Roman Zhak, 2014-06-30
@romanzhak

habrahabr.ru/post/136525

K
Konstantin Kitmanov, 2014-06-30
@k12th

Then less.js is connected so that you don’t use any left compilers. Apparently, SimpLESS has an outdated version of the language, without support for this feature.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question