@weapp-tailwindcss/postcss 2.2.1-next.0 → 2.2.1-next.2
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/index.js +15 -17
- package/dist/index.mjs +15 -17
- package/dist/types.d.ts +38 -38
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1809,23 +1809,21 @@ const postcssWeappTailwindcssPostPlugin = (options) => {
|
|
|
1809
1809
|
}
|
|
1810
1810
|
};
|
|
1811
1811
|
}
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
};
|
|
1828
|
-
}
|
|
1812
|
+
p.DeclarationExit = (decl) => {
|
|
1813
|
+
if (opts.majorVersion === void 0) normalizeTailwindcssRpxDeclaration(decl);
|
|
1814
|
+
else normalizeTailwindcssRpxDeclaration(decl, { majorVersion: opts.majorVersion });
|
|
1815
|
+
if (enableMainChunkTransforms) normalizeTailwindcssV4Declaration(decl);
|
|
1816
|
+
};
|
|
1817
|
+
if (enableMainChunkTransforms) p.AtRuleExit = (atRule) => {
|
|
1818
|
+
/**
|
|
1819
|
+
* @description 移除 property
|
|
1820
|
+
*/
|
|
1821
|
+
if (opts.cssRemoveProperty && atRule.name === "property") atRule.remove();
|
|
1822
|
+
/**
|
|
1823
|
+
* 清除空节点
|
|
1824
|
+
*/
|
|
1825
|
+
atRule.nodes?.length === 0 && atRule.remove();
|
|
1826
|
+
};
|
|
1829
1827
|
return p;
|
|
1830
1828
|
};
|
|
1831
1829
|
postcssWeappTailwindcssPostPlugin.postcss = true;
|
package/dist/index.mjs
CHANGED
|
@@ -1799,23 +1799,21 @@ const postcssWeappTailwindcssPostPlugin = (options) => {
|
|
|
1799
1799
|
}
|
|
1800
1800
|
};
|
|
1801
1801
|
}
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
};
|
|
1818
|
-
}
|
|
1802
|
+
p.DeclarationExit = (decl) => {
|
|
1803
|
+
if (opts.majorVersion === void 0) normalizeTailwindcssRpxDeclaration(decl);
|
|
1804
|
+
else normalizeTailwindcssRpxDeclaration(decl, { majorVersion: opts.majorVersion });
|
|
1805
|
+
if (enableMainChunkTransforms) normalizeTailwindcssV4Declaration(decl);
|
|
1806
|
+
};
|
|
1807
|
+
if (enableMainChunkTransforms) p.AtRuleExit = (atRule) => {
|
|
1808
|
+
/**
|
|
1809
|
+
* @description 移除 property
|
|
1810
|
+
*/
|
|
1811
|
+
if (opts.cssRemoveProperty && atRule.name === "property") atRule.remove();
|
|
1812
|
+
/**
|
|
1813
|
+
* 清除空节点
|
|
1814
|
+
*/
|
|
1815
|
+
atRule.nodes?.length === 0 && atRule.remove();
|
|
1816
|
+
};
|
|
1819
1817
|
return p;
|
|
1820
1818
|
};
|
|
1821
1819
|
postcssWeappTailwindcssPostPlugin.postcss = true;
|
package/dist/types.d.ts
CHANGED
|
@@ -23,13 +23,13 @@ export type RequiredStyleHandlerOptions = {
|
|
|
23
23
|
/**
|
|
24
24
|
* @description 默认为 true,此时会对样式主文件,进行猜测
|
|
25
25
|
*/
|
|
26
|
-
isMainChunk?: boolean;
|
|
27
|
-
cssPreflight?: CssPreflightOptions;
|
|
28
|
-
cssInjectPreflight?: InjectPreflight;
|
|
29
|
-
escapeMap?: Record<string, string
|
|
26
|
+
isMainChunk?: boolean | undefined;
|
|
27
|
+
cssPreflight?: CssPreflightOptions | undefined;
|
|
28
|
+
cssInjectPreflight?: InjectPreflight | undefined;
|
|
29
|
+
escapeMap?: Record<string, string> | undefined;
|
|
30
30
|
} & Pick<UserDefinedPostcssOptions, 'cssPreflightRange' | 'cssChildCombinatorReplaceValue' | 'injectAdditionalCssVarScope' | 'cssSelectorReplacement' | 'rem2rpx' | 'px2rpx' | 'unitsToPx'>;
|
|
31
31
|
export interface InternalCssSelectorReplacerOptions {
|
|
32
|
-
escapeMap?: Record<string, string
|
|
32
|
+
escapeMap?: Record<string, string> | undefined;
|
|
33
33
|
}
|
|
34
34
|
interface CssCalcOptions extends PostCssCalcOptions {
|
|
35
35
|
includeCustomProperties?: (string | RegExp)[];
|
|
@@ -41,43 +41,43 @@ export interface UnitsToPxOptions extends Pick<UnitConverterOptions, 'disabled'
|
|
|
41
41
|
transform?: GlobalUnitTransform | false;
|
|
42
42
|
}
|
|
43
43
|
export type IStyleHandlerOptions = {
|
|
44
|
-
ctx?: PostcssContext;
|
|
45
|
-
postcssOptions?: LoadedPostcssOptions;
|
|
46
|
-
cssRemoveProperty?: boolean;
|
|
47
|
-
cssRemoveHoverPseudoClass?: boolean;
|
|
48
|
-
cssPresetEnv?: PresetEnvOptions;
|
|
49
|
-
autoprefixer?: WeappAutoprefixerOptions;
|
|
50
|
-
cssCalc?: boolean | CssCalcOptions | (string | RegExp)[];
|
|
44
|
+
ctx?: PostcssContext | undefined;
|
|
45
|
+
postcssOptions?: LoadedPostcssOptions | undefined;
|
|
46
|
+
cssRemoveProperty?: boolean | undefined;
|
|
47
|
+
cssRemoveHoverPseudoClass?: boolean | undefined;
|
|
48
|
+
cssPresetEnv?: PresetEnvOptions | undefined;
|
|
49
|
+
autoprefixer?: WeappAutoprefixerOptions | undefined;
|
|
50
|
+
cssCalc?: boolean | CssCalcOptions | (string | RegExp)[] | undefined;
|
|
51
51
|
atRules?: {
|
|
52
|
-
property?: boolean;
|
|
53
|
-
supports?: boolean;
|
|
54
|
-
media?: boolean;
|
|
55
|
-
};
|
|
56
|
-
uniAppX?: boolean;
|
|
57
|
-
uniAppXCssTarget?: UniAppXCssTarget;
|
|
58
|
-
uniAppXUnsupported?: UniAppXUnsupportedMode;
|
|
59
|
-
majorVersion?: number;
|
|
52
|
+
property?: boolean | undefined;
|
|
53
|
+
supports?: boolean | undefined;
|
|
54
|
+
media?: boolean | undefined;
|
|
55
|
+
} | undefined;
|
|
56
|
+
uniAppX?: boolean | undefined;
|
|
57
|
+
uniAppXCssTarget?: UniAppXCssTarget | undefined;
|
|
58
|
+
uniAppXUnsupported?: UniAppXUnsupportedMode | undefined;
|
|
59
|
+
majorVersion?: number | undefined;
|
|
60
60
|
} & RequiredStyleHandlerOptions;
|
|
61
61
|
export interface UserDefinedPostcssOptions {
|
|
62
|
-
cssPreflight?: CssPreflightOptions;
|
|
63
|
-
cssPreflightRange?: 'all';
|
|
64
|
-
cssChildCombinatorReplaceValue?: string | string[];
|
|
65
|
-
cssPresetEnv?: PresetEnvOptions;
|
|
66
|
-
autoprefixer?: WeappAutoprefixerOptions;
|
|
67
|
-
injectAdditionalCssVarScope?: boolean;
|
|
62
|
+
cssPreflight?: CssPreflightOptions | undefined;
|
|
63
|
+
cssPreflightRange?: 'all' | undefined;
|
|
64
|
+
cssChildCombinatorReplaceValue?: string | string[] | undefined;
|
|
65
|
+
cssPresetEnv?: PresetEnvOptions | undefined;
|
|
66
|
+
autoprefixer?: WeappAutoprefixerOptions | undefined;
|
|
67
|
+
injectAdditionalCssVarScope?: boolean | undefined;
|
|
68
68
|
cssSelectorReplacement?: {
|
|
69
|
-
root?: string | string[] | false;
|
|
70
|
-
universal?: string | string[] | false;
|
|
71
|
-
};
|
|
72
|
-
rem2rpx?: boolean | Rem2rpxOptions;
|
|
73
|
-
px2rpx?: boolean | Px2rpxOptions;
|
|
74
|
-
unitsToPx?: boolean | UnitsToPxOptions;
|
|
75
|
-
postcssOptions?: LoadedPostcssOptions;
|
|
76
|
-
cssRemoveHoverPseudoClass?: boolean;
|
|
77
|
-
cssRemoveProperty?: boolean;
|
|
78
|
-
uniAppX?: boolean;
|
|
79
|
-
uniAppXCssTarget?: UniAppXCssTarget;
|
|
80
|
-
uniAppXUnsupported?: UniAppXUnsupportedMode;
|
|
69
|
+
root?: string | string[] | false | undefined;
|
|
70
|
+
universal?: string | string[] | false | undefined;
|
|
71
|
+
} | undefined;
|
|
72
|
+
rem2rpx?: boolean | Rem2rpxOptions | undefined;
|
|
73
|
+
px2rpx?: boolean | Px2rpxOptions | undefined;
|
|
74
|
+
unitsToPx?: boolean | UnitsToPxOptions | undefined;
|
|
75
|
+
postcssOptions?: LoadedPostcssOptions | undefined;
|
|
76
|
+
cssRemoveHoverPseudoClass?: boolean | undefined;
|
|
77
|
+
cssRemoveProperty?: boolean | undefined;
|
|
78
|
+
uniAppX?: boolean | undefined;
|
|
79
|
+
uniAppXCssTarget?: UniAppXCssTarget | undefined;
|
|
80
|
+
uniAppXUnsupported?: UniAppXUnsupportedMode | undefined;
|
|
81
81
|
}
|
|
82
82
|
export type { CssCalcOptions, PresetEnvOptions, Px2rpxOptions, Rem2rpxOptions, WeappAutoprefixerOptions, };
|
|
83
83
|
export interface StyleHandler {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-tailwindcss/postcss",
|
|
3
|
-
"version": "2.2.1-next.
|
|
3
|
+
"version": "2.2.1-next.2",
|
|
4
4
|
"description": "@weapp-tailwindcss/postcss",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@csstools/postcss-is-pseudo-class": "^6.0.0",
|
|
74
|
-
"fast-check": "^4.
|
|
74
|
+
"fast-check": "^4.8.0",
|
|
75
75
|
"postcss-calc": "^10.1.1",
|
|
76
76
|
"postcss-custom-properties": "^14.0.6"
|
|
77
77
|
},
|