M
M
MoffunW2020-12-20 03:58:21
css
MoffunW, 2020-12-20 03:58:21

Why does the ampersand in SCSS have a smaller specification?

The first option fires and overwrites the value of .promo_wrapper
5fdea0d8559b2883752075.jpeg
&__wrapper does not overwrite the value
5fdea0e078e32228703748.jpeg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
RAX7, 2020-12-20
@MoffunW

Because the first option compiles to:

.promo .promo__wrapper {
  text-align: center;
}

and the second in:
.promo__wrapper {
  text-align: center;
}

css.yoksel.ru/specifity

A
Anton Polyakov, 2020-12-20
@CIDBerlin

In SCSS, it is possible to write media directly inside the class. Try it, it's much more convenient

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question