user2572561
user2572561

Reputation: 117

Accessing One level up of Parent in SASS

I have a code like

.portlet {  
    .portlet-body {
        .microsites {
            .portlet-body {
            }
        }
    }
}

How can I remove repetition of .portlet-body using SASS? I read about & but that isn't helping me. Does anyone have a solution?

Upvotes: 3

Views: 1795

Answers (1)

fernandopasik
fernandopasik

Reputation: 10473

This could be a solution:

.portlet-body {
  .portlet & {
  }
  .microsites & {
  }
}

Upvotes: 3

Related Questions