mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Use existing parameter
This commit is contained in:
parent
8ff2b59096
commit
2342d72c5e
@ -2,7 +2,6 @@ import mergeWith from 'lodash/mergeWith'
|
||||
import isFunction from 'lodash/isFunction'
|
||||
import defaults from 'lodash/defaults'
|
||||
import map from 'lodash/map'
|
||||
import get from 'lodash/get'
|
||||
|
||||
function resolveFunctionKeys(object) {
|
||||
return Object.keys(object).reduce((resolved, key) => {
|
||||
@ -18,15 +17,15 @@ function without(object, key) {
|
||||
}
|
||||
|
||||
function mergeExtensions(theme) {
|
||||
return mergeWith({}, without(theme, 'extend'), theme.extend, (_, value, key) => {
|
||||
return mergeWith({}, without(theme, 'extend'), theme.extend, (_, extensions, key) => {
|
||||
return isFunction(theme[key])
|
||||
? mergedTheme => ({
|
||||
...theme[key](mergedTheme),
|
||||
...get(theme.extend, key, {})
|
||||
...extensions
|
||||
})
|
||||
: {
|
||||
...theme[key],
|
||||
...get(theme.extend, key, {}),
|
||||
...extensions,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user