You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
# postcss-minify-font-values [![Build Status][ci-img]][ci]
> Minify font declarations with PostCSS.
This module will try to minimise the `font-family`, `font-weight` and `font` shorthandproperties; it can unquote font families where necessary, detect & removeduplicates, and cut short a declaration after it finds a keyword. For moreexamples, see the [tests](test).
```cssh1 { font:bold 2.2rem/.9 "Open Sans Condensed", sans-serif;}
p { font-family: "Helvetica Neue", Arial, sans-serif, Helvetica; font-weight: normal;}```
```cssh1 { font:700 2.2rem/.9 Open Sans Condensed,sans-serif}
p { font-family: Helvetica Neue,Arial,sans-serif; font-weight: 400;}```
## API
### minifyFontValues([options])
#### options
##### removeAfterKeyword
Type: `boolean`Default: `false`
Pass `true` to remove font families after the module encounters a font keyword,for example `sans-serif`.
##### removeDuplicates
Type: `boolean`Default: `true`
Pass `false` to disable the module from removing duplicated font families.
##### removeQuotes
Type: `boolean`Default: `true`
Pass `false` to disable the module from removing quotes from font families.Note that oftentimes, this is a *safe optimisation* & is done safely. For moredetails, see [Mathias Bynens' article][mathias].
## Usage
```jspostcss([ require('postcss-minify-font-values') ])```
See [PostCSS] docs for examples for your environment.
## Contributors
See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
# License
MIT © [Bogdan Chadkin](mailto:trysound@yandex.ru)
[mathias]: https://mathiasbynens.be/notes/unquoted-font-family[PostCSS]: https://github.com/postcss/postcss[ci-img]: https://travis-ci.org/cssnano/postcss-minify-font-values.svg[ci]: https://travis-ci.org/cssnano/postcss-minify-font-values
|