M
M
monochromer2014-09-15 07:37:20
css
monochromer, 2014-09-15 07:37:20

How to do formatted output in LESS like SASS?

How can you control the output format in LESS?
for example, in the source there is

.b-header {
  overflow: hidden;
  
  &__logo {
    float: left;
  }
  
  &__menu {
    float: right;
  }
}

need to get
.b-header {
    overflow: hidden;
}
    .b-header__logo {
        float: left;
    }
    .b-header__menu {
        float: right; 
    }

That is, it is desirable to keep the structure with indented nested blocks.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maksim Zverev, 2014-09-15
@m1skam

My personal opinion: the output should be something like this:
And the source map is responsible for debugging

V
Vladislav Soprun, 2014-09-15
@soprun

I have everything in one line (compression) ...
Beauty should be admired in less itself, and css should be optimized for users (that is, it weighs as little as possible)

A
Alexander Tartmin, 2014-09-15
@baskerville42

By and large, the sorts should be readable, and not what the output is. In production, as noted above, the code must be compressed to speed up the download of the file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question