Skip to content

pantoken / plugins/postcss/props-minify/src / applyMinify

Function: applyMinify()

applyMinify(css, options?): string

Beta

Apply custom-property minification transforms to a stylesheet string.

Builds a PostCSS plugin array from options and runs it synchronously. Plugin order: pruneCustomPropsflattenPropertymangleCustomProps. Returns the input unchanged when no options are set.

Parameters

css

string

The stylesheet string to transform.

options?

PropsMinifyOptions = {}

PropsMinifyOptions.

Returns

string

The transformed CSS string.

Example

ts
import { applyMinify } from "@pantoken/plugin-props-minify";
const out = applyMinify(css, { prune: true, flatten: true, mangle: true });