🐛 fix IE bug that cssText cannot be accessed while it prefixing with -webkit (#2532)

This commit is contained in:
aique.li 2023-06-28 12:12:27 +08:00 committed by GitHub
parent c007c702da
commit becb7ada77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,7 +102,10 @@ export class ScopedCSS {
css += this.ruleSupport(rule as CSSSupportsRule, prefix);
break;
default:
css += `${rule.cssText}`;
if (typeof rule.cssText === 'string') {
css += `${rule.cssText}`;
}
break;
}
});
@ -121,7 +124,11 @@ export class ScopedCSS {
const selector = rule.selectorText.trim();
let { cssText } = rule;
let cssText = '';
if (typeof rule.cssText === 'string') {
cssText = rule.cssText;
}
// handle html { ... }
// handle body { ... }
// handle :root { ... }