Port backgroundRepeat module to plugin

This commit is contained in:
Adam Wathan 2019-01-09 21:47:13 -05:00
parent 5a372877a6
commit 6112b3e345
4 changed files with 12 additions and 12 deletions

View file

@ -1,3 +1,4 @@
import backgroundRepeat from './plugins/backgroundRepeat'
import backgroundSize from './plugins/backgroundSize'
import borderCollapse from './plugins/borderCollapse'
import borderColors from './plugins/borderColors'
@ -45,6 +46,7 @@ import zIndex from './plugins/zIndex'
export default function (config) {
return [
config.modules.backgroundRepeat === false ? () => {} : backgroundRepeat(),
config.modules.backgroundSize === false ? () => {} : backgroundSize(),
config.modules.borderCollapse === false ? () => {} : borderCollapse(),
config.modules.borderColors === false ? () => {} : borderColors(),

View file

@ -1,10 +0,0 @@
import defineClasses from '../util/defineClasses'
export default function() {
return defineClasses({
'bg-repeat': { 'background-repeat': 'repeat' },
'bg-no-repeat': { 'background-repeat': 'no-repeat' },
'bg-repeat-x': { 'background-repeat': 'repeat-x' },
'bg-repeat-y': { 'background-repeat': 'repeat-y' },
})
}

View file

@ -0,0 +1,10 @@
export default function () {
return function ({ addUtilities, config }) {
addUtilities({
'.bg-repeat': { 'background-repeat': 'repeat' },
'.bg-no-repeat': { 'background-repeat': 'no-repeat' },
'.bg-repeat-x': { 'background-repeat': 'repeat-x' },
'.bg-repeat-y': { 'background-repeat': 'repeat-y' },
}, config('modules.backgroundRepeat'))
}
}

View file

@ -3,7 +3,6 @@ import appearance from './generators/appearance'
import backgroundAttachment from './generators/backgroundAttachment'
import backgroundColors from './generators/backgroundColors'
import backgroundPosition from './generators/backgroundPosition'
import backgroundRepeat from './generators/backgroundRepeat'
export default [
{ name: 'lists', generator: lists },
@ -11,5 +10,4 @@ export default [
{ name: 'backgroundAttachment', generator: backgroundAttachment },
{ name: 'backgroundColors', generator: backgroundColors },
{ name: 'backgroundPosition', generator: backgroundPosition },
{ name: 'backgroundRepeat', generator: backgroundRepeat },
]