5.1.0 • Published 2 years ago

postcss-fontstack-auto v5.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

postcss-fontstack-auto

PostCSS plugin to expand font names to web-safe stack automatically.

Originally postcss-fontstack force to use fontstack().

.some {
  font-family: Arial;
  font: 30px/20px Courier;
  /* will be unchanged */
  font-family: Arial, Roboto, sans-serif;
}

will be

.some {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font: 30px/20px "Courier New", Courier, "Lucida Sans Typewriter", "Lucida Typewriter", monospace;
  /* unchanged */
  font-family: Arial, Roboto, sans-serif;
}

Use postcss-minify-font-values for minifying.

Usage

Expand rules with your own font names and stacks.

require('postcss-fontstack-auto')({
  fontstack: [
    'YourScript': ['Arial', 'Helvetica Neue', 'Helvetica', 'sans-serif']
  ]
})

Options

fontstack Array. Key is font name. Value is Array of font names (if it have whitespace in name then it will be in double quotes).

Every word in font name should start with uppercased letter, e.g. Unique-Light Sans.

5.1.0

2 years ago

5.0.0

3 years ago

4.0.0

3 years ago

3.0.0

4 years ago

2.0.0

5 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago