mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Remove non-obvious unreachable code, add test
This commit is contained in:
parent
fb89b3c8a7
commit
e66110e6a3
@ -216,8 +216,6 @@ export function coerceValue(types, modifier, options, tailwindConfig) {
|
||||
|
||||
return [result, type, null]
|
||||
}
|
||||
|
||||
return [options.values[modifier], 'lookup', null]
|
||||
}
|
||||
|
||||
if (isArbitraryValue(modifier)) {
|
||||
|
||||
@ -504,3 +504,34 @@ test('matching utilities with a lookup value that looks like a configured value
|
||||
`)
|
||||
})
|
||||
})
|
||||
|
||||
test('matching utilities with a lookup value that does not match the configured type', () => {
|
||||
let config = {
|
||||
content: [{ raw: html`<div class="test-foo"></div>` }],
|
||||
theme: {},
|
||||
plugins: [
|
||||
function ({ matchUtilities }) {
|
||||
matchUtilities(
|
||||
{
|
||||
test: (value, { modifier }) => ({ value, modifier }),
|
||||
},
|
||||
{
|
||||
values: {
|
||||
foo: 'not-a-percentage',
|
||||
},
|
||||
type: ['percentage'],
|
||||
}
|
||||
)
|
||||
},
|
||||
],
|
||||
corePlugins: [],
|
||||
}
|
||||
|
||||
return run('@tailwind utilities', config).then((result) => {
|
||||
expect(result.css).toMatchCss(css`
|
||||
.test-foo {
|
||||
value: not-a-percentage;
|
||||
}
|
||||
`)
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user