Skip to content

Commit

Permalink
fix: expand on shadowDom support
Browse files Browse the repository at this point in the history
  • Loading branch information
darlanalves authored Aug 29, 2024
1 parent 6679ba8 commit 1a90725
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions server/presets.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ const getPresetPath = (name) => join(CWD, "systems", name + ".yml");
const each = (v) => (!v ? [] : Object.entries(v));

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

function generateComponentParts(name, def, separator) {
Expand Down Expand Up @@ -56,10 +58,7 @@ function defineComponent(name, def, useShadowDom) {
generateComponentParts(name, def.states, ":"),
];

return all
.map(expandRules)
.flat(2)
.join("");
return all.map(expandRules).flat(2).join("");
}

function generateCssSafelist(presets) {
Expand Down

0 comments on commit 1a90725

Please sign in to comment.