Skip to content

Commit

Permalink
fix(css): merge media query rules
Browse files Browse the repository at this point in the history
  • Loading branch information
juanrgm committed Mar 12, 2023
1 parent f0aac7a commit 51c5ade
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/dirty-hotels-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@suid/css": patch
---

Merge media query rules
6 changes: 5 additions & 1 deletion packages/css/src/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ function resolve(
} else {
const result = onProp(name, value);
if (result) {
Object.assign(cssTarget, result);
for (const key in result) {
cssTarget[key] = isMediaQuery(key)
? { ...cssTarget[key], ...result[key] }
: result[key];
}
} else {
cssTarget[name] = value;
}
Expand Down

0 comments on commit 51c5ade

Please sign in to comment.