Use configurePlugins when loading core plugins
This commit is contained in:
parent
4c2be2ac2c
commit
ef833125e6
1 changed files with 11 additions and 6 deletions
|
|
@ -49,15 +49,20 @@ import whitespace from './plugins/whitespace'
|
|||
import width from './plugins/width'
|
||||
import zIndex from './plugins/zIndex'
|
||||
|
||||
import _ from 'lodash'
|
||||
import configurePlugins from './util/configurePlugins'
|
||||
|
||||
function loadPlugins({ theme, variants, corePlugins }, plugins) {
|
||||
return Object.keys(plugins)
|
||||
.filter(plugin => corePlugins[plugin] !== false)
|
||||
.map(plugin =>
|
||||
plugins[plugin]({
|
||||
const defaultCorePluginConfig = _.fromPairs(Object.keys(plugins)
|
||||
.map(plugin => [
|
||||
plugin,
|
||||
{
|
||||
values: theme[plugin],
|
||||
variants: variants[plugin],
|
||||
})
|
||||
)
|
||||
}
|
||||
]))
|
||||
|
||||
return configurePlugins(plugins, corePlugins, defaultCorePluginConfig)
|
||||
}
|
||||
|
||||
export default function(config) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue