Skip to content

Commit dc8f3f0

Browse files
committed
Fix use of falsy values in theme config
1 parent fc6c27d commit dc8f3f0

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

src/util/pluginUtils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export function coerceValue(types, modifier, options, tailwindConfig) {
185185
// Find first matching type
186186
for (let type of [].concat(types)) {
187187
let result = typeMap[type](modifier, options, { tailwindConfig })
188-
if (result) return [result, type]
188+
if (result !== undefined) return [result, type]
189189
}
190190

191191
return []

tests/basic-usage.test.js

+28
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,31 @@ test('per-plugin colors with the same key can differ when using a custom colors
109109
`)
110110
})
111111
})
112+
113+
it('fasly config values still work', () => {
114+
let config = {
115+
content: [{raw: html`<div class="inset-0"></div>`}],
116+
theme: {
117+
inset: {
118+
0: 0,
119+
},
120+
},
121+
plugins: [],
122+
corePlugins: { preflight: false },
123+
}
124+
125+
let input = css`
126+
@tailwind utilities;
127+
`
128+
129+
return run(input, config).then((result) => {
130+
expect(result.css).toMatchFormattedCss(css`
131+
.inset-0 {
132+
top: 0;
133+
right: 0;
134+
bottom: 0;
135+
left: 0;
136+
}
137+
`)
138+
})
139+
})

0 commit comments

Comments
 (0)