Skip to content

Conversation

@hugosenari
Copy link

@hugosenari hugosenari commented Mar 7, 2020

what:

I tricked it a little bit to make two steps instead of one.

Default behavior keeps working.

why:

Actual version is the best to build icon font with all icon-set, but my case has only small sub set of icons.

@font-face {
  src: url('/node_modules/third-party/library/*/*.svg');
  font-family: 'onlyMyIcons';
  font-weight: normal;
  font-style: normal;
}
plugins: [
  webfont.onlyCss({ }), // it makes icon css from your base css

  ...otherPostcssPlugins, // change your css here (ie: with purgeCSS)

  webfont.onlyFont({ fontName: 'onlyMyIcons' }) // it makes fonts only for icons left
]

Outputs (in my case) two icons selectors and font with only this two icons.

todo:

  • test it a lot;
  • update docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant