SASS Optimize Font Awesome for Classes Used Only

Is it possible to make SASS just adding code for the used icons? Since this will reduce the size of the CSS file,

I saw a http://fontello.com/ solution on a similar issue, but I wanted to use to find out if there is a way to do this with font awesome,

Edit: since there was some kind of misinterpretation, I want to clarify what I want to know: Is it possible to tell SASS which icons it should compile?

+4
source share
2 answers

How to tell FA what to compile

Using SCSS (formal SASS CSS syntax)

  • Download and extract font-awesome-4.x.zip
  • ./scss
  • _icons.scss

:

.#{$fa-css-prefix}-times:before { content: $fa-var-times; }
.#{$fa-css-prefix}-search-plus:before { content: $fa-var-search-plus; }
.#{$fa-css-prefix}-search-minus:before { content: $fa-var-search-minus; }
.#{$fa-css-prefix}-power-off:before { content: $fa-var-power-off; }
.#{$fa-css-prefix}-signal:before { content: $fa-var-signal; }
.#{$fa-css-prefix}-gear:before,

. , .

  1. ./font-awesome.scss ../css - .
0

https://github.com/FortAwesome/Font-Awesome

:

import "variables";
import "mixins";
import "path";
import "core";
import "larger";
import "fixed-width";
import "list";
import "bordered-pulled";
import "animated";
import "rotated-flipped";
import "stacked";
import "icons";

_icons.scss, SASS .

. # {$ fa-css-prefix} -glass: before {content: $ fa-var-glass; }

:

 mixin icon-glass () {
    . # {$ fa-css-prefix} -glass: before {content: $ fa-var-glass; }
}

mixinx :

@include icon-glass();

/

import "larger";
import "fixed-width";
import "list";
import "bordered-pulled";
import "animated";
import "rotated-flipped";

.

-1

All Articles