Don't handle preflight separately in corePlugins

If we do, we have to handle disabling/custom configuration separately too, which we don't want.

This really suggests I should prioritize adding a more black-box level test for this part of the codebase.
This commit is contained in:
Adam Wathan 2019-02-07 15:31:11 -05:00
parent a9a0cf03e5
commit 9a3eee5afc

View File

@ -53,7 +53,7 @@ import zIndex from './plugins/zIndex'
import _ from 'lodash'
import configurePlugins from './util/configurePlugins'
function loadUtilityPlugins({ theme, variants, corePlugins: userCorePluginConfig }, plugins) {
function loadPlugins({ theme, variants, corePlugins }, plugins) {
const defaultCorePluginConfig = _.fromPairs(
Object.keys(plugins).map(plugin => [
plugin,
@ -64,63 +64,61 @@ function loadUtilityPlugins({ theme, variants, corePlugins: userCorePluginConfig
])
)
return configurePlugins(plugins, userCorePluginConfig, defaultCorePluginConfig)
return configurePlugins(plugins, corePlugins, defaultCorePluginConfig)
}
export default function(config) {
return [
preflight(),
...loadUtilityPlugins(config, {
lists,
appearance,
backgroundAttachment,
backgroundColors,
backgroundPosition,
backgroundRepeat,
backgroundSize,
borderCollapse,
borderColors,
borderRadius,
borderStyle,
borderWidths,
cursor,
display,
flexbox,
float,
fonts,
fontWeights,
height,
leading,
margin,
maxHeight,
maxWidth,
minHeight,
minWidth,
negativeMargin,
objectFit,
objectPosition,
opacity,
outline,
overflow,
padding,
pointerEvents,
position,
resize,
shadows,
svgFill,
svgStroke,
tableLayout,
textAlign,
textColors,
textSizes,
textStyle,
tracking,
userSelect,
verticalAlign,
visibility,
whitespace,
width,
zIndex,
}),
]
return loadPlugins(config, {
preflight,
lists,
appearance,
backgroundAttachment,
backgroundColors,
backgroundPosition,
backgroundRepeat,
backgroundSize,
borderCollapse,
borderColors,
borderRadius,
borderStyle,
borderWidths,
cursor,
display,
flexbox,
float,
fonts,
fontWeights,
height,
leading,
margin,
maxHeight,
maxWidth,
minHeight,
minWidth,
negativeMargin,
objectFit,
objectPosition,
opacity,
outline,
overflow,
padding,
pointerEvents,
position,
resize,
shadows,
svgFill,
svgStroke,
tableLayout,
textAlign,
textColors,
textSizes,
textStyle,
tracking,
userSelect,
verticalAlign,
visibility,
whitespace,
width,
zIndex,
})
}