Support fractional bare values
This commit is contained in:
parent
35eb103b8d
commit
1c4a8260df
1 changed files with 4 additions and 1 deletions
|
|
@ -140,6 +140,7 @@ export function buildPluginApi(
|
|||
|
||||
// Resolve the candidate value
|
||||
let value: string | null = null
|
||||
let isFraction = false
|
||||
|
||||
{
|
||||
let values = options?.values ?? {}
|
||||
|
|
@ -165,6 +166,8 @@ export function buildPluginApi(
|
|||
value = values[candidate.value.value]
|
||||
} else if (values.__BARE_VALUE__) {
|
||||
value = values.__BARE_VALUE__(candidate.value) ?? null
|
||||
|
||||
isFraction = (candidate.value.fraction !== null && value?.includes('/')) ?? false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -190,7 +193,7 @@ export function buildPluginApi(
|
|||
}
|
||||
|
||||
// A modifier was provided but is invalid
|
||||
if (candidate.modifier && modifier === null) {
|
||||
if (candidate.modifier && modifier === null && !isFraction) {
|
||||
// For arbitrary values, return `null` to avoid falling through to the next utility
|
||||
return candidate.value?.kind === 'arbitrary' ? null : undefined
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue