Skip to content

pantoken / plugins/postcss/flatten-property/src / flattenProperty

Varyab: flattenProperty

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

Beta

Kreye plugin PostCSS flatten-@property.

Li pase sou tout @property at-rules nan stylesheet la, ekstrè chak deskriptè initial-value, retire at-rule la, epi mete an tèt yon sèl règ injectSelector { --name: value; … } ki genyen tout deklarasyon yo ekstrè yo. Règ vid ak blòk @layer ki rete apre retire yo ap efase.

Type Declaration

Paramèt

options?

FlattenPropertyOptions

FlattenPropertyOptions.

Retounen

Plugin

Yon PostCSS Plugin.

postcss

postcss: true

Makè plugin PostCSS ki obligatwa.

Egzanp

Enjeksyon pa default nan :root

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

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

Enjekte nan :scope (pou itilize andedan blòk scope yo)

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