Skip to content

Commit a6e96c8

Browse files
committed
Port backgroundAttachment module to plugin
1 parent c39ed44 commit a6e96c8

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/defaultPlugins.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import backgroundAttachment from './plugins/backgroundAttachment'
12
import backgroundColors from './plugins/backgroundColors'
23
import backgroundPosition from './plugins/backgroundPosition'
34
import backgroundRepeat from './plugins/backgroundRepeat'
@@ -48,6 +49,7 @@ import zIndex from './plugins/zIndex'
4849

4950
export default function (config) {
5051
return [
52+
config.modules.backgroundAttachment === false ? () => {} : backgroundAttachment(),
5153
config.modules.backgroundColors === false ? () => {} : backgroundColors(),
5254
config.modules.backgroundPosition === false ? () => {} : backgroundPosition(),
5355
config.modules.backgroundRepeat === false ? () => {} : backgroundRepeat(),

src/generators/backgroundAttachment.js

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default function () {
2+
return function ({ addUtilities, config }) {
3+
addUtilities({
4+
'.bg-fixed': { 'background-attachment': 'fixed' },
5+
'.bg-local': { 'background-attachment': 'local' },
6+
'.bg-scroll': { 'background-attachment': 'scroll' },
7+
}, config('modules.backgroundAttachment'))
8+
}
9+
}

src/utilityModules.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import lists from './generators/lists'
22
import appearance from './generators/appearance'
3-
import backgroundAttachment from './generators/backgroundAttachment'
43

54
export default [
65
{ name: 'lists', generator: lists },
76
{ name: 'appearance', generator: appearance },
8-
{ name: 'backgroundAttachment', generator: backgroundAttachment },
97
]

0 commit comments

Comments
 (0)