Tailwindcss: Ability to only enable specific core plugins

Created on 17 Apr 2019  路  6Comments  路  Source: tailwindlabs/tailwindcss

Right now you can disable all core plugins with corePlugins: false (thank you @adamwathan!) but as Adam said, it would be useful to have a "whitelisting" option to only enable one or a few core plugins in particular, without worrying that a Tailwind update might change the code's behaviour by introducing new core plugins.

An idea, perhaps the corePlugins option could take accept an object formatted like this:

corePlugins: {
    only: [
        'backgroundColor',
        'textColor',
    ],
}

All 6 comments

Would it make sense to also add a "blacklisting" option?

@hacknug All core plugins are enabled by default, so to blacklist you only have to do:

corePlugins: {
    'backgroundColor': false,
    'textColor': false,
}

Silly me. I keep mixing the old and new configs structures in my head haha

What about just an array?

corePlugins: [
  'backgroundColor',
  'textColor',
]

@adamwathan Oh yeah, that鈥檚 much better haha.

Solved in #853.

Was this page helpful?
0 / 5 - 0 ratings