Skip to content

Commit e66110e

Browse files
committed
Remove non-obvious unreachable code, add test
1 parent fb89b3c commit e66110e

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

src/util/pluginUtils.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,6 @@ export function coerceValue(types, modifier, options, tailwindConfig) {
216216

217217
return [result, type, null]
218218
}
219-
220-
return [options.values[modifier], 'lookup', null]
221219
}
222220

223221
if (isArbitraryValue(modifier)) {

tests/match-utilities.test.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,3 +504,34 @@ test('matching utilities with a lookup value that looks like a configured value
504504
`)
505505
})
506506
})
507+
508+
test('matching utilities with a lookup value that does not match the configured type', () => {
509+
let config = {
510+
content: [{ raw: html`<div class="test-foo"></div>` }],
511+
theme: {},
512+
plugins: [
513+
function ({ matchUtilities }) {
514+
matchUtilities(
515+
{
516+
test: (value, { modifier }) => ({ value, modifier }),
517+
},
518+
{
519+
values: {
520+
foo: 'not-a-percentage',
521+
},
522+
type: ['percentage'],
523+
}
524+
)
525+
},
526+
],
527+
corePlugins: [],
528+
}
529+
530+
return run('@tailwind utilities', config).then((result) => {
531+
expect(result.css).toMatchCss(css`
532+
.test-foo {
533+
value: not-a-percentage;
534+
}
535+
`)
536+
})
537+
})

0 commit comments

Comments
 (0)