@weapp-tailwindcss/postcss 2.2.1-next.4 → 3.0.0-next.10

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.
@@ -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,3 @@
1
+ import type postcss from 'postcss';
2
+ export declare function isDisplayP3MediaRule(atRule: postcss.AtRule): boolean;
3
+ export declare function isDisplayP3Declaration(decl: postcss.Declaration): boolean;
@@ -0,0 +1,13 @@
1
+ import type { CssPreflightOptions } from '../../types';
2
+ import postcss from 'postcss';
3
+ export interface FinalizeMiniProgramCssOptions {
4
+ cssPreflight?: CssPreflightOptions | undefined;
5
+ preservePseudoContentInit?: boolean;
6
+ isTailwindcssV4?: boolean | undefined;
7
+ }
8
+ export declare function collectPreflightRules(root: postcss.Root, options?: {
9
+ preservePseudoContentInit?: boolean;
10
+ }): postcss.Rule[];
11
+ export declare function insertHoistedRules(root: postcss.Root, rules: postcss.Rule[], anchor?: postcss.Comment): void;
12
+ export declare function hoistTailwindPreflightBase(css: string): string;
13
+ 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,13 @@
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_ELEMENT_SCOPE_SELECTOR = "view,text,:after,:before";
4
+ export declare const MINI_PROGRAM_ELEMENT_SCOPE_SELECTORS: Set<string>;
5
+ export declare const MINI_PROGRAM_PREFLIGHT_SELECTORS: Set<string>;
6
+ export declare const MINI_PROGRAM_THEME_SCOPE_SELECTORS: Set<string>;
7
+ export declare const SPECIFICITY_PLACEHOLDER_SUFFIXES: string[];
8
+ export declare function normalizeSelector(selector: string): string;
9
+ export declare function getRuleSelectors(rule: postcss.Rule): string[];
10
+ export declare function getSortedRuleSelectorKey(rule: postcss.Rule): string;
11
+ export declare function isUnsupportedBrowserSelector(selector: string): boolean;
12
+ export declare function isMiniProgramPreflightSelector(selectors: string[]): boolean;
13
+ export declare function isMiniProgramThemeScopeSelector(selectors: string[]): boolean;
@@ -0,0 +1,6 @@
1
+ import type { AtRule, Declaration } from 'postcss';
2
+ /**
3
+ * 收敛小程序 CSS 中的 WebKit 前缀,只保留 WXSS 里有实际价值的兼容写法。
4
+ */
5
+ export declare function normalizeMiniProgramPrefixedDeclaration(decl: Declaration): void;
6
+ export declare function removeUnsupportedMiniProgramPrefixedAtRule(atRule: AtRule): void;
@@ -1,13 +1,14 @@
1
- import type { AtRule, Root, Rule } from 'postcss';
1
+ import type { AtRule, Declaration as PostcssDeclaration, Root, Rule } from 'postcss';
2
2
  import { Declaration } from 'postcss';
3
3
  export declare function isTailwindcssV4(options?: {
4
4
  majorVersion?: number;
5
5
  }): boolean;
6
6
  export declare function testIfRootHostForV4(node: Rule): boolean;
7
- export declare const cssVarsV4Nodes: Declaration[];
7
+ export declare const cssVarsV4Nodes: PostcssDeclaration[];
8
8
  export declare function collectUsedTailwindcssV4Variables(root: Root): Set<string>;
9
9
  export declare function usesTailwindcssV4ContentVariable(root: Root): boolean;
10
- export declare function createUsedCssVarsV4Nodes(usedProps: ReadonlySet<string>): Declaration[];
10
+ export declare function createUsedCssVarsV4Nodes(usedProps: ReadonlySet<string>): PostcssDeclaration[];
11
+ export declare function createMissingCssVarsV4Nodes(root: Root, usedProps: ReadonlySet<string>): PostcssDeclaration[];
11
12
  export declare function isTailwindcssV4ModernCheck(atRule: AtRule): boolean;
12
13
  export declare function isTailwindcssV4LinearGradientSupports(atRule: AtRule): boolean;
13
14
  export declare function isTailwindcssV4DisplayP3Supports(atRule: AtRule): boolean;
@@ -5,6 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
8
9
  var __copyProps = (to, from, except, desc) => {
9
10
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
11
  key = keys[i];
@@ -211,6 +212,12 @@ const postcssHtmlTransform = (opts = {}) => {
211
212
  };
212
213
  postcssHtmlTransform.postcss = true;
213
214
  //#endregion
215
+ Object.defineProperty(exports, "__commonJSMin", {
216
+ enumerable: true,
217
+ get: function() {
218
+ return __commonJSMin;
219
+ }
220
+ });
214
221
  Object.defineProperty(exports, "__toESM", {
215
222
  enumerable: true,
216
223
  get: function() {
@@ -1,2 +1,2 @@
1
- const require_html_transform = require("./html-transform-DuSRw6IH.js");
1
+ const require_html_transform = require("./html-transform-Dgak7hXa.js");
2
2
  module.exports = require_html_transform.postcssHtmlTransform;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
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';
3
+ export { normalizeMiniProgramPrefixedDeclaration, removeUnsupportedMiniProgramPrefixedAtRule, } from './compat/mini-program-prefixes';
2
4
  export * from './handler';
3
5
  export { default as postcssHtmlTransform, type IOptions as PostcssHtmlTransformOptions } from './html-transform';
4
6
  export { createStylePipeline, type PipelineNodeContext, type PipelineNodeCursor, type PipelineStage, type ResolvedPipelineNode, type StyleProcessingPipeline, } from './pipeline';
@@ -6,3 +8,4 @@ export { createFallbackPlaceholderReplacer } from './plugins/post/specificity-cl
6
8
  export { createInjectPreflight } from './preflight';
7
9
  export { internalCssSelectorReplacer } from './shared';
8
10
  export * from './types';
11
+ export { composeRules as unitConversionComposeRules, presets as unitConversionPresets, } from 'postcss-rule-unit-converter';