Skip to content

Commit

Permalink
fix: injectGlobalStyle missing nil value
Browse files Browse the repository at this point in the history
  • Loading branch information
nonzzz committed May 6, 2024
1 parent 9613874 commit 32a9d93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { expression } from './expression.stylex'

export const styles = injectGlobalStyle({
html: {
fontSize: expression.font
fontSize: expression.font,
padding: 0
}
})
3 changes: 2 additions & 1 deletion packages/babel-plugin/src/visitor/global-style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class Stringify {
} else {
for (const selector in rule) {
const content = rule[selector]
if (!content) continue
// In css only `null` and `undefined` are considered as falsy values
if (typeof content === 'undefined' || typeof content === 'object' && !content) continue
if (typeof content === 'object') {
this.print(selector)
this.print('{')
Expand Down

0 comments on commit 32a9d93

Please sign in to comment.