Add corePlugins function to plugin API

This commit is contained in:
Adam Wathan 2020-05-01 14:41:12 -04:00
parent c2b0407ffd
commit 652100e2d5
2 changed files with 63 additions and 0 deletions

View file

@ -41,6 +41,13 @@ export default function(plugins, config) {
postcss,
config: getConfigValue,
theme: (path, defaultValue) => getConfigValue(`theme.${path}`, defaultValue),
corePlugins: path => {
if (Array.isArray(config.corePlugins)) {
return config.corePlugins.includes(path)
}
return getConfigValue(`corePlugins.${path}`, true)
},
variants: (path, defaultValue) => {
if (Array.isArray(config.variants)) {
return config.variants