Skip to content

Commit 6b4ebca

Browse files
committed
Improve rule filtering
1 parent 5ee52c7 commit 6b4ebca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Generator.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ export function cssToHtml(css: CSSRuleList | string, options: Options = {}): HTM
3131
for (const [index, rule] of Object.entries(styleRules) as [string, (CSSStyleRule | CSSMediaRule)][]) {
3232
// Skip:
3333
// - Media rules.
34-
// - Rules starting with `*`.
3534
// - Rules including `:`.
35+
// - Rules including with `*`.
3636
if (
37-
rule instanceof CSSMediaRule
38-
|| rule.selectorText.startsWith('*')
3937
|| rule.selectorText.includes(':')
38+
!(rule instanceof CSSStyleRule)
39+
|| rule.selectorText.includes('*')
4040
) {
4141
continue;
4242
}

0 commit comments

Comments
 (0)