PostCSS Font Format Keywords PostCSS

deno.land License

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

❌ Deprecated

This module is deprecated and will not receive any updates anymore. Please use the following instead:

import formatKeywords from "npm:@csstools/postcss-font-format-keywords@VERSION";

Usage

import postcss from "npm:postcss";
import formatKeywords from "https://deno.land/x/postcss_font_format_keywords@4.0.2/mod.js";

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