FontCustom / fontcustom

Generate custom icon webfonts from the comfort of the command line.
3.28k stars 423 forks source link

scss file: add % placeholder for @extend #269

Open di5abled opened 9 years ago

di5abled commented 9 years ago

hy,

I wonder if it would be possible for you to add % placeholders in your generated sass and scss files.

I have use cases where I want to use the icon fonts on custom elements. Currently I am working like this:

.share-facebook {
    @extend .icon;

    &:before {
        @extend .icon--facebook:before;
    }
}

but it would be really nice if I could also use the % to extend your generated classes like this:

.share-facebook {
    @extend %icon;

    &:before {
        @extend %icon--facebook;
    }
}
renaudleo commented 9 years ago

Since version 1.3.4, you can do this using the css_selector option in your config file.

I guess something like css_selector: %icon--{{glyph}} would work. Not that you won't be able to use theses classes directly in your HTML after that. But it seems to me it's the point of using placeholder selectors with %.