Placeholder recursion?

21 views
Skip to first unread message

Andrea Maria Piana

unread,
Feb 15, 2016, 1:07:05 PM2/15/16
to Sass
Hi, 

I would like your help to clarify something.

We are using BEM & scss and I have come accross something like (oversimplified):


%some-class {
   font
-size: 14px;
   
&--active {
     
@include %some-class;
   
}
}


.some-other-class {
 
@include %some-class;
}




The compiled css would be:


.some-other-class {
   font
-size: 14px;
}


.some-other-class--active {
  font
-size: 14px;
}






To my untrained eye it looks like recursion and I was surprised it compiled. 

I tried to google but could not find much on the topic.

Is this a common pattern? Am I missing something?

Thank you

Andrea
Reply all
Reply to author
Forward
0 new messages