@weapp-tailwindcss/postcss 3.0.7 → 3.0.8

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.
@@ -1,4 +1,5 @@
1
1
  import type { IStyleHandlerOptions } from './types';
2
+ export declare function normalizeCssOptions<T extends Partial<IStyleHandlerOptions>>(options: T, mirrorTopLevel?: boolean): T;
2
3
  export interface OptionsResolver {
3
4
  resolve: (overrides?: Partial<IStyleHandlerOptions>) => IStyleHandlerOptions;
4
5
  }
package/dist/types.d.ts CHANGED
@@ -53,43 +53,147 @@ export interface PlatformUnitConversionOptions {
53
53
  platforms: UnitConversionPlatformMap;
54
54
  }
55
55
  export type UnitConversionOptions = UnitConversionConfig | PlatformUnitConversionOptions | false;
56
+ export interface CssSelectorReplacement {
57
+ root?: string | string[] | false | undefined;
58
+ universal?: string | string[] | false | undefined;
59
+ }
60
+ export interface CssAtRules {
61
+ property?: boolean | undefined;
62
+ supports?: boolean | undefined;
63
+ media?: boolean | undefined;
64
+ }
65
+ export interface CssOptions {
66
+ cssPreflight?: CssPreflightOptions | undefined;
67
+ cssPreflightRange?: 'all' | undefined;
68
+ cssChildCombinatorReplaceValue?: string | string[] | undefined;
69
+ cssPresetEnv?: PresetEnvOptions | undefined;
70
+ autoprefixer?: WeappAutoprefixerOptions | undefined;
71
+ atRules?: CssAtRules | undefined;
72
+ injectAdditionalCssVarScope?: boolean | undefined;
73
+ cssSelectorReplacement?: CssSelectorReplacement | undefined;
74
+ rem2rpx?: boolean | Rem2rpxOptions | undefined;
75
+ px2rpx?: boolean | Px2rpxOptions | undefined;
76
+ unitsToPx?: boolean | UnitsToPxOptions | undefined;
77
+ unitConversion?: UnitConversionOptions | undefined;
78
+ platform?: string | undefined;
79
+ cssRemoveHoverPseudoClass?: boolean | undefined;
80
+ cssRemoveProperty?: boolean | undefined;
81
+ cssCalc?: boolean | CssCalcOptions | (string | RegExp)[] | undefined;
82
+ /**
83
+ * 是否显式追加 Tailwind CSS v4 渐变字面量组合兜底。
84
+ */
85
+ tailwindcssV4GradientFallback?: boolean | undefined;
86
+ }
56
87
  export type IStyleHandlerOptions = {
57
88
  ctx?: PostcssContext | undefined;
89
+ /**
90
+ * @deprecated 请使用 `cssOptions.platform`。
91
+ */
58
92
  platform?: string | undefined;
59
93
  postcssOptions?: LoadedPostcssOptions | undefined;
94
+ cssOptions?: CssOptions | undefined;
95
+ /**
96
+ * @deprecated 请使用 `cssOptions.cssRemoveProperty`。
97
+ */
60
98
  cssRemoveProperty?: boolean | undefined;
99
+ /**
100
+ * @deprecated 请使用 `cssOptions.cssRemoveHoverPseudoClass`。
101
+ */
61
102
  cssRemoveHoverPseudoClass?: boolean | undefined;
103
+ /**
104
+ * @deprecated 请使用 `cssOptions.tailwindcssV4GradientFallback`。
105
+ */
106
+ tailwindcssV4GradientFallback?: boolean | undefined;
107
+ /**
108
+ * @deprecated 请使用 `cssOptions.cssPresetEnv`。
109
+ */
62
110
  cssPresetEnv?: PresetEnvOptions | undefined;
111
+ /**
112
+ * @deprecated 请使用 `cssOptions.atRules`。
113
+ */
114
+ atRules?: CssAtRules | undefined;
115
+ /**
116
+ * @deprecated 请使用 `cssOptions.autoprefixer`。
117
+ */
63
118
  autoprefixer?: WeappAutoprefixerOptions | undefined;
119
+ /**
120
+ * @deprecated 请使用 `cssOptions.cssCalc`。
121
+ */
64
122
  cssCalc?: boolean | CssCalcOptions | (string | RegExp)[] | undefined;
65
- atRules?: {
66
- property?: boolean | undefined;
67
- supports?: boolean | undefined;
68
- media?: boolean | undefined;
69
- } | undefined;
70
123
  uniAppX?: boolean | undefined;
71
124
  uniAppXCssTarget?: UniAppXCssTarget | undefined;
72
125
  uniAppXUnsupported?: UniAppXUnsupportedMode | undefined;
73
126
  majorVersion?: number | undefined;
74
127
  } & RequiredStyleHandlerOptions;
75
128
  export interface UserDefinedPostcssOptions {
129
+ /**
130
+ * @deprecated 请使用 `cssOptions.cssPreflight`。
131
+ */
76
132
  cssPreflight?: CssPreflightOptions | undefined;
133
+ /**
134
+ * @deprecated 请使用 `cssOptions.cssPreflightRange`。
135
+ */
77
136
  cssPreflightRange?: 'all' | undefined;
137
+ /**
138
+ * @deprecated 请使用 `cssOptions.cssChildCombinatorReplaceValue`。
139
+ */
78
140
  cssChildCombinatorReplaceValue?: string | string[] | undefined;
141
+ /**
142
+ * @deprecated 请使用 `cssOptions.cssPresetEnv`。
143
+ */
79
144
  cssPresetEnv?: PresetEnvOptions | undefined;
145
+ /**
146
+ * @deprecated 请使用 `cssOptions.autoprefixer`。
147
+ */
80
148
  autoprefixer?: WeappAutoprefixerOptions | undefined;
149
+ /**
150
+ * @deprecated 请使用 `cssOptions.injectAdditionalCssVarScope`。
151
+ */
81
152
  injectAdditionalCssVarScope?: boolean | undefined;
82
- cssSelectorReplacement?: {
83
- root?: string | string[] | false | undefined;
84
- universal?: string | string[] | false | undefined;
85
- } | undefined;
153
+ /**
154
+ * @deprecated 请使用 `cssOptions.cssSelectorReplacement`。
155
+ */
156
+ cssSelectorReplacement?: CssSelectorReplacement | undefined;
157
+ /**
158
+ * @deprecated 请使用 `cssOptions.rem2rpx`。
159
+ */
86
160
  rem2rpx?: boolean | Rem2rpxOptions | undefined;
161
+ /**
162
+ * @deprecated 请使用 `cssOptions.px2rpx`。
163
+ */
87
164
  px2rpx?: boolean | Px2rpxOptions | undefined;
165
+ /**
166
+ * @deprecated 请使用 `cssOptions.unitsToPx`。
167
+ */
88
168
  unitsToPx?: boolean | UnitsToPxOptions | undefined;
169
+ /**
170
+ * @deprecated 请使用 `cssOptions.unitConversion`。
171
+ */
89
172
  unitConversion?: UnitConversionOptions | undefined;
90
173
  postcssOptions?: LoadedPostcssOptions | undefined;
174
+ /**
175
+ * @deprecated 请使用 `cssOptions.cssRemoveHoverPseudoClass`。
176
+ */
91
177
  cssRemoveHoverPseudoClass?: boolean | undefined;
178
+ /**
179
+ * @deprecated 请使用 `cssOptions.cssRemoveProperty`。
180
+ */
92
181
  cssRemoveProperty?: boolean | undefined;
182
+ /**
183
+ * CSS 生成与兼容后处理的微调配置。
184
+ *
185
+ * `cssPreflight`、`cssPreflightRange`、`cssChildCombinatorReplaceValue`、`cssPresetEnv`、`autoprefixer`、
186
+ * `atRules`、`injectAdditionalCssVarScope`、`cssSelectorReplacement`、`rem2rpx`、`px2rpx`、`unitsToPx`、
187
+ * `unitConversion`、`platform`、`cssRemoveHoverPseudoClass`、`cssRemoveProperty`、`cssCalc`
188
+ * 与 `tailwindcssV4GradientFallback` 都推荐放在这里。
189
+ */
190
+ cssOptions?: CssOptions | undefined;
191
+ /**
192
+ * 是否显式追加 Tailwind CSS v4 渐变字面量组合兜底。
193
+ *
194
+ * @deprecated 请使用 `cssOptions.tailwindcssV4GradientFallback`。
195
+ */
196
+ tailwindcssV4GradientFallback?: boolean | undefined;
93
197
  uniAppX?: boolean | undefined;
94
198
  uniAppXCssTarget?: UniAppXCssTarget | undefined;
95
199
  uniAppXUnsupported?: UniAppXUnsupportedMode | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weapp-tailwindcss/postcss",
3
- "version": "3.0.7",
3
+ "version": "3.0.8",
4
4
  "description": "@weapp-tailwindcss/postcss",
5
5
  "author": "ice breaker <1324318532@qq.com>",
6
6
  "license": "MIT",
@@ -73,22 +73,22 @@
73
73
  "postcss-pxtrans": "^1.0.4",
74
74
  "postcss-rem-to-responsive-pixel": "^7.0.4",
75
75
  "postcss-rule-unit-converter": "^0.2.2",
76
- "postcss-selector-parser": "~7.1.2",
76
+ "postcss-selector-parser": "~7.1.4",
77
77
  "postcss-value-parser": "^4.2.0",
78
- "tailwindcss-patch": "9.4.3",
78
+ "tailwindcss-patch": "9.4.4",
79
79
  "@weapp-tailwindcss/postcss-calc": "^1.0.2",
80
80
  "@weapp-tailwindcss/shared": "2.0.0",
81
81
  "tailwindcss-config": "2.0.0"
82
82
  },
83
83
  "devDependencies": {
84
- "@csstools/css-color-parser": "^4.1.1",
84
+ "@csstools/css-color-parser": "^4.1.7",
85
85
  "@csstools/css-parser-algorithms": "^4.0.0",
86
86
  "@csstools/css-tokenizer": "^4.0.0",
87
87
  "@csstools/postcss-is-pseudo-class": "^6.0.0",
88
88
  "fast-check": "^4.8.0",
89
89
  "postcss-calc": "link:packages/postcss-calc",
90
90
  "postcss-custom-properties": "^15.0.1",
91
- "postcss-preset-env": "^11.3.0"
91
+ "postcss-preset-env": "^11.3.1"
92
92
  },
93
93
  "scripts": {
94
94
  "dev": "tsdown --watch --sourcemap",