diff --git a/packages/tailwindcss/src/plugin-api.ts b/packages/tailwindcss/src/plugin-api.ts index 7ef13aff9..143765321 100644 --- a/packages/tailwindcss/src/plugin-api.ts +++ b/packages/tailwindcss/src/plugin-api.ts @@ -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 }