Port display module to plugin
This commit is contained in:
parent
fd1729ec81
commit
a493ee420d
4 changed files with 29 additions and 29 deletions
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
},
|
||||
})
|
||||
}
|
||||
27
src/plugins/display.js
Normal file
27
src/plugins/display.js
Normal file
|
|
@ -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'))
|
||||
}
|
||||
}
|
||||
|
|
@ -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 },
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue