@byteluck-fe/model-driven-engine 6.1.0-1-beta.4 → 6.1.0-1-beta.6

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.
@@ -38,6 +38,7 @@ function _define_property(obj, key, value) {
38
38
  }
39
39
  import postcss from 'postcss';
40
40
  import prefixSelector from 'postcss-prefix-selector';
41
+ import postcssNested from 'postcss-nested';
41
42
  export var StylePlugin = /*#__PURE__*/ function() {
42
43
  "use strict";
43
44
  function StylePlugin(config) {
@@ -62,10 +63,18 @@ export var StylePlugin = /*#__PURE__*/ function() {
62
63
  var dom = document.querySelector('head');
63
64
  dom === null || dom === void 0 ? void 0 : dom.appendChild(style);
64
65
  var cssStyleText = postcss([
66
+ postcssNested(),
65
67
  prefixSelector({
66
- prefix: ".render-engine-".concat((_this_engine = this.engine) === null || _this_engine === void 0 ? void 0 : _this_engine.id)
68
+ prefix: ".render-engine-".concat((_this_engine = this.engine) === null || _this_engine === void 0 ? void 0 : _this_engine.id),
69
+ // 明确将前缀通过空格连接到每个选择器,避免重复前缀
70
+ transform: function transform(prefix, selector) {
71
+ if (selector.startsWith(prefix)) return selector;
72
+ return "".concat(prefix, " ").concat(selector);
73
+ }
67
74
  })
68
- ]).process(compiledStyle).css;
75
+ ]).process(compiledStyle, {
76
+ from: undefined
77
+ }).css;
69
78
  style.appendChild(document.createTextNode(cssStyleText));
70
79
  }
71
80
  }