K
K
KurtsKhalia2015-01-18 15:57:32
css
KurtsKhalia, 2015-01-18 15:57:32

What is Less and Sass?

I’m slowly moving from design to the front-end, my experience with css and html is quite large, but while reading literature and articles I began to come across less and sass (I understand that this is also called scss).
In most articles about these metalanguages, it is written that this is just a super-simplifying technology brought from Mars for the scientific and technological revolution on Earth.
Please explain in a simple way why they are needed, that is, at least one example, because of which a person wants to stop writing css, and start "living".
And also, is there an advantage for a person who knows them over an ignorant one. That is, in fact, the same css code is obtained from less and sass. That is, I can write with normal css the same thing as the great guru with less/sass? And what then is the global use of these lass / sass?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
Sergey, 2015-01-18
@KurtsKhalia

Laziness is the engine of progress. A good example is the DRY - Don't repeat yourself principle. I highly suspect that you are trying to follow this principle when you make layouts or whatever you do there. I am also quite sure that you at least tried to automate the routine of your daily work a little. Also, you could have situations when you reused some elements. You never know.
So... CSS is a dumb style sheet. Selector and styles, you can’t think of anything super smart here. About 5-10 years ago, it was quite fashionable to keep one mega-bold CSS file for 10K+ lines and enjoy life making more and more changes, etc. Accordingly, even if you follow all the rules of modular layout and all that, you have several problems:
There is also a good rule, or an idea if you like.... If the code can be generated, it is better to generate it. That is, to solve all the above problems, preprocessors were invented. They seemed to have been before all these scss / less / stylus, but somehow they did not solve all the problems, etc. What was eventually proposed (I list in the same order as in the list above).
What eventually happened. At one point, some ruby ​​people came up with SCSS (they generally don’t like everything that is not in the ruby ​​style in terms of minimalism and expressiveness). Then the dudes thought about it and said, SCSS is cool but for some reason they use a syntax that is familiar to Ruby developers and not the usual CSS constructs. As a result, LESS was implemented, and it was already implemented in javascript, which, with the presence of node.js, made it possible to collect all this stuff on one more platform. And since under this platform preprocessors were already fruiting, it successfully fit in.
Further, there were already some further modifications, like the same Stylus, where the syntax was simply simplified to the point of impossible.
Personal opinion. Today, I see no reason to use pure CSS, even on small or large projects. Here, none at all.

E
Ekaterina Sava, 2015-01-18
@EkaterinaSava

At HTML Academy there is a course htmlacademy.ru/courses/85 after which it becomes absolutely clear what preprocessors are, why they are needed and how to use them. The rest is very easy to google.

V
Vitaly Bobrov, 2015-01-19
@bobrov1989

I think it's too early for you to bother with the issue of preprocessing - first, master css itself

H
htmleater, 2015-01-18
@htmleater

I once had this issue myself. I didn't find any benefits for the writing style other than a headache in the ass.
For quite a long time, I found out one "advantage" - it is clearer to the developer.
Although I did not succeed in simulating a situation where a developer needs to delve into my style.

M
Mikhail Osher, 2015-01-18
@miraage

css preprocessors.
Write less, do more.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question