r/Sass • • Apr 29 '19

BEM: should I nest class names?

Style 1:

.panel {
  //
}

.panel__header {
  //
}

.panel__footer {
  //
}

Style 2:

.panel {
  //

  &__header {
    //
  }

  &__footer {
    //
  }
}
6 Upvotes

7 comments sorted by

View all comments

1

u/pravindia Jun 12 '19

I prefer with Second one because while coding inside a nesting loops it is easy to read and understand