@weapp-tailwindcss/postcss 2.1.2 → 2.1.4-alpha.0

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.d.mts CHANGED
@@ -1,8 +1,9 @@
1
- import { I as IStyleHandlerOptions, S as StyleHandler, a as InternalCssSelectorReplacerOptions } from './types-BvKQTc7Z.mjs';
2
- export { C as CssCalcOptions, b as CssPreflightOptions, c as IPropValue, L as LoadedPostcssOptions, P as PipelineNodeContext, d as PipelineNodeCursor, e as PipelineStage, R as RequiredStyleHandlerOptions, f as ResolvedPipelineNode, g as StyleProcessingPipeline, U as UserDefinedPostcssOptions, h as createInjectPreflight, i as createStylePipeline } from './types-BvKQTc7Z.mjs';
1
+ import { I as IStyleHandlerOptions, S as StyleHandler, a as InternalCssSelectorReplacerOptions } from './types-BUB5jCYX.mjs';
2
+ export { C as CssCalcOptions, b as CssPreflightOptions, c as IPropValue, L as LoadedPostcssOptions, P as PipelineNodeContext, d as PipelineNodeCursor, e as PipelineStage, R as RequiredStyleHandlerOptions, f as ResolvedPipelineNode, g as StyleProcessingPipeline, U as UserDefinedPostcssOptions, h as createInjectPreflight, i as createStylePipeline } from './types-BUB5jCYX.mjs';
3
3
  export { pluginOptions as PresetEnvOptions } from 'postcss-preset-env';
4
4
  export { PxTransformOptions as Px2rpxOptions } from 'postcss-pxtrans';
5
5
  export { UserDefinedOptions as Rem2rpxOptions } from 'postcss-rem-to-responsive-pixel';
6
+ export { UserDefinedOptions as UnitsToPxOptions } from 'postcss-units-to-px';
6
7
  import '@weapp-tailwindcss/postcss-calc';
7
8
  import 'postcss';
8
9
  import 'postcss-load-config';
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { I as IStyleHandlerOptions, S as StyleHandler, a as InternalCssSelectorReplacerOptions } from './types-BvKQTc7Z.js';
2
- export { C as CssCalcOptions, b as CssPreflightOptions, c as IPropValue, L as LoadedPostcssOptions, P as PipelineNodeContext, d as PipelineNodeCursor, e as PipelineStage, R as RequiredStyleHandlerOptions, f as ResolvedPipelineNode, g as StyleProcessingPipeline, U as UserDefinedPostcssOptions, h as createInjectPreflight, i as createStylePipeline } from './types-BvKQTc7Z.js';
1
+ import { I as IStyleHandlerOptions, S as StyleHandler, a as InternalCssSelectorReplacerOptions } from './types-BUB5jCYX.js';
2
+ export { C as CssCalcOptions, b as CssPreflightOptions, c as IPropValue, L as LoadedPostcssOptions, P as PipelineNodeContext, d as PipelineNodeCursor, e as PipelineStage, R as RequiredStyleHandlerOptions, f as ResolvedPipelineNode, g as StyleProcessingPipeline, U as UserDefinedPostcssOptions, h as createInjectPreflight, i as createStylePipeline } from './types-BUB5jCYX.js';
3
3
  export { pluginOptions as PresetEnvOptions } from 'postcss-preset-env';
4
4
  export { PxTransformOptions as Px2rpxOptions } from 'postcss-pxtrans';
5
5
  export { UserDefinedOptions as Rem2rpxOptions } from 'postcss-rem-to-responsive-pixel';
6
+ export { UserDefinedOptions as UnitsToPxOptions } from 'postcss-units-to-px';
6
7
  import '@weapp-tailwindcss/postcss-calc';
7
8
  import 'postcss';
8
9
  import 'postcss-load-config';
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ function getDefaultOptions(options) {
28
28
  // cssRemoveAtSupports: true,
29
29
  // cssRemoveAtMedia: true,
30
30
  cssSelectorReplacement: {
31
- root: "page",
31
+ root: ["page", ".tw-root", "wx-root-portal-content"],
32
32
  universal: ["view", "text"]
33
33
  }
34
34
  };
@@ -397,6 +397,16 @@ function getRemTransformPlugin(options) {
397
397
  return _postcssremtoresponsivepixel2.default.call(void 0, merged);
398
398
  }
399
399
 
400
+ // src/plugins/getUnitsToPxPlugin.ts
401
+ var _postcssunitstopx = require('postcss-units-to-px'); var _postcssunitstopx2 = _interopRequireDefault(_postcssunitstopx);
402
+ function getUnitsToPxPlugin(options) {
403
+ if (!options.unitsToPx) {
404
+ return null;
405
+ }
406
+ const userOptions = typeof options.unitsToPx === "object" ? options.unitsToPx : void 0;
407
+ return _postcssunitstopx2.default.call(void 0, userOptions);
408
+ }
409
+
400
410
  // src/plugins/post.ts
401
411
 
402
412
 
@@ -1847,6 +1857,18 @@ function createPipelineDefinitions(options) {
1847
1857
  createPlugin: () => createColorFunctionalFallback()
1848
1858
  })
1849
1859
  });
1860
+ stages.normal.push({
1861
+ id: "normal:units-to-px",
1862
+ stage: "normal",
1863
+ prepare: () => {
1864
+ const plugin = getUnitsToPxPlugin(options);
1865
+ return plugin ? {
1866
+ id: "normal:units-to-px",
1867
+ stage: "normal",
1868
+ createPlugin: () => plugin
1869
+ } : void 0;
1870
+ }
1871
+ });
1850
1872
  stages.normal.push({
1851
1873
  id: "normal:px-transform",
1852
1874
  stage: "normal",
package/dist/index.mjs CHANGED
@@ -28,7 +28,7 @@ function getDefaultOptions(options) {
28
28
  // cssRemoveAtSupports: true,
29
29
  // cssRemoveAtMedia: true,
30
30
  cssSelectorReplacement: {
31
- root: "page",
31
+ root: ["page", ".tw-root", "wx-root-portal-content"],
32
32
  universal: ["view", "text"]
33
33
  }
34
34
  };
@@ -397,6 +397,16 @@ function getRemTransformPlugin(options) {
397
397
  return postcssRem2rpx(merged);
398
398
  }
399
399
 
400
+ // src/plugins/getUnitsToPxPlugin.ts
401
+ import postcssUnitsToPx from "postcss-units-to-px";
402
+ function getUnitsToPxPlugin(options) {
403
+ if (!options.unitsToPx) {
404
+ return null;
405
+ }
406
+ const userOptions = typeof options.unitsToPx === "object" ? options.unitsToPx : void 0;
407
+ return postcssUnitsToPx(userOptions);
408
+ }
409
+
400
410
  // src/plugins/post.ts
401
411
  import { defu } from "@weapp-tailwindcss/shared";
402
412
 
@@ -1847,6 +1857,18 @@ function createPipelineDefinitions(options) {
1847
1857
  createPlugin: () => createColorFunctionalFallback()
1848
1858
  })
1849
1859
  });
1860
+ stages.normal.push({
1861
+ id: "normal:units-to-px",
1862
+ stage: "normal",
1863
+ prepare: () => {
1864
+ const plugin = getUnitsToPxPlugin(options);
1865
+ return plugin ? {
1866
+ id: "normal:units-to-px",
1867
+ stage: "normal",
1868
+ createPlugin: () => plugin
1869
+ } : void 0;
1870
+ }
1871
+ });
1850
1872
  stages.normal.push({
1851
1873
  id: "normal:px-transform",
1852
1874
  stage: "normal",
@@ -4,6 +4,7 @@ import { Result } from 'postcss-load-config';
4
4
  import { pluginOptions } from 'postcss-preset-env';
5
5
  import { PxTransformOptions } from 'postcss-pxtrans';
6
6
  import { UserDefinedOptions } from 'postcss-rem-to-responsive-pixel';
7
+ import { UserDefinedOptions as UserDefinedOptions$1 } from 'postcss-units-to-px';
7
8
 
8
9
  type PipelineStage = 'pre' | 'normal' | 'post';
9
10
  interface PipelineNodeCursor {
@@ -73,7 +74,7 @@ type RequiredStyleHandlerOptions = {
73
74
  cssPreflight?: CssPreflightOptions;
74
75
  cssInjectPreflight?: InjectPreflight;
75
76
  escapeMap?: Record<string, string>;
76
- } & Pick<UserDefinedPostcssOptions, 'cssPreflightRange' | 'cssChildCombinatorReplaceValue' | 'injectAdditionalCssVarScope' | 'cssSelectorReplacement' | 'rem2rpx' | 'px2rpx'>;
77
+ } & Pick<UserDefinedPostcssOptions, 'cssPreflightRange' | 'cssChildCombinatorReplaceValue' | 'injectAdditionalCssVarScope' | 'cssSelectorReplacement' | 'rem2rpx' | 'px2rpx' | 'unitsToPx'>;
77
78
  interface InternalCssSelectorReplacerOptions {
78
79
  escapeMap?: Record<string, string>;
79
80
  }
@@ -107,6 +108,7 @@ interface UserDefinedPostcssOptions {
107
108
  };
108
109
  rem2rpx?: boolean | UserDefinedOptions;
109
110
  px2rpx?: boolean | PxTransformOptions;
111
+ unitsToPx?: boolean | UserDefinedOptions$1;
110
112
  postcssOptions?: LoadedPostcssOptions;
111
113
  cssRemoveHoverPseudoClass?: boolean;
112
114
  cssRemoveProperty?: boolean;
@@ -4,6 +4,7 @@ import { Result } from 'postcss-load-config';
4
4
  import { pluginOptions } from 'postcss-preset-env';
5
5
  import { PxTransformOptions } from 'postcss-pxtrans';
6
6
  import { UserDefinedOptions } from 'postcss-rem-to-responsive-pixel';
7
+ import { UserDefinedOptions as UserDefinedOptions$1 } from 'postcss-units-to-px';
7
8
 
8
9
  type PipelineStage = 'pre' | 'normal' | 'post';
9
10
  interface PipelineNodeCursor {
@@ -73,7 +74,7 @@ type RequiredStyleHandlerOptions = {
73
74
  cssPreflight?: CssPreflightOptions;
74
75
  cssInjectPreflight?: InjectPreflight;
75
76
  escapeMap?: Record<string, string>;
76
- } & Pick<UserDefinedPostcssOptions, 'cssPreflightRange' | 'cssChildCombinatorReplaceValue' | 'injectAdditionalCssVarScope' | 'cssSelectorReplacement' | 'rem2rpx' | 'px2rpx'>;
77
+ } & Pick<UserDefinedPostcssOptions, 'cssPreflightRange' | 'cssChildCombinatorReplaceValue' | 'injectAdditionalCssVarScope' | 'cssSelectorReplacement' | 'rem2rpx' | 'px2rpx' | 'unitsToPx'>;
77
78
  interface InternalCssSelectorReplacerOptions {
78
79
  escapeMap?: Record<string, string>;
79
80
  }
@@ -107,6 +108,7 @@ interface UserDefinedPostcssOptions {
107
108
  };
108
109
  rem2rpx?: boolean | UserDefinedOptions;
109
110
  px2rpx?: boolean | PxTransformOptions;
111
+ unitsToPx?: boolean | UserDefinedOptions$1;
110
112
  postcssOptions?: LoadedPostcssOptions;
111
113
  cssRemoveHoverPseudoClass?: boolean;
112
114
  cssRemoveProperty?: boolean;
package/dist/types.d.mts CHANGED
@@ -4,4 +4,5 @@ import 'postcss-load-config';
4
4
  export { pluginOptions as PresetEnvOptions } from 'postcss-preset-env';
5
5
  export { PxTransformOptions as Px2rpxOptions } from 'postcss-pxtrans';
6
6
  export { UserDefinedOptions as Rem2rpxOptions } from 'postcss-rem-to-responsive-pixel';
7
- export { C as CssCalcOptions, b as CssPreflightOptions, c as IPropValue, I as IStyleHandlerOptions, a as InternalCssSelectorReplacerOptions, L as LoadedPostcssOptions, R as RequiredStyleHandlerOptions, S as StyleHandler, U as UserDefinedPostcssOptions } from './types-BvKQTc7Z.mjs';
7
+ export { UserDefinedOptions as UnitsToPxOptions } from 'postcss-units-to-px';
8
+ export { C as CssCalcOptions, b as CssPreflightOptions, c as IPropValue, I as IStyleHandlerOptions, a as InternalCssSelectorReplacerOptions, L as LoadedPostcssOptions, R as RequiredStyleHandlerOptions, S as StyleHandler, U as UserDefinedPostcssOptions } from './types-BUB5jCYX.mjs';
package/dist/types.d.ts CHANGED
@@ -4,4 +4,5 @@ import 'postcss-load-config';
4
4
  export { pluginOptions as PresetEnvOptions } from 'postcss-preset-env';
5
5
  export { PxTransformOptions as Px2rpxOptions } from 'postcss-pxtrans';
6
6
  export { UserDefinedOptions as Rem2rpxOptions } from 'postcss-rem-to-responsive-pixel';
7
- export { C as CssCalcOptions, b as CssPreflightOptions, c as IPropValue, I as IStyleHandlerOptions, a as InternalCssSelectorReplacerOptions, L as LoadedPostcssOptions, R as RequiredStyleHandlerOptions, S as StyleHandler, U as UserDefinedPostcssOptions } from './types-BvKQTc7Z.js';
7
+ export { UserDefinedOptions as UnitsToPxOptions } from 'postcss-units-to-px';
8
+ export { C as CssCalcOptions, b as CssPreflightOptions, c as IPropValue, I as IStyleHandlerOptions, a as InternalCssSelectorReplacerOptions, L as LoadedPostcssOptions, R as RequiredStyleHandlerOptions, S as StyleHandler, U as UserDefinedPostcssOptions } from './types-BUB5jCYX.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weapp-tailwindcss/postcss",
3
- "version": "2.1.2",
3
+ "version": "2.1.4-alpha.0",
4
4
  "description": "@weapp-tailwindcss/postcss",
5
5
  "author": "ice breaker <1324318532@qq.com>",
6
6
  "license": "MIT",
@@ -42,13 +42,14 @@
42
42
  "node": "^20.19.0 || >=22.12.0"
43
43
  },
44
44
  "dependencies": {
45
- "@weapp-core/escape": "~6.0.1",
45
+ "@weapp-core/escape": "~7.0.0",
46
46
  "@weapp-tailwindcss/postcss-calc": "^1.0.0",
47
47
  "postcss": "~8.5.6",
48
48
  "postcss-preset-env": "^10.6.1",
49
- "postcss-pxtrans": "^1.0.0",
50
- "postcss-rem-to-responsive-pixel": "^7.0.0",
49
+ "postcss-pxtrans": "^1.0.1",
50
+ "postcss-rem-to-responsive-pixel": "^7.0.1",
51
51
  "postcss-selector-parser": "~7.1.1",
52
+ "postcss-units-to-px": "^0.2.0",
52
53
  "postcss-value-parser": "^4.2.0",
53
54
  "@weapp-tailwindcss/shared": "1.1.2"
54
55
  },