mp-darkmode 1.2.3-beta.1 → 1.2.3-beta.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/darkmode.js +8 -6
- package/dist/darkmode.js.map +1 -1
- package/dist/darkmode.min.js +1 -1
- package/package.json +1 -1
package/dist/darkmode.js
CHANGED
|
@@ -2479,7 +2479,7 @@ var switchToDarkmode = function switchToDarkmode(mqlObj) {
|
|
|
2479
2479
|
typeof bg.cb === 'function' && bg.cb(bg);
|
|
2480
2480
|
|
|
2481
2481
|
// 还得处理该背景下的所有新老节点
|
|
2482
|
-
[bg.elOld, bg.el].forEach(function (el
|
|
2482
|
+
[bg.elOld, bg.el].forEach(function (el) {
|
|
2483
2483
|
var _el$COLORATTR, _el$BGCOLORATTR, _el$ORIGINAL_COLORATT, _el$ORIGINAL_BGCOLORA, _el$BGIMAGEATTR, _el$COMPLEMENTARY_BGI;
|
|
2484
2484
|
var inheritAttrs = [[_modules_constant__WEBPACK_IMPORTED_MODULE_0__["COLORATTR"], (_el$COLORATTR = el[_modules_constant__WEBPACK_IMPORTED_MODULE_0__["COLORATTR"]]) !== null && _el$COLORATTR !== void 0 ? _el$COLORATTR : null], [_modules_constant__WEBPACK_IMPORTED_MODULE_0__["BGCOLORATTR"], (_el$BGCOLORATTR = el[_modules_constant__WEBPACK_IMPORTED_MODULE_0__["BGCOLORATTR"]]) !== null && _el$BGCOLORATTR !== void 0 ? _el$BGCOLORATTR : null], [_modules_constant__WEBPACK_IMPORTED_MODULE_0__["ORIGINAL_COLORATTR"], (_el$ORIGINAL_COLORATT = el[_modules_constant__WEBPACK_IMPORTED_MODULE_0__["ORIGINAL_COLORATTR"]]) !== null && _el$ORIGINAL_COLORATT !== void 0 ? _el$ORIGINAL_COLORATT : null], [_modules_constant__WEBPACK_IMPORTED_MODULE_0__["ORIGINAL_BGCOLORATTR"], (_el$ORIGINAL_BGCOLORA = el[_modules_constant__WEBPACK_IMPORTED_MODULE_0__["ORIGINAL_BGCOLORATTR"]]) !== null && _el$ORIGINAL_BGCOLORA !== void 0 ? _el$ORIGINAL_BGCOLORA : null], [_modules_constant__WEBPACK_IMPORTED_MODULE_0__["BGIMAGEATTR"], (_el$BGIMAGEATTR = el[_modules_constant__WEBPACK_IMPORTED_MODULE_0__["BGIMAGEATTR"]]) !== null && _el$BGIMAGEATTR !== void 0 ? _el$BGIMAGEATTR : null], [_modules_constant__WEBPACK_IMPORTED_MODULE_0__["COMPLEMENTARY_BGIMAGECOLORATTR"], (_el$COMPLEMENTARY_BGI = el[_modules_constant__WEBPACK_IMPORTED_MODULE_0__["COMPLEMENTARY_BGIMAGECOLORATTR"]]) !== null && _el$COMPLEMENTARY_BGI !== void 0 ? _el$COMPLEMENTARY_BGI : null]];
|
|
2485
2485
|
var children = Object(_modules_domUtils__WEBPACK_IMPORTED_MODULE_3__["getChildrenAndIt"])(el, true);
|
|
@@ -2496,8 +2496,8 @@ var switchToDarkmode = function switchToDarkmode(mqlObj) {
|
|
|
2496
2496
|
}
|
|
2497
2497
|
});
|
|
2498
2498
|
});
|
|
2499
|
-
|
|
2500
|
-
//
|
|
2499
|
+
children.forEach(function (child) {
|
|
2500
|
+
// 重新运行Dark Mode处理逻辑
|
|
2501
2501
|
_modules_global__WEBPACK_IMPORTED_MODULE_2__["cssUtils"].addCss(_modules_global__WEBPACK_IMPORTED_MODULE_2__["sdk"].convert(child, undefined, false, true));
|
|
2502
2502
|
});
|
|
2503
2503
|
});
|
|
@@ -4323,9 +4323,11 @@ var SDK = /*#__PURE__*/function () {
|
|
|
4323
4323
|
});
|
|
4324
4324
|
} else {
|
|
4325
4325
|
// 否则背景图入栈
|
|
4326
|
-
_global__WEBPACK_IMPORTED_MODULE_4__["bgStack"].push(el, tmpCssKvStr, function () {
|
|
4327
|
-
|
|
4328
|
-
|
|
4326
|
+
_global__WEBPACK_IMPORTED_MODULE_4__["bgStack"].push(el, tmpCssKvStr, function (bgStackItem) {
|
|
4327
|
+
[bgStackItem.elOld, bgStackItem.el].forEach(function (bgEl) {
|
|
4328
|
+
Object(_domUtils__WEBPACK_IMPORTED_MODULE_5__["getChildrenAndIt"])(bgEl).forEach(function (dom) {
|
|
4329
|
+
dom[_constant__WEBPACK_IMPORTED_MODULE_2__["COMPLEMENTARY_BGIMAGECOLORATTR"]] = imgBgColor || newValue;
|
|
4330
|
+
});
|
|
4329
4331
|
});
|
|
4330
4332
|
});
|
|
4331
4333
|
}
|