mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2026-02-01 17:26:34 +00:00
Don't mutate variants in user's config
This commit is contained in:
parent
7e1113561a
commit
f5e8c74639
@ -836,6 +836,9 @@ test('the original theme is not mutated', () => {
|
||||
},
|
||||
},
|
||||
},
|
||||
variants: {
|
||||
borderColor: ['responsive', 'hover'],
|
||||
}
|
||||
}
|
||||
|
||||
const defaultConfig = {
|
||||
@ -850,7 +853,7 @@ test('the original theme is not mutated', () => {
|
||||
},
|
||||
},
|
||||
variants: {
|
||||
borderColor: ['responsive', 'hover', 'focus'],
|
||||
backgroundColor: ['responsive', 'hover', 'focus'],
|
||||
},
|
||||
}
|
||||
|
||||
@ -864,5 +867,8 @@ test('the original theme is not mutated', () => {
|
||||
},
|
||||
},
|
||||
},
|
||||
variants: {
|
||||
borderColor: ['responsive', 'hover'],
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@ -39,7 +39,7 @@ export default function resolveConfig(configs) {
|
||||
return defaults(
|
||||
{
|
||||
theme: resolveFunctionKeys(mergeExtensions(defaults({}, ...map(configs, 'theme')))),
|
||||
variants: defaults(...map(configs, 'variants')),
|
||||
variants: defaults({}, ...map(configs, 'variants')),
|
||||
},
|
||||
...configs
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user