Skip to main content
Deno 2 is finally here 🎉️
Learn more

PostCSS Font Format Keywords PostCSS

NPM

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);
}