@sheinx/shineout-style 3.5.4-beta.8 → 3.5.4

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,2 +1,2 @@
1
- export {};
1
+ export declare const scopeNormalizeStyle: (csScopePrefix?: string) => void;
2
2
  //# sourceMappingURL=normalize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["normalize.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["normalize.ts"],"names":[],"mappings":"AAoYA,eAAO,MAAM,mBAAmB,kCA8B/B,CAAC"}
package/cjs/normalize.js CHANGED
@@ -1,5 +1,9 @@
1
1
  "use strict";
2
2
 
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.scopeNormalizeStyle = void 0;
3
7
  var _theme = require("@sheinx/theme");
4
8
  // 1. Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
5
9
  // 2. Change the default font family in all browsers.
@@ -25,12 +29,50 @@ var token = {
25
29
  };
26
30
  var lineHeightComputed = '20px';
27
31
  var lineHeightComputed2 = '10px';
28
- var css = "*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\nhtml {\n font-family: sans-serif;\n line-height: 1.15;\n -ms-overflow-style: scrollbar;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n -webkit-text-size-adjust: 100%;\n -ms-text-size-adjust: 100%;\n}\n\narticle,\naside,\ndialog,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nnav,\nsection {\n display: block;\n}\n\nbody {\n margin: 0;\n color: ".concat(token.color, ";\n font-family: ").concat(token.fontFamily, ";\n font-size: ").concat(token.fontSize, ";\n line-height: ").concat(token.lineHeight, ";\n}\n\n\narticle,\naside,\nfooter,\nheader,\nnav,\nsection {\n display: block;\n}\n\nh1 {\n margin: 0.67em 0;\n font-size: 2em;\n}\n\nfigcaption,\nfigure,\nmain {\n display: block;\n}\n\nfigure {\n margin: 1em 40px;\n}\n\nhr {\n overflow: visible;\n height: 0;\n box-sizing: content-box;\n}\n\npre {\n font-family: \"SFMono-Regular\", Menlo, Monaco, Consolas, \"Courier New\", monospace;\n font-size: 1em;\n}\n\na {\n background-color: transparent;\n color: ").concat(token.linkColor, ";\n cursor: pointer;\n outline: none;\n text-decoration: ").concat(token.linkHoverDecoration, ";\n -webkit-text-decoration-skip: objects;\n transition: color 0.3s;\n}\n\na:active,\na:hover {\n color: ").concat(token.linkColor, ";\n outline: 0;\n text-decoration: ").concat(token.linkHoverDecoration, ";\n}\na[disabled] {\n color: ").concat(token.linkDisabledColor, ";\n cursor: not-allowed;\n pointer-events: none;\n}\n\nabbr[title] {\n border-bottom: none;\n text-decoration: underline;\n text-decoration: underline dotted;\n}\n\nb,\nstrong {\n font-weight: inherit;\n}\n\nb,\nstrong {\n font-weight: bolder;\n}\n\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace;\n font-size: 1em;\n}\n\ndfn {\n font-style: italic;\n}\n\nmark {\n background-color: #ff0;\n color: #000;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\naudio,\nvideo {\n display: inline-block;\n}\n\naudio:not([controls]) {\n display: none;\n height: 0;\n}\n\nimg {\n border-style: none;\n}\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n margin: 0;\n font-family: inherit;\n font-size: 100%;\n line-height: 1.15;\n}\n\nbutton,\ninput {\n overflow: visible;\n}\n\nbutton,\nselect {\n text-transform: none;\n}\n\nbutton,\nhtml [type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\nbutton::-moz-focus-inner,\n[type='button']::-moz-focus-inner,\n[type='reset']::-moz-focus-inner,\n[type='submit']::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\nbutton:-moz-focusring,\n[type='button']:-moz-focusring,\n[type='reset']:-moz-focusring,\n[type='submit']:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n\nlegend {\n display: table;\n max-width: 100%;\n box-sizing: border-box;\n padding: 0;\n color: inherit;\n white-space: normal;\n}\n\nprogress {\n display: inline-block;\n vertical-align: baseline;\n}\n\ntextarea {\n overflow: auto;\n}\n\n[type='checkbox'],\n[type='radio'] {\n box-sizing: border-box;\n padding: 0;\n}\n\n\n[type='number']::-webkit-inner-spin-button,\n[type='number']::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type='search'] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n}\n\n[type='search']::-webkit-search-cancel-button,\n[type='search']::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n\n::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n}\n\n\ndetails,\nmenu {\n display: block;\n}\n\n\nsummary {\n display: list-item;\n}\n\n\ncanvas {\n display: inline-block;\n}\n\n\ntemplate {\n display: none;\n}\n\n\n[hidden] {\n display: none;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\n.h1,\n.h2,\n.h3,\n.h4,\n.h5,\n.h6 {\n color: ").concat(token.headingsColor, ";\n font-family: ").concat(token.headingsFontFamily, ";\n font-weight: ").concat(token.headingsFontWeight, ";\n line-height: ").concat(token.headingsLineHeight, ";\n}\nh1 small, h1 .small, .h1 small, .h1 .small,\nh2 small, h2 .small, .h2 small, .h2 .small,\nh3 small, h3 .small, .h3 small, .h3 .small,\nh4 small, h4 .small, .h4 small, .h4 .small,\nh5 small, h5 .small, .h5 small, .h5 .small,\nh6 small, h6 .small, .h6 small, .h6 .small {\n color: ").concat(token.headingsSmallColor, ";\n font-weight: normal;\n line-height: 1;\n}\n\n\nh1,\n.h1,\nh2,\n.h2,\nh3,\n.h3 {\n margin-top: ").concat(lineHeightComputed, ";\n margin-bottom: ").concat(lineHeightComputed2, ";\n}\n\nhi small, h1 .small, .h1 small, .h1 .small,\nh2 small, h2 .small, .h2 small, .h2 .small,\nh3 small, h3 .small, .h3 small, .h3 .small {\n font-size: 65%;\n}\n\nh4,\n.h4,\nh5,\n.h5,\nh6,\n.h6 {\n margin-top: ").concat(lineHeightComputed2, ";\n margin-bottom: ").concat(lineHeightComputed2, ";\n}\n\nh4 small, h4 .small, .h4 small, .h4 .small,\nh5 small, h5 .small, .h5 small, .h5 .small,\nh6 small, h6 .small, .h6 small, .h6 .small {\n font-size: 75%;\n}\n\np {\n margin: 0 0 ").concat(lineHeightComputed2, ";\n}");
32
+ var normalizeStyle = "*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\nhtml {\n font-family: sans-serif;\n line-height: 1.15;\n -ms-overflow-style: scrollbar;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n -webkit-text-size-adjust: 100%;\n -ms-text-size-adjust: 100%;\n}\n\narticle,\naside,\ndialog,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nnav,\nsection {\n display: block;\n}\n\nbody {\n margin: 0;\n color: ".concat(token.color, ";\n font-family: ").concat(token.fontFamily, ";\n font-size: ").concat(token.fontSize, ";\n line-height: ").concat(token.lineHeight, ";\n}\n\n\narticle,\naside,\nfooter,\nheader,\nnav,\nsection {\n display: block;\n}\n\nh1 {\n margin: 0.67em 0;\n font-size: 2em;\n}\n\nfigcaption,\nfigure,\nmain {\n display: block;\n}\n\nfigure {\n margin: 1em 40px;\n}\n\nhr {\n overflow: visible;\n height: 0;\n box-sizing: content-box;\n}\n\npre {\n font-family: \"SFMono-Regular\", Menlo, Monaco, Consolas, \"Courier New\", monospace;\n font-size: 1em;\n}\n\na {\n background-color: transparent;\n color: ").concat(token.linkColor, ";\n cursor: pointer;\n outline: none;\n text-decoration: ").concat(token.linkHoverDecoration, ";\n -webkit-text-decoration-skip: objects;\n transition: color 0.3s;\n}\n\na:active,\na:hover {\n color: ").concat(token.linkColor, ";\n outline: 0;\n text-decoration: ").concat(token.linkHoverDecoration, ";\n}\na[disabled] {\n color: ").concat(token.linkDisabledColor, ";\n cursor: not-allowed;\n pointer-events: none;\n}\n\nabbr[title] {\n border-bottom: none;\n text-decoration: underline;\n text-decoration: underline dotted;\n}\n\nb,\nstrong {\n font-weight: inherit;\n}\n\nb,\nstrong {\n font-weight: bolder;\n}\n\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace;\n font-size: 1em;\n}\n\ndfn {\n font-style: italic;\n}\n\nmark {\n background-color: #ff0;\n color: #000;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\naudio,\nvideo {\n display: inline-block;\n}\n\naudio:not([controls]) {\n display: none;\n height: 0;\n}\n\nimg {\n border-style: none;\n}\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n margin: 0;\n font-family: inherit;\n font-size: 100%;\n line-height: 1.15;\n}\n\nbutton,\ninput {\n overflow: visible;\n}\n\nbutton,\nselect {\n text-transform: none;\n}\n\nbutton,\nhtml [type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\nbutton::-moz-focus-inner,\n[type='button']::-moz-focus-inner,\n[type='reset']::-moz-focus-inner,\n[type='submit']::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\nbutton:-moz-focusring,\n[type='button']:-moz-focusring,\n[type='reset']:-moz-focusring,\n[type='submit']:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n\nlegend {\n display: table;\n max-width: 100%;\n box-sizing: border-box;\n padding: 0;\n color: inherit;\n white-space: normal;\n}\n\nprogress {\n display: inline-block;\n vertical-align: baseline;\n}\n\ntextarea {\n overflow: auto;\n}\n\n[type='checkbox'],\n[type='radio'] {\n box-sizing: border-box;\n padding: 0;\n}\n\n\n[type='number']::-webkit-inner-spin-button,\n[type='number']::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type='search'] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n}\n\n[type='search']::-webkit-search-cancel-button,\n[type='search']::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n\n::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n}\n\n\ndetails,\nmenu {\n display: block;\n}\n\n\nsummary {\n display: list-item;\n}\n\n\ncanvas {\n display: inline-block;\n}\n\n\ntemplate {\n display: none;\n}\n\n\n[hidden] {\n display: none;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\n.h1,\n.h2,\n.h3,\n.h4,\n.h5,\n.h6 {\n color: ").concat(token.headingsColor, ";\n font-family: ").concat(token.headingsFontFamily, ";\n font-weight: ").concat(token.headingsFontWeight, ";\n line-height: ").concat(token.headingsLineHeight, ";\n}\nh1 small, h1 .small, .h1 small, .h1 .small,\nh2 small, h2 .small, .h2 small, .h2 .small,\nh3 small, h3 .small, .h3 small, .h3 .small,\nh4 small, h4 .small, .h4 small, .h4 .small,\nh5 small, h5 .small, .h5 small, .h5 .small,\nh6 small, h6 .small, .h6 small, .h6 .small {\n color: ").concat(token.headingsSmallColor, ";\n font-weight: normal;\n line-height: 1;\n}\n\n\nh1,\n.h1,\nh2,\n.h2,\nh3,\n.h3 {\n margin-top: ").concat(lineHeightComputed, ";\n margin-bottom: ").concat(lineHeightComputed2, ";\n}\n\nhi small, h1 .small, .h1 small, .h1 .small,\nh2 small, h2 .small, .h2 small, .h2 .small,\nh3 small, h3 .small, .h3 small, .h3 .small {\n font-size: 65%;\n}\n\nh4,\n.h4,\nh5,\n.h5,\nh6,\n.h6 {\n margin-top: ").concat(lineHeightComputed2, ";\n margin-bottom: ").concat(lineHeightComputed2, ";\n}\n\nh4 small, h4 .small, .h4 small, .h4 .small,\nh5 small, h5 .small, .h5 small, .h5 .small,\nh6 small, h6 .small, .h6 small, .h6 .small {\n font-size: 75%;\n}\n\np {\n margin: 0 0 ").concat(lineHeightComputed2, ";\n}");
33
+ function appendNormalizeStyle(styleString, id) {
34
+ var style = document.createElement('style');
35
+ style.id = id;
36
+ style.innerHTML = styleString;
37
+ document.head.appendChild(style);
38
+ }
39
+ var uniqueStyleId = 'shineout-next-normalize__' + Math.random().toString(36).substring(2, 15);
29
40
  if (typeof window !== 'undefined') {
30
- var link = document.createElement('style');
31
- link.innerHTML = css;
32
- document.head.appendChild(link);
41
+ appendNormalizeStyle(normalizeStyle, uniqueStyleId);
33
42
  }
43
+ var scopeNormalizeStyle = exports.scopeNormalizeStyle = function scopeNormalizeStyle() {
44
+ var csScopePrefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '#app';
45
+ var styleElement = document.getElementById(uniqueStyleId);
46
+ // 移除styleElement
47
+
48
+ var styleSheet = styleElement === null || styleElement === void 0 ? void 0 : styleElement.sheet;
49
+ var cssRules = styleSheet === null || styleSheet === void 0 ? void 0 : styleSheet.cssRules;
50
+ // 遍历cssRules,给每一个selectorText添加前缀
51
+ if (cssRules) {
52
+ for (var i = 0; i < cssRules.length; i++) {
53
+ var rule = cssRules[i];
54
+ if (rule instanceof CSSStyleRule) {
55
+ // 如果选择器包含了body或html,则替换,不是加前缀
56
+ if (rule.selectorText.includes('body')) {
57
+ rule.selectorText = rule.selectorText.replace('body', csScopePrefix);
58
+ } else if (rule.selectorText.includes('html')) {
59
+ rule.selectorText = rule.selectorText.replace('html', csScopePrefix);
60
+ } else {
61
+ var selectors = rule.selectorText.split(',');
62
+ var newSelectors = selectors.map(function (selector) {
63
+ return "".concat(csScopePrefix, " ").concat(selector);
64
+ });
65
+ rule.selectorText = newSelectors.join(',');
66
+ }
67
+ }
68
+ }
69
+ }
70
+ var scopedStyleString = cssRules ? Array.from(cssRules).map(function (rule) {
71
+ return rule.cssText;
72
+ }).join('') : '';
73
+ document.head.removeChild(styleElement);
74
+ appendNormalizeStyle(scopedStyleString, uniqueStyleId);
75
+ };
34
76
  (0, _theme.setToken)({
35
77
  onlyExtra: true,
36
78
  tokenName: 'shineout-extra',
package/cjs/version.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- declare const _default: "3.5.4-beta.8";
1
+ declare const _default: "3.5.4";
2
2
  export default _default;
3
3
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["version.ts"],"names":[],"mappings":";AAAA,wBAA8B"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["version.ts"],"names":[],"mappings":";AAAA,wBAAuB"}
package/cjs/version.js CHANGED
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _default = exports.default = '3.5.4-beta.8';
7
+ var _default = exports.default = '3.5.4';
@@ -1,2 +1,2 @@
1
- export {};
1
+ export declare const scopeNormalizeStyle: (csScopePrefix?: string) => void;
2
2
  //# sourceMappingURL=normalize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["normalize.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["normalize.ts"],"names":[],"mappings":"AAoYA,eAAO,MAAM,mBAAmB,kCA8B/B,CAAC"}
package/esm/normalize.js CHANGED
@@ -22,12 +22,50 @@ var token = {
22
22
  };
23
23
  var lineHeightComputed = '20px';
24
24
  var lineHeightComputed2 = '10px';
25
- var css = "*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\nhtml {\n font-family: sans-serif;\n line-height: 1.15;\n -ms-overflow-style: scrollbar;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n -webkit-text-size-adjust: 100%;\n -ms-text-size-adjust: 100%;\n}\n\narticle,\naside,\ndialog,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nnav,\nsection {\n display: block;\n}\n\nbody {\n margin: 0;\n color: ".concat(token.color, ";\n font-family: ").concat(token.fontFamily, ";\n font-size: ").concat(token.fontSize, ";\n line-height: ").concat(token.lineHeight, ";\n}\n\n\narticle,\naside,\nfooter,\nheader,\nnav,\nsection {\n display: block;\n}\n\nh1 {\n margin: 0.67em 0;\n font-size: 2em;\n}\n\nfigcaption,\nfigure,\nmain {\n display: block;\n}\n\nfigure {\n margin: 1em 40px;\n}\n\nhr {\n overflow: visible;\n height: 0;\n box-sizing: content-box;\n}\n\npre {\n font-family: \"SFMono-Regular\", Menlo, Monaco, Consolas, \"Courier New\", monospace;\n font-size: 1em;\n}\n\na {\n background-color: transparent;\n color: ").concat(token.linkColor, ";\n cursor: pointer;\n outline: none;\n text-decoration: ").concat(token.linkHoverDecoration, ";\n -webkit-text-decoration-skip: objects;\n transition: color 0.3s;\n}\n\na:active,\na:hover {\n color: ").concat(token.linkColor, ";\n outline: 0;\n text-decoration: ").concat(token.linkHoverDecoration, ";\n}\na[disabled] {\n color: ").concat(token.linkDisabledColor, ";\n cursor: not-allowed;\n pointer-events: none;\n}\n\nabbr[title] {\n border-bottom: none;\n text-decoration: underline;\n text-decoration: underline dotted;\n}\n\nb,\nstrong {\n font-weight: inherit;\n}\n\nb,\nstrong {\n font-weight: bolder;\n}\n\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace;\n font-size: 1em;\n}\n\ndfn {\n font-style: italic;\n}\n\nmark {\n background-color: #ff0;\n color: #000;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\naudio,\nvideo {\n display: inline-block;\n}\n\naudio:not([controls]) {\n display: none;\n height: 0;\n}\n\nimg {\n border-style: none;\n}\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n margin: 0;\n font-family: inherit;\n font-size: 100%;\n line-height: 1.15;\n}\n\nbutton,\ninput {\n overflow: visible;\n}\n\nbutton,\nselect {\n text-transform: none;\n}\n\nbutton,\nhtml [type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\nbutton::-moz-focus-inner,\n[type='button']::-moz-focus-inner,\n[type='reset']::-moz-focus-inner,\n[type='submit']::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\nbutton:-moz-focusring,\n[type='button']:-moz-focusring,\n[type='reset']:-moz-focusring,\n[type='submit']:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n\nlegend {\n display: table;\n max-width: 100%;\n box-sizing: border-box;\n padding: 0;\n color: inherit;\n white-space: normal;\n}\n\nprogress {\n display: inline-block;\n vertical-align: baseline;\n}\n\ntextarea {\n overflow: auto;\n}\n\n[type='checkbox'],\n[type='radio'] {\n box-sizing: border-box;\n padding: 0;\n}\n\n\n[type='number']::-webkit-inner-spin-button,\n[type='number']::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type='search'] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n}\n\n[type='search']::-webkit-search-cancel-button,\n[type='search']::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n\n::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n}\n\n\ndetails,\nmenu {\n display: block;\n}\n\n\nsummary {\n display: list-item;\n}\n\n\ncanvas {\n display: inline-block;\n}\n\n\ntemplate {\n display: none;\n}\n\n\n[hidden] {\n display: none;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\n.h1,\n.h2,\n.h3,\n.h4,\n.h5,\n.h6 {\n color: ").concat(token.headingsColor, ";\n font-family: ").concat(token.headingsFontFamily, ";\n font-weight: ").concat(token.headingsFontWeight, ";\n line-height: ").concat(token.headingsLineHeight, ";\n}\nh1 small, h1 .small, .h1 small, .h1 .small,\nh2 small, h2 .small, .h2 small, .h2 .small,\nh3 small, h3 .small, .h3 small, .h3 .small,\nh4 small, h4 .small, .h4 small, .h4 .small,\nh5 small, h5 .small, .h5 small, .h5 .small,\nh6 small, h6 .small, .h6 small, .h6 .small {\n color: ").concat(token.headingsSmallColor, ";\n font-weight: normal;\n line-height: 1;\n}\n\n\nh1,\n.h1,\nh2,\n.h2,\nh3,\n.h3 {\n margin-top: ").concat(lineHeightComputed, ";\n margin-bottom: ").concat(lineHeightComputed2, ";\n}\n\nhi small, h1 .small, .h1 small, .h1 .small,\nh2 small, h2 .small, .h2 small, .h2 .small,\nh3 small, h3 .small, .h3 small, .h3 .small {\n font-size: 65%;\n}\n\nh4,\n.h4,\nh5,\n.h5,\nh6,\n.h6 {\n margin-top: ").concat(lineHeightComputed2, ";\n margin-bottom: ").concat(lineHeightComputed2, ";\n}\n\nh4 small, h4 .small, .h4 small, .h4 .small,\nh5 small, h5 .small, .h5 small, .h5 .small,\nh6 small, h6 .small, .h6 small, .h6 .small {\n font-size: 75%;\n}\n\np {\n margin: 0 0 ").concat(lineHeightComputed2, ";\n}");
25
+ var normalizeStyle = "*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\nhtml {\n font-family: sans-serif;\n line-height: 1.15;\n -ms-overflow-style: scrollbar;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n -webkit-text-size-adjust: 100%;\n -ms-text-size-adjust: 100%;\n}\n\narticle,\naside,\ndialog,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nnav,\nsection {\n display: block;\n}\n\nbody {\n margin: 0;\n color: ".concat(token.color, ";\n font-family: ").concat(token.fontFamily, ";\n font-size: ").concat(token.fontSize, ";\n line-height: ").concat(token.lineHeight, ";\n}\n\n\narticle,\naside,\nfooter,\nheader,\nnav,\nsection {\n display: block;\n}\n\nh1 {\n margin: 0.67em 0;\n font-size: 2em;\n}\n\nfigcaption,\nfigure,\nmain {\n display: block;\n}\n\nfigure {\n margin: 1em 40px;\n}\n\nhr {\n overflow: visible;\n height: 0;\n box-sizing: content-box;\n}\n\npre {\n font-family: \"SFMono-Regular\", Menlo, Monaco, Consolas, \"Courier New\", monospace;\n font-size: 1em;\n}\n\na {\n background-color: transparent;\n color: ").concat(token.linkColor, ";\n cursor: pointer;\n outline: none;\n text-decoration: ").concat(token.linkHoverDecoration, ";\n -webkit-text-decoration-skip: objects;\n transition: color 0.3s;\n}\n\na:active,\na:hover {\n color: ").concat(token.linkColor, ";\n outline: 0;\n text-decoration: ").concat(token.linkHoverDecoration, ";\n}\na[disabled] {\n color: ").concat(token.linkDisabledColor, ";\n cursor: not-allowed;\n pointer-events: none;\n}\n\nabbr[title] {\n border-bottom: none;\n text-decoration: underline;\n text-decoration: underline dotted;\n}\n\nb,\nstrong {\n font-weight: inherit;\n}\n\nb,\nstrong {\n font-weight: bolder;\n}\n\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace;\n font-size: 1em;\n}\n\ndfn {\n font-style: italic;\n}\n\nmark {\n background-color: #ff0;\n color: #000;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\naudio,\nvideo {\n display: inline-block;\n}\n\naudio:not([controls]) {\n display: none;\n height: 0;\n}\n\nimg {\n border-style: none;\n}\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n margin: 0;\n font-family: inherit;\n font-size: 100%;\n line-height: 1.15;\n}\n\nbutton,\ninput {\n overflow: visible;\n}\n\nbutton,\nselect {\n text-transform: none;\n}\n\nbutton,\nhtml [type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\nbutton::-moz-focus-inner,\n[type='button']::-moz-focus-inner,\n[type='reset']::-moz-focus-inner,\n[type='submit']::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\nbutton:-moz-focusring,\n[type='button']:-moz-focusring,\n[type='reset']:-moz-focusring,\n[type='submit']:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n\nlegend {\n display: table;\n max-width: 100%;\n box-sizing: border-box;\n padding: 0;\n color: inherit;\n white-space: normal;\n}\n\nprogress {\n display: inline-block;\n vertical-align: baseline;\n}\n\ntextarea {\n overflow: auto;\n}\n\n[type='checkbox'],\n[type='radio'] {\n box-sizing: border-box;\n padding: 0;\n}\n\n\n[type='number']::-webkit-inner-spin-button,\n[type='number']::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type='search'] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n}\n\n[type='search']::-webkit-search-cancel-button,\n[type='search']::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n\n::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n}\n\n\ndetails,\nmenu {\n display: block;\n}\n\n\nsummary {\n display: list-item;\n}\n\n\ncanvas {\n display: inline-block;\n}\n\n\ntemplate {\n display: none;\n}\n\n\n[hidden] {\n display: none;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\n.h1,\n.h2,\n.h3,\n.h4,\n.h5,\n.h6 {\n color: ").concat(token.headingsColor, ";\n font-family: ").concat(token.headingsFontFamily, ";\n font-weight: ").concat(token.headingsFontWeight, ";\n line-height: ").concat(token.headingsLineHeight, ";\n}\nh1 small, h1 .small, .h1 small, .h1 .small,\nh2 small, h2 .small, .h2 small, .h2 .small,\nh3 small, h3 .small, .h3 small, .h3 .small,\nh4 small, h4 .small, .h4 small, .h4 .small,\nh5 small, h5 .small, .h5 small, .h5 .small,\nh6 small, h6 .small, .h6 small, .h6 .small {\n color: ").concat(token.headingsSmallColor, ";\n font-weight: normal;\n line-height: 1;\n}\n\n\nh1,\n.h1,\nh2,\n.h2,\nh3,\n.h3 {\n margin-top: ").concat(lineHeightComputed, ";\n margin-bottom: ").concat(lineHeightComputed2, ";\n}\n\nhi small, h1 .small, .h1 small, .h1 .small,\nh2 small, h2 .small, .h2 small, .h2 .small,\nh3 small, h3 .small, .h3 small, .h3 .small {\n font-size: 65%;\n}\n\nh4,\n.h4,\nh5,\n.h5,\nh6,\n.h6 {\n margin-top: ").concat(lineHeightComputed2, ";\n margin-bottom: ").concat(lineHeightComputed2, ";\n}\n\nh4 small, h4 .small, .h4 small, .h4 .small,\nh5 small, h5 .small, .h5 small, .h5 .small,\nh6 small, h6 .small, .h6 small, .h6 .small {\n font-size: 75%;\n}\n\np {\n margin: 0 0 ").concat(lineHeightComputed2, ";\n}");
26
+ function appendNormalizeStyle(styleString, id) {
27
+ var style = document.createElement('style');
28
+ style.id = id;
29
+ style.innerHTML = styleString;
30
+ document.head.appendChild(style);
31
+ }
32
+ var uniqueStyleId = 'shineout-next-normalize__' + Math.random().toString(36).substring(2, 15);
26
33
  if (typeof window !== 'undefined') {
27
- var link = document.createElement('style');
28
- link.innerHTML = css;
29
- document.head.appendChild(link);
34
+ appendNormalizeStyle(normalizeStyle, uniqueStyleId);
30
35
  }
36
+ export var scopeNormalizeStyle = function scopeNormalizeStyle() {
37
+ var csScopePrefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '#app';
38
+ var styleElement = document.getElementById(uniqueStyleId);
39
+ // 移除styleElement
40
+
41
+ var styleSheet = styleElement === null || styleElement === void 0 ? void 0 : styleElement.sheet;
42
+ var cssRules = styleSheet === null || styleSheet === void 0 ? void 0 : styleSheet.cssRules;
43
+ // 遍历cssRules,给每一个selectorText添加前缀
44
+ if (cssRules) {
45
+ for (var i = 0; i < cssRules.length; i++) {
46
+ var rule = cssRules[i];
47
+ if (rule instanceof CSSStyleRule) {
48
+ // 如果选择器包含了body或html,则替换,不是加前缀
49
+ if (rule.selectorText.includes('body')) {
50
+ rule.selectorText = rule.selectorText.replace('body', csScopePrefix);
51
+ } else if (rule.selectorText.includes('html')) {
52
+ rule.selectorText = rule.selectorText.replace('html', csScopePrefix);
53
+ } else {
54
+ var selectors = rule.selectorText.split(',');
55
+ var newSelectors = selectors.map(function (selector) {
56
+ return "".concat(csScopePrefix, " ").concat(selector);
57
+ });
58
+ rule.selectorText = newSelectors.join(',');
59
+ }
60
+ }
61
+ }
62
+ }
63
+ var scopedStyleString = cssRules ? Array.from(cssRules).map(function (rule) {
64
+ return rule.cssText;
65
+ }).join('') : '';
66
+ document.head.removeChild(styleElement);
67
+ appendNormalizeStyle(scopedStyleString, uniqueStyleId);
68
+ };
31
69
  setToken({
32
70
  onlyExtra: true,
33
71
  tokenName: 'shineout-extra',
package/esm/version.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- declare const _default: "3.5.4-beta.8";
1
+ declare const _default: "3.5.4";
2
2
  export default _default;
3
3
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["version.ts"],"names":[],"mappings":";AAAA,wBAA8B"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["version.ts"],"names":[],"mappings":";AAAA,wBAAuB"}
package/esm/version.js CHANGED
@@ -1 +1 @@
1
- export default '3.5.4-beta.8';
1
+ export default '3.5.4';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/shineout-style",
3
- "version": "3.5.4-beta.8",
3
+ "version": "3.5.4",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -17,8 +17,8 @@
17
17
  "dependencies": {
18
18
  "jss": "10.9.2",
19
19
  "react-jss": "10.9.2",
20
- "@sheinx/theme": "3.5.4-beta.8",
21
- "@sheinx/base": "3.5.4-beta.8"
20
+ "@sheinx/theme": "3.5.4",
21
+ "@sheinx/base": "3.5.4"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "core-js": ">=3"