Skip to content

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

متغير: flattenProperty

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

بيتا

إنشاء إضافة PostCSS flatten-@property.

يتجوّل في جميع at-rules من نوع @property في ملف الأنماط، يستخرج كل واصف initial-value، يُزيل الـ at-rule، ويُقدّم قاعدة واحدة من نوع injectSelector { --name: value; … } تحتوي على كل الإعلانات المُستخرَجة. تُحذف القواعد الفارغة وكتل @layer المتبقية بعد الإزالة.

Type Declaration

المعلمات

options?

FlattenPropertyOptions

FlattenPropertyOptions.

القيم المرجعة

Plugin

إضافة PostCSS Plugin.

postcss

postcss: true

علامة مكوّن PostCSS المطلوبة.

أمثلة

الحقن الافتراضي في :root

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

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

الحقن في :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