mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Port backgroundPosition module to plugin
This commit is contained in:
parent
6112b3e345
commit
0cd679b4ff
@ -1,3 +1,4 @@
|
||||
import backgroundPosition from './plugins/backgroundPosition'
|
||||
import backgroundRepeat from './plugins/backgroundRepeat'
|
||||
import backgroundSize from './plugins/backgroundSize'
|
||||
import borderCollapse from './plugins/borderCollapse'
|
||||
@ -46,6 +47,7 @@ import zIndex from './plugins/zIndex'
|
||||
|
||||
export default function (config) {
|
||||
return [
|
||||
config.modules.backgroundPosition === false ? () => {} : backgroundPosition(),
|
||||
config.modules.backgroundRepeat === false ? () => {} : backgroundRepeat(),
|
||||
config.modules.backgroundSize === false ? () => {} : backgroundSize(),
|
||||
config.modules.borderCollapse === false ? () => {} : borderCollapse(),
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
import defineClasses from '../util/defineClasses'
|
||||
|
||||
export default function() {
|
||||
return defineClasses({
|
||||
'bg-bottom': { 'background-position': 'bottom' },
|
||||
'bg-center': { 'background-position': 'center' },
|
||||
'bg-left': { 'background-position': 'left' },
|
||||
'bg-left-bottom': { 'background-position': 'left bottom' },
|
||||
'bg-left-top': { 'background-position': 'left top' },
|
||||
'bg-right': { 'background-position': 'right' },
|
||||
'bg-right-bottom': { 'background-position': 'right bottom' },
|
||||
'bg-right-top': { 'background-position': 'right top' },
|
||||
'bg-top': { 'background-position': 'top' },
|
||||
})
|
||||
}
|
||||
15
src/plugins/backgroundPosition.js
Normal file
15
src/plugins/backgroundPosition.js
Normal file
@ -0,0 +1,15 @@
|
||||
export default function () {
|
||||
return function ({ addUtilities, config }) {
|
||||
addUtilities({
|
||||
'.bg-bottom': { 'background-position': 'bottom' },
|
||||
'.bg-center': { 'background-position': 'center' },
|
||||
'.bg-left': { 'background-position': 'left' },
|
||||
'.bg-left-bottom': { 'background-position': 'left bottom' },
|
||||
'.bg-left-top': { 'background-position': 'left top' },
|
||||
'.bg-right': { 'background-position': 'right' },
|
||||
'.bg-right-bottom': { 'background-position': 'right bottom' },
|
||||
'.bg-right-top': { 'background-position': 'right top' },
|
||||
'.bg-top': { 'background-position': 'top' },
|
||||
}, config('modules.backgroundPosition'))
|
||||
}
|
||||
}
|
||||
@ -2,12 +2,10 @@ import lists from './generators/lists'
|
||||
import appearance from './generators/appearance'
|
||||
import backgroundAttachment from './generators/backgroundAttachment'
|
||||
import backgroundColors from './generators/backgroundColors'
|
||||
import backgroundPosition from './generators/backgroundPosition'
|
||||
|
||||
export default [
|
||||
{ name: 'lists', generator: lists },
|
||||
{ name: 'appearance', generator: appearance },
|
||||
{ name: 'backgroundAttachment', generator: backgroundAttachment },
|
||||
{ name: 'backgroundColors', generator: backgroundColors },
|
||||
{ name: 'backgroundPosition', generator: backgroundPosition },
|
||||
]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user