Specify font formats as keywords in CSS — ❌ Deprecated: use `@csstools/postcss-font-format-keywords` instead
Repository
Current version released
a year ago
PostCSS Font Format Keywords
This PostCSS plugin lets you specify font formats as keywords, following the CSS Fonts specification.
@font-face {
src: url(file.woff2) format(woff2);
}
/* becomes */
@font-face {
src: url(file.woff2) format("woff2");
}
Important
❌ Deprecated
This module is deprecated and will not receive any updates anymore. Please use @csstools/postcss-font-format-keywords instead.
npm install @csstools/postcss-font-format-keywords
Install
npm install postcss-font-format-keywords
Usage
import postcss from 'postcss';
import formatKeywords from 'postcss-font-format-keywords';
// OR
const postcss = require('postcss');
const formatKeywords = require('postcss-font-format-keywords');
await postcss([formatKeywords]).process(YOUR_CSS);
Options
preserve: true
Keep the original CSS declaration alongside the transformed one.
@font-face {
src: url(file.woff2) format("woff2");
src: url(file.woff2) format(woff2);
}