mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Add test to document extend is not deeply merged
This commit is contained in:
parent
d95d28eec8
commit
e1dd08dad3
@ -655,3 +655,73 @@ test('theme values in the extend section can extend values that are depended on
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
test('theme values in the extend section are not deeply merged', () => {
|
||||
const userConfig = {
|
||||
theme: {
|
||||
extend: {
|
||||
fonts: {
|
||||
sans: [
|
||||
'Comic Sans',
|
||||
],
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
const defaultConfig = {
|
||||
prefix: '-',
|
||||
important: false,
|
||||
separator: ':',
|
||||
theme: {
|
||||
fonts: {
|
||||
sans: [
|
||||
'system-ui',
|
||||
'Helvetica Neue',
|
||||
'sans-serif',
|
||||
],
|
||||
serif: [
|
||||
'Constantia',
|
||||
'Georgia',
|
||||
'serif',
|
||||
],
|
||||
mono: [
|
||||
'Menlo',
|
||||
'Courier New',
|
||||
'monospace',
|
||||
],
|
||||
},
|
||||
},
|
||||
variants: {
|
||||
fonts: ['responsive'],
|
||||
},
|
||||
}
|
||||
|
||||
const result = resolveConfig([userConfig, defaultConfig])
|
||||
|
||||
expect(result).toEqual({
|
||||
prefix: '-',
|
||||
important: false,
|
||||
separator: ':',
|
||||
theme: {
|
||||
fonts: {
|
||||
sans: [
|
||||
'Comic Sans',
|
||||
],
|
||||
serif: [
|
||||
'Constantia',
|
||||
'Georgia',
|
||||
'serif',
|
||||
],
|
||||
mono: [
|
||||
'Menlo',
|
||||
'Courier New',
|
||||
'monospace',
|
||||
],
|
||||
},
|
||||
},
|
||||
variants: {
|
||||
fonts: ['responsive'],
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user