diff --git a/src/defaultPlugins.js b/src/defaultPlugins.js index 6b179b223..509b39940 100644 --- a/src/defaultPlugins.js +++ b/src/defaultPlugins.js @@ -1,3 +1,4 @@ +import display from './plugins/display' import flexbox from './plugins/flexbox' import float from './plugins/float' import fonts from './plugins/fonts' @@ -37,6 +38,7 @@ import zIndex from './plugins/zIndex' export default function (config) { return [ + config.modules.display === false ? () => {} : display(), config.modules.flexbox === false ? () => {} : flexbox(), config.modules.float === false ? () => {} : float(), config.modules.fonts === false ? () => {} : fonts(), diff --git a/src/generators/display.js b/src/generators/display.js deleted file mode 100644 index 93f04f169..000000000 --- a/src/generators/display.js +++ /dev/null @@ -1,27 +0,0 @@ -import defineClasses from '../util/defineClasses' - -export default function() { - return defineClasses({ - block: { - display: 'block', - }, - 'inline-block': { - display: 'inline-block', - }, - inline: { - display: 'inline', - }, - table: { - display: 'table', - }, - 'table-row': { - display: 'table-row', - }, - 'table-cell': { - display: 'table-cell', - }, - hidden: { - display: 'none', - }, - }) -} diff --git a/src/plugins/display.js b/src/plugins/display.js new file mode 100644 index 000000000..a843f0a63 --- /dev/null +++ b/src/plugins/display.js @@ -0,0 +1,27 @@ +export default function () { + return function ({ addUtilities, config }) { + addUtilities({ + '.block': { + display: 'block', + }, + '.inline-block': { + display: 'inline-block', + }, + '.inline': { + display: 'inline', + }, + '.table': { + display: 'table', + }, + '.table-row': { + display: 'table-row', + }, + '.table-cell': { + display: 'table-cell', + }, + '.hidden': { + display: 'none', + }, + }, config('modules.display')) + } +} diff --git a/src/utilityModules.js b/src/utilityModules.js index 1999cdd48..48edcb3d1 100644 --- a/src/utilityModules.js +++ b/src/utilityModules.js @@ -11,7 +11,6 @@ import borderRadius from './generators/borderRadius' import borderStyle from './generators/borderStyle' import borderWidths from './generators/borderWidths' import cursor from './generators/cursor' -import display from './generators/display' export default [ { name: 'lists', generator: lists }, @@ -27,5 +26,4 @@ export default [ { name: 'borderStyle', generator: borderStyle }, { name: 'borderWidths', generator: borderWidths }, { name: 'cursor', generator: cursor }, - { name: 'display', generator: display }, ]