postcss-discard-font-face

Discard font faces by type, with PostCSS.
Install
With npm do:
npm install postcss-discard-font-face --save
Example
When discarding TTF fonts:
Input
Output
API
discardFonts([filter|options])
filter
Type: function|array
Return: boolean|string
Arguments: The function is passed the URL of the font as the first argument,
and the format as the second.
For each font, return false to remove, or a new string if you would like to transform the URL.
// Remove fonts of an unknown type ;
Alternately, you can whitelist an array of types:
;
With this setting, all extensions that do not match will be removed.
options
font
Type: object
Each key in this object should correspond to a font name, which will then be
discarded if its properties do not correspond to the whitelisted properties.
For example, to only allow a font weight of 400
& a font style of normal
,
it would be configured like so:
;
Usage
See the PostCSS documentation for examples for your environment.
Contributing
Pull requests are welcome. If you add functionality, then please add unit tests to cover it.
License
MIT © Ben Briggs