I've got a slight issue and searching hasn't yielded any results as of yet. But it is something that keeps appearing.
I'm using SASS pre to work with the @at-root root so that I can do BEM CSS syntax.
I've got the following SCSS:
.cc_sidebar,.cc_popup{
.btn{
display: inline-block;
cursor: pointer;
@at-root{
#{&}--icon{
width: 25px;
}
}
}
}
The expected output of the icon modifier class is:
.cc_sidebar .btn--icon,cc_popup .btn--icon{width: 25px;}
But instead I'm getting:
.cc_sidebar .btn, .cc_popup .btn--icon{width: 25px;}
The --icon isn't being applied to the first parent selector. Should it be? Or am I not understanding the full workings of the @at-root?
Any ideas or feedback would be greatly appreciated.
And yes, the whole thing does have to be wrapped with the two parent selectors.