I am using compass to manage some sass files on mac osx. I have these files:
sass/
screen.scss
partials folder/
...
_fonts.scss
_functions.scss
...
In fonts I have this rule which I would like to reuse @extend.
//fonts.scss
.icon-ab-logo, {
font-family: 'icomoon';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
}
.icon-ab-logo:before { //i want to reuse this.
content: "e000";
}
In functions I have this screen.scss:
.logo {
position: absolute;
top: 0;
bottom: 0px;
z-index: 500;
width: 9.5em;
background: $logo;
@include transition(all 0.2s);
&:after{
@include icon( ".icon-ab-logo" );
}
}
Finally in functions.scss I call this:
@mixin icon( $icon ){
font-family: 'icomoon';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
@extend #{$icon}:before; //<- this is the problem, no errors just isn't parsed.
}
Is there a way to reference .icon-ab-logo:before using a mixin? Workarounds?
Thanks for reading.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…