Skip to content

Commit 6e15ba8

Browse files
authored
fixes #18: nested props are ignored if the first one is undefined (#19)
1 parent 257361d commit 6e15ba8

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ module.exports = (UserProps) => {
127127

128128
// warn if props won't resolve from plugin
129129
if (!value) {
130-
return
130+
continue
131131
}
132132

133133
// create and append prop to :root

index.test.js

+16
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,22 @@ a {
111111
)
112112
})
113113

114+
it('Can jit a single, undefined prop that has fallbacks and nested props', async () => {
115+
await run(
116+
`a {
117+
color: var(--orange, var(--pink), hotpink);
118+
}`,
119+
`:root {
120+
--pink: #ffc0cb;
121+
}
122+
a {
123+
color: var(--orange, var(--pink), hotpink);
124+
}`,
125+
MockProps
126+
)
127+
})
128+
129+
114130
it('Can jit a single prop with spaces that has fallbacks and nested props', async () => {
115131
await run(
116132
`a {

0 commit comments

Comments
 (0)