postcss-font-family-switch

0.0.1 • Public • Published

PostCSS Font Family Switch

PostCSS plugin that append font-family when font-size value is larger than target value.

Input:

.foo {
  font-size: 12px;
}

.bar {
  font-size: 16px;
}

Output:

.foo {
  font-size: 12px;
}

.bar {
  font-size: 16px;
  font-family: YourLargeFontFamily;
}

Usage

Step 1: Check you project for existed PostCSS config: postcss.config.js in the project root, "postcss" section in package.json or postcss in bundle config.

If you do not use PostCSS, add it according to official docs and set this plugin in settings.

Step 2: Add the plugin to plugins list:

module.exports = {
  plugins: [
+   require('postcss-font-family-switch', { largeFamily: 'LargeFont' }),
    require('autoprefixer')
  ]
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    0

Package Sidebar

Install

npm i postcss-font-family-switch

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

4.42 kB

Total Files

5

Last publish

Collaborators

  • krutoo