Skip to content

Commit 1a90725

Browse files
authored
fix: expand on shadowDom support
1 parent 6679ba8 commit 1a90725

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

server/presets.mjs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ const getPresetPath = (name) => join(CWD, "systems", name + ".yml");
1414
const each = (v) => (!v ? [] : Object.entries(v));
1515

1616
function expandRules(items) {
17-
return items.map(item => item[0] + `{\n @apply ${item[1]} ;\n}\n`)
17+
return items
18+
.map((item) => (item ? item[0] + `{\n @apply ${item[1]} ;\n}\n` : ""))
19+
.filter(Boolean);
1820
}
1921

2022
function generateComponentParts(name, def, separator) {
@@ -56,10 +58,7 @@ function defineComponent(name, def, useShadowDom) {
5658
generateComponentParts(name, def.states, ":"),
5759
];
5860

59-
return all
60-
.map(expandRules)
61-
.flat(2)
62-
.join("");
61+
return all.map(expandRules).flat(2).join("");
6362
}
6463

6564
function generateCssSafelist(presets) {

0 commit comments

Comments
 (0)