SASS: hierarchy structure

0 votes
128 views
added Aug 22, 2017 in SCSS by LC Marshal Captain (25,770 points)
// Instead of
.btn {
  color: red;
}

.btn-min, .btn-min--grey-border {
  color: pink;
}

.btn-min--grey {
border: 1px solid grey;
}

// do this
.btn {
 color: red;
 &-min {
  color: pink;
  &--grey-border {
    border: 1px solid grey;
  }
 }
}

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...