Port textAlign module to plugin

This commit is contained in:
Adam Wathan 2019-01-09 13:12:28 -05:00
parent 7e2e27818c
commit fbeadb76cc
4 changed files with 12 additions and 12 deletions

View File

@ -1,3 +1,4 @@
import textAlign from './plugins/textAlign'
import textColors from './plugins/textColors'
import textSizes from './plugins/textSizes'
import textStyle from './plugins/textStyle'
@ -10,6 +11,7 @@ import width from './plugins/width'
import zIndex from './plugins/zIndex'
export default [
textAlign(),
textColors(),
textSizes(),
textStyle(),

View File

@ -1,10 +0,0 @@
import defineClasses from '../util/defineClasses'
export default function() {
return defineClasses({
'text-left': { 'text-align': 'left' },
'text-center': { 'text-align': 'center' },
'text-right': { 'text-align': 'right' },
'text-justify': { 'text-align': 'justify' },
})
}

10
src/plugins/textAlign.js Normal file
View File

@ -0,0 +1,10 @@
export default function () {
return function ({ addUtilities, config }) {
addUtilities({
'.text-left': { 'text-align': 'left' },
'.text-center': { 'text-align': 'center' },
'.text-right': { 'text-align': 'right' },
'.text-justify': { 'text-align': 'justify' },
}, config('modules.textAlign'))
}
}

View File

@ -37,7 +37,6 @@ import shadows from './generators/shadows'
import svgFill from './generators/svgFill'
import svgStroke from './generators/svgStroke'
import tableLayout from './generators/tableLayout'
import textAlign from './generators/textAlign'
export default [
{ name: 'lists', generator: lists },
@ -79,5 +78,4 @@ export default [
{ name: 'svgFill', generator: svgFill },
{ name: 'svgStroke', generator: svgStroke },
{ name: 'tableLayout', generator: tableLayout },
{ name: 'textAlign', generator: textAlign },
]