Skip to content

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

Athróg: flattenProperty

const flattenProperty: {(options?): Plugin; postcss: true; }

Béite

Cruthaigh an breiseán PostCSS flatten-@property.

Ritheann sé trí gach at-rule @property sa stíleáil, aistarraingíonn sé gach tuairisc initial-value, baintear an at-rule, agus cuirtear riail amháin injectSelector { --name: value; … } i bhforchéann a chuimsíonn na ráitis uile a aistarraingíodh. Baintear rialacha folmha agus bloic @layer a fhágtar tar éis an bhaint.

Type Declaration

Paraiméadair

options?

FlattenPropertyOptions

FlattenPropertyOptions.

Tuairisceáin

Plugin

Breiseán PostCSS Plugin.

postcss

postcss: true

Marcóir riachtanach do bhreiseán PostCSS.

Samplaí

Ionchur réamhshocraithe isteach i :root

ts
import postcss from "postcss";
import { flattenProperty } from "@pantoken/plugin-flatten-property";

const out = postcss([flattenProperty()]).process(css, { from: undefined }).css;

Ionchur isteach i :scope (le húsáid laistigh de bhlocaí :scope)

ts
import postcss from "postcss";
import { flattenProperty } from "@pantoken/plugin-flatten-property";

const out = postcss([flattenProperty({ injectSelector: ":scope" })]).process(css, { from: undefined }).css;
ts
Preserve