From ef833125e6c3891ae4cc45be085bef7301e1a483 Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Tue, 5 Feb 2019 13:36:41 -0500 Subject: [PATCH] Use configurePlugins when loading core plugins --- src/corePlugins.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/corePlugins.js b/src/corePlugins.js index 777ba80cf..66782520b 100644 --- a/src/corePlugins.js +++ b/src/corePlugins.js @@ -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) {