Skip to content

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

Newidyn: flattenProperty

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

Bêta

Creu'r ategyn PostCSS flatten-@property.

Croesir pob rheol-@ @property yn y ddalen arddull, tynnir pob disgrifiadur initial-value, caiff y rheol-@ ei dileu, ac ychwanegir rheol injectSelector { --name: value; … } sengl ar y dechrau sy'n cynnwys pob datganiad a echdynnwyd. Caiff rheolau gwag a blociau @layer a adawyd ar ôl y tynnu eu gollwng.

Type Declaration

Paramedrau

options?

FlattenPropertyOptions

FlattenPropertyOptions.

Yn dychwelyd

Plugin

Ategyn PostCSS Ategyn.

postcss

postcss: true

Marciwr ategyn PostCSS a benodir.

Enghreifftiau

Mewnosodiad diofyn i :root

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

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

Mewnosod i :scope (i'w ddefnyddio o fewn blociau 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