postcss-font-family-system-ui
PostCSS plugin to transform W3C CSS generic font-family system-ui to a practical font-family list
Installation
yarn add postcss-font-family-system-ui --dev
Version
postcss | postcss-font-family-system-ui |
---|
5.x | 1.x |
6.x | 2.x |
Usage
import postcss from 'postcss'
import fontFamilySystemUI from 'postcss-font-family-system-ui'
const css = fs.readFileSync('input.css', 'utf8')
const out = postcss()
.use(fontFamilySystemUI())
.process(css)
.css
Using this input.css
:
body {
font-family: system-ui;
}
you will get:
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue;
}
Checkout tests for examples.
FAQ
Can I use require('postcss-font-family-system-ui')
?
Yes