ensure we also check wether the modifier exists in the modifiers object
Before we were just checking if the `modifiers` option is `any` or an object, without actually checking that in case it is an object, the value actually existed.
This commit is contained in:
parent
1445aafd3f
commit
0bbca33a85
1 changed files with 10 additions and 4 deletions
|
|
@ -233,14 +233,20 @@ export function coerceValue(types, modifier, options, tailwindConfig) {
|
|||
export function* getMatchingTypes(types, rawModifier, options, tailwindConfig) {
|
||||
let modifiersEnabled = flagEnabled(tailwindConfig, 'generalizedModifiers')
|
||||
|
||||
let [modifier, utilityModifier] = splitUtilityModifier(rawModifier)
|
||||
|
||||
let canUseUtilityModifier =
|
||||
modifiersEnabled &&
|
||||
options.modifiers != null &&
|
||||
(options.modifiers === 'any' || typeof options.modifiers === 'object')
|
||||
(options.modifiers === 'any' ||
|
||||
(typeof options.modifiers === 'object' &&
|
||||
((utilityModifier && isArbitraryValue(utilityModifier)) ||
|
||||
utilityModifier in options.modifiers)))
|
||||
|
||||
let [modifier, utilityModifier] = canUseUtilityModifier
|
||||
? splitUtilityModifier(rawModifier)
|
||||
: [rawModifier, undefined]
|
||||
if (!canUseUtilityModifier) {
|
||||
modifier = rawModifier
|
||||
utilityModifier = undefined
|
||||
}
|
||||
|
||||
if (utilityModifier !== undefined && modifier === '') {
|
||||
modifier = 'DEFAULT'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue