Port backgroundAttachment module to plugin

This commit is contained in:
Adam Wathan 2019-01-09 21:51:25 -05:00
parent c39ed44c13
commit a6e96c8919
4 changed files with 11 additions and 11 deletions

View file

@ -1,3 +1,4 @@
import backgroundAttachment from './plugins/backgroundAttachment'
import backgroundColors from './plugins/backgroundColors'
import backgroundPosition from './plugins/backgroundPosition'
import backgroundRepeat from './plugins/backgroundRepeat'
@ -48,6 +49,7 @@ import zIndex from './plugins/zIndex'
export default function (config) {
return [
config.modules.backgroundAttachment === false ? () => {} : backgroundAttachment(),
config.modules.backgroundColors === false ? () => {} : backgroundColors(),
config.modules.backgroundPosition === false ? () => {} : backgroundPosition(),
config.modules.backgroundRepeat === false ? () => {} : backgroundRepeat(),

View file

@ -1,9 +0,0 @@
import defineClasses from '../util/defineClasses'
export default function() {
return defineClasses({
'bg-fixed': { 'background-attachment': 'fixed' },
'bg-local': { 'background-attachment': 'local' },
'bg-scroll': { 'background-attachment': 'scroll' },
})
}

View file

@ -0,0 +1,9 @@
export default function () {
return function ({ addUtilities, config }) {
addUtilities({
'.bg-fixed': { 'background-attachment': 'fixed' },
'.bg-local': { 'background-attachment': 'local' },
'.bg-scroll': { 'background-attachment': 'scroll' },
}, config('modules.backgroundAttachment'))
}
}

View file

@ -1,9 +1,7 @@
import lists from './generators/lists'
import appearance from './generators/appearance'
import backgroundAttachment from './generators/backgroundAttachment'
export default [
{ name: 'lists', generator: lists },
{ name: 'appearance', generator: appearance },
{ name: 'backgroundAttachment', generator: backgroundAttachment },
]