M
M
Maxim Ivanov2021-03-02 15:40:02
css
Maxim Ivanov, 2021-03-02 15:40:02

How are nested elements usually written in scss?

That is, how do they usually indent? So:

.header {
  display: flex;
  align-items: center;
  .menu-items {
    display: flex;
  }
}

Or like this (with tabs):

.header {
  display: flex;
  align-items: center;
    .menu-items {
      display: flex;
    }
}

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Stefan, 2021-03-02
@MEDIOFF

As it is more convenient for you, you can do without indents at all, but with tabs, as for me, it’s more readable

A
Alexander Lamdan, 2021-03-02
@alexander_lamdan

The second option is more correct for future developers and for you to make it more convenient for you to write.
Again, no one forces you to write as you need, write as you decide for yourself.
Personally, I do both the first and second options, depending on the case.

M
Mirzhalol Mirkhomitov, 2021-03-02
@Mirami97

.header {
  display: flex;
  align-items: center;

  .menu-items {
    display: flex;
  }
}

I offer this option.

S
Sergey delphinpro, 2021-03-02
@delphinpro

https://www.linux.org.ru/forum/development/2701660
https://softwareengineering.stackexchange.com/ques...
https://tonsky.livejournal.com/267454.html
https://dev. to/__shadz_/tabs-vs-space-49l5
https://yandex.ru/search/?text=Tab%20VS%20Space

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question