0

I'm not sure why this is working.. if I put the following it works fine:

.popup--bookmark {
  background: white;
  border-radius: 10px;
  padding: 15px 35px 15px 15px;
  position: absolute;
  z-index: 999;
  left: 220px;
  top: 11px;
}

but if i try to break it up for BEM purposes like so, it doesn't work:

.popup {
  background: white;
  border-radius: 10px;
  padding: 15px 35px 15px 15px;
  position: absolute;
  z-index: 999;

  &--bookmark {
    left: 220px;
    top: 11px;
  }
}

Usage is straight forward like so:

<div className="popup--bookmark">

What am I doing wrong? According to this article it should work. Quote from the article:

// Touching the ampersand works well with modifier classes.

.btn {
  &-primary {}
  &-secondary {}
}
Compiled CSS:

.btn-primary {}
.btn-secondary {}
user1189352
  • 3,628
  • 12
  • 50
  • 90

0 Answers0