Skip to content

Commit

Permalink
Move modules outside of styles to top level key
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwathan committed Feb 1, 2019
1 parent 95bb283 commit c56ae6c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 37 deletions.
47 changes: 13 additions & 34 deletions defaultConfig.stub.js
Original file line number Diff line number Diff line change
Expand Up @@ -750,27 +750,20 @@ const styles = {
svgStroke: {
current: 'currentColor',
},
}

/*
|-----------------------------------------------------------------------------
| Modules https://tailwindcss.com/docs/configuration#modules
|-----------------------------------------------------------------------------
|
| Here is where you control which modules are generated and what variants are
| generated for each of those modules.
|
| Currently supported variants:
| - responsive
| - hover
| - focus
| - focus-within
| - active
| - group-hover
|
| To disable a module completely, use `false` instead of an array.
|
*/

module.exports = {
prefix: '',
important: false,
separator: ':',
colors: colors,
screens: {
'sm': '576px',
'md': '768px',
'lg': '992px',
'xl': '1200px',
},
styles: styles,
modules: {
appearance: ['responsive'],
backgroundAttachment: ['responsive'],
Expand Down Expand Up @@ -823,20 +816,6 @@ const styles = {
width: ['responsive'],
zIndex: ['responsive'],
},
}

module.exports = {
prefix: '',
important: false,
separator: ':',
colors: colors,
screens: {
'sm': '576px',
'md': '768px',
'lg': '992px',
'xl': '1200px',
},
styles: styles,
plugins: [
require('./plugins/container')({
// center: true,
Expand Down
6 changes: 3 additions & 3 deletions src/corePlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ import whitespace from './plugins/whitespace'
import width from './plugins/width'
import zIndex from './plugins/zIndex'

function loadPlugins({ styles }, plugins) {
function loadPlugins({ styles, modules }, plugins) {
return Object.keys(plugins)
.filter(plugin => styles.modules[plugin] !== false)
.filter(plugin => modules[plugin] !== false)
.map(plugin => plugins[plugin]({
values: styles[plugin],
variants: styles.modules[plugin],
variants: modules[plugin],
}))
}

Expand Down

0 comments on commit c56ae6c

Please sign in to comment.