Socket
Socket
Sign inDemoInstall

postcss-font-family

Package Overview
Dependencies
13
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    postcss-font-family

Normalize font family declarations with PostCSS.


Version published
Weekly downloads
5.6K
decreased by-2.64%
Maintainers
2
Install size
1.43 MB
Created
Weekly downloads
 

Readme

Source

postcss-font-family Build Status NPM version Dependency Status

Normalize font family declarations with PostCSS.

Install

With npm do:

npm install postcss-font-family --save

Example

This module will try to minimise the font-family and font shorthand properties; it can unquote font families where necessary, detect & remove duplicates, and cut short a declaration after it finds a keyword. For more examples, see the tests.

Input

h1 {
    font-family: "Helvetica Neue", Arial, sans-serif, Helvetica;
}

Output

h1 {
    font-family: Helvetica Neue,Arial,sans-serif;
}

API

fontFamily([options])

options
removeAfterKeyword

Type: boolean Default: true

Pass false to disable the module from removing font families after it 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 more details, see Mathias Bynens' article.

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

Keywords

FAQs

Last updated on 04 Sep 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc