F
F
FlexibleCurd2015-11-24 19:16:43
css
FlexibleCurd, 2015-11-24 19:16:43

Do I understand the Less principle correctly?

Hello.
less because it completely uses the css syntax, it just adds its chips like variables?,
That is, I can easily take a file, for example. bootstrap.css, change the extension from .css to .less and it will be a full-fledged less file, which, when compiled, will again become the same as before bootstrap.css and no information will be lost?
P/S.
Why am I asking?: There are different .css files (the same bootstrap) and you need to optimize it somehow.
That is, I decided to rename all .css files to .less and use the import command to import them into one main .less file.
So when compiling this one main .less , it will compile all .css (.css files that I renamed to .less) into one file.
To make it even clearer, here is the main .less file:

@import "var.less";
@import "mixins.less";
@import "grid.less";
@import "fonts.less";

/* some less code... */
.h-top-panel {
  background-color: @dark_blue;
  border-bottom: 6px solid #323746;
  .h-tp-wrap {
    height: 89px;
  }
}
/* some less code... */

@import "media.less";

Answer the question

In order to leave comments, you need to log in

2 answer(s)
_
_ _, 2015-11-24
@AMar4enko

That's right, just like with SASS
PS, you can import css without renaming.
If you are already importing bootstrap styles, then you can immediately import their original less - you can change the variables.

A
Alexander Taratin, 2015-11-24
@Taraflex

As already mentioned here you can take less sorts
https://github.com/twbs/bootstrap/tree/master/less

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question