@weapp-tailwindcss/postcss 2.2.1-next.5 → 3.0.0-next.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compat/mini-program-css/at-rules.d.ts +7 -0
- package/dist/compat/mini-program-css/color-gamut.d.ts +3 -0
- package/dist/compat/mini-program-css/finalize.d.ts +12 -0
- package/dist/compat/mini-program-css/index.d.ts +3 -0
- package/dist/compat/mini-program-css/predicates.d.ts +10 -0
- package/dist/compat/mini-program-css/prune-generated.d.ts +8 -0
- package/dist/compat/mini-program-css/root-cleanups.d.ts +5 -0
- package/dist/compat/mini-program-css/selectors.d.ts +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +800 -3
- package/dist/index.mjs +783 -5
- package/dist/plugins/getUnitConversionPlugin.d.ts +5 -0
- package/dist/plugins/post/decl-dedupe.d.ts +1 -0
- package/dist/types.d.ts +16 -1
- package/package.json +5 -5
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import postcss from 'postcss';
|
|
2
|
+
export declare function removeUnsupportedMiniProgramAtRules(css: string): string;
|
|
3
|
+
export declare function removeUnsupportedAtSupports(css: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* 移除小程序不支持的 cascade layer 语法,同时保留 layer 内的实际规则。
|
|
6
|
+
*/
|
|
7
|
+
export declare function removeUnsupportedCascadeLayers(root: postcss.Root): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CssPreflightOptions } from '../../types';
|
|
2
|
+
import postcss from 'postcss';
|
|
3
|
+
export interface FinalizeMiniProgramCssOptions {
|
|
4
|
+
cssPreflight?: CssPreflightOptions | undefined;
|
|
5
|
+
preservePseudoContentInit?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function collectPreflightRules(root: postcss.Root, options?: {
|
|
8
|
+
preservePseudoContentInit?: boolean;
|
|
9
|
+
}): postcss.Rule[];
|
|
10
|
+
export declare function insertHoistedRules(root: postcss.Root, rules: postcss.Rule[], anchor?: postcss.Comment): void;
|
|
11
|
+
export declare function hoistTailwindPreflightBase(css: string): string;
|
|
12
|
+
export declare function finalizeMiniProgramCss(css: string, options?: FinalizeMiniProgramCssOptions): string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { removeUnsupportedAtSupports, removeUnsupportedCascadeLayers, removeUnsupportedMiniProgramAtRules, } from './at-rules';
|
|
2
|
+
export { finalizeMiniProgramCss, type FinalizeMiniProgramCssOptions, hoistTailwindPreflightBase, } from './finalize';
|
|
3
|
+
export { pruneMiniProgramGeneratedCss, type PruneMiniProgramGeneratedCssOptions, } from './prune-generated';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type postcss from 'postcss';
|
|
2
|
+
export declare const PREFLIGHT_RESET_PROPS: Set<string>;
|
|
3
|
+
export declare function hasTailwindPreflightDeclaration(rule: postcss.Rule): boolean;
|
|
4
|
+
export declare function hasTwContentDeclaration(rule: postcss.Rule): boolean;
|
|
5
|
+
export declare function isCustomPropertyRule(rule: postcss.Rule): boolean;
|
|
6
|
+
export declare function isEmptyTwContentDeclaration(decl: postcss.Declaration): boolean;
|
|
7
|
+
export declare function isPseudoContentInitRule(rule: postcss.Rule): boolean;
|
|
8
|
+
export declare function usesTwContentVariable(root: postcss.Root): boolean;
|
|
9
|
+
export declare function isMiniProgramPreflightRule(node: postcss.Node): node is postcss.Rule;
|
|
10
|
+
export declare function isMiniProgramThemeVariableRule(node: postcss.Node): node is postcss.Rule;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface PruneMiniProgramGeneratedCssOptions {
|
|
2
|
+
preservePreflight?: boolean;
|
|
3
|
+
preserveConditionalComments?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* 裁剪 Tailwind 生成 CSS 中面向浏览器的 classless 规则。
|
|
7
|
+
*/
|
|
8
|
+
export declare function pruneMiniProgramGeneratedCss(css: string, options?: PruneMiniProgramGeneratedCssOptions): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type postcss from 'postcss';
|
|
2
|
+
export declare function removeSpecificityPlaceholders(root: postcss.Root): void;
|
|
3
|
+
export declare function removeUnsupportedBrowserSelectors(root: postcss.Root): void;
|
|
4
|
+
export declare function removeDisplayP3Declarations(root: postcss.Root): void;
|
|
5
|
+
export declare function removeUnsupportedModernColorDeclarations(root: postcss.Root): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type postcss from 'postcss';
|
|
2
|
+
export declare const MINI_PROGRAM_THEME_SCOPE_SELECTOR = ":host,page,.tw-root,wx-root-portal-content";
|
|
3
|
+
export declare const MINI_PROGRAM_PREFLIGHT_SELECTORS: Set<string>;
|
|
4
|
+
export declare const MINI_PROGRAM_THEME_SCOPE_SELECTORS: Set<string>;
|
|
5
|
+
export declare const SPECIFICITY_PLACEHOLDER_SUFFIXES: string[];
|
|
6
|
+
export declare function normalizeSelector(selector: string): string;
|
|
7
|
+
export declare function getRuleSelectors(rule: postcss.Rule): string[];
|
|
8
|
+
export declare function isUnsupportedBrowserSelector(selector: string): boolean;
|
|
9
|
+
export declare function isMiniProgramPreflightSelector(selectors: string[]): boolean;
|
|
10
|
+
export declare function isMiniProgramThemeScopeSelector(selectors: string[]): boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { type DynamicColorMixAlphaProtection, type DynamicColorMixAlphaProtectionOptions, type ModernColorValueNormalization, normalizeModernColorValue, protectDynamicColorMixAlpha, } from './compat/color-mix';
|
|
2
|
+
export { finalizeMiniProgramCss, hoistTailwindPreflightBase, pruneMiniProgramGeneratedCss, removeUnsupportedAtSupports, removeUnsupportedCascadeLayers, removeUnsupportedMiniProgramAtRules, } from './compat/mini-program-css';
|
|
2
3
|
export { normalizeMiniProgramPrefixedDeclaration, removeUnsupportedMiniProgramPrefixedAtRule, } from './compat/mini-program-prefixes';
|
|
3
4
|
export * from './handler';
|
|
4
5
|
export { default as postcssHtmlTransform, type IOptions as PostcssHtmlTransformOptions } from './html-transform';
|
|
@@ -7,3 +8,4 @@ export { createFallbackPlaceholderReplacer } from './plugins/post/specificity-cl
|
|
|
7
8
|
export { createInjectPreflight } from './preflight';
|
|
8
9
|
export { internalCssSelectorReplacer } from './shared';
|
|
9
10
|
export * from './types';
|
|
11
|
+
export { composeRules as unitConversionComposeRules, presets as unitConversionPresets, } from 'postcss-rule-unit-converter';
|