📜 ⬆️ ⬇️

LESS? - opinion of the layman-maker-up or designer with the experience

Greetings to all! My name is Sergey, I live in Samara, I am 37 and I am bearded, but only when the power of creation defeats all other physiological processes in me ... Today I will share with you my experience of the practical use of LESS. What can we say, LESS is fashionable and, as you know, in the IT environment it is used by all and sundry ... sometimes even contrary to common sense.

What is LESS? Less - language! But is it a language? In the words of the layman-maker-up: write some code, compile it, and at the output we get all the same CSS .
... and then for some reason I immediately remembered the expression of fellow programmer Fedi, with whom we jokingly experience each other’s worldviews. So, he said: "Down with ryushechki! Forward functionality! ”It is clear that for a designer these words are simply“ a knife to the heart. ”

But we were a little distracted and, in general, this is not the point .

So, Less.

Less extends CSS because it allows you to set variables, mixes, etc.
- So?
Well, that is, everyone now agreed with me?
... and I hear the millionth chorus.
But in fact, the solution has disadvantages.
')
image

Many supporters of the language say, for example, about such use.

Example:

Less

Set the color variable:

@base_color: #ccc; 


Then use it in the elements:

 p { color: @base_color; } span { background-color: @base_color; } 


From the point of view of the supporters of the language, this is convenient: to change the color of all the elements — changed the color in one place — that's all.

From my point of view, it’s very controversial:


It would seem pros?

This is where the pluses really are (as I initially thought) is in the mixing, when a huge number of parameters are set in one variable (for example, vendor properties a la
 -webkit-border-radius 
...), and then this variable is turned on and mixed into the elements used — the code is greatly reduced.

But let me ask you a question: why shorten the code when it compiles all the same, is expanded and deployed to a parsed CSS state? In fact, we get some kind of layer (sometimes consisting of multiple files) for which it is unclear, which slows down the search for a parameter, and does not affect the final form of the code.

Less can be really effective if a year or two does a general refactoring of the code, then yes — it probably makes sense ... But even then, at first glance, the real advantages are, in actual fact, just a fiction and a waste of precious time ... Ask why?
Answer: because it is not a full-fledged language and at the output we get all the same cumbersome CSS constructs. That is, no matter how we try to reduce or optimize, we optimize only the interlayer.

Maybe Less in general - a marketing ploy, a fashion trend, a kind of conspiracy to promote a language - I often hear from programmers ( some programmers ) that using less is a banal project sharpening for programmatic abstract thinking. Although how programmer abstract thinking differs from general abstract thinking or the better it is from the abstract thinking of the coder / designer - a great mystery covered in darkness .

How now I designate for myself LESS
- A tool designed to facilitate the work of the programmer, if he does not know how to typeset. For the coder, this is tantamount to: as for a runner to wear galoshes instead of sneakers, nothing constantly flies, but it’s not wet.

Everything stated above is just my opinion, it is not intended to somehow interfere in the process of developing fans of their business.
I just wanted to share my designer everyday life, I hope, I was not tired.

Source: https://habr.com/ru/post/233467/


All Articles