mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Port shadows module to plugin
This commit is contained in:
parent
e6c0da03df
commit
6a3ed59fa6
@ -1,3 +1,4 @@
|
||||
import shadows from './plugins/shadows'
|
||||
import svgFill from './plugins/svgFill'
|
||||
import svgStroke from './plugins/svgStroke'
|
||||
import tableLayout from './plugins/tableLayout'
|
||||
@ -14,6 +15,7 @@ import width from './plugins/width'
|
||||
import zIndex from './plugins/zIndex'
|
||||
|
||||
export default [
|
||||
shadows(),
|
||||
svgFill(),
|
||||
svgStroke(),
|
||||
tableLayout(),
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
import _ from 'lodash'
|
||||
import defineClass from '../util/defineClass'
|
||||
|
||||
export default function({ shadows }) {
|
||||
return _.map(shadows, (shadow, modifier) => {
|
||||
return defineClass(modifier === 'default' ? 'shadow' : `shadow-${modifier}`, {
|
||||
'box-shadow': shadow,
|
||||
})
|
||||
})
|
||||
}
|
||||
14
src/plugins/shadows.js
Normal file
14
src/plugins/shadows.js
Normal file
@ -0,0 +1,14 @@
|
||||
import _ from 'lodash'
|
||||
|
||||
export default function () {
|
||||
return function ({ addUtilities, config, e }) {
|
||||
const utilities = _.fromPairs(_.map(config('shadows'), (value, modifier) => {
|
||||
const className = modifier === 'default' ? 'shadow' : `shadow-${modifier}`
|
||||
return [`.${className}`, {
|
||||
'box-shadow': value,
|
||||
}]
|
||||
}))
|
||||
|
||||
addUtilities(utilities, config('modules.shadows'))
|
||||
}
|
||||
}
|
||||
@ -33,7 +33,6 @@ import padding from './generators/padding'
|
||||
import pointerEvents from './generators/pointerEvents'
|
||||
import position from './generators/position'
|
||||
import resize from './generators/resize'
|
||||
import shadows from './generators/shadows'
|
||||
|
||||
export default [
|
||||
{ name: 'lists', generator: lists },
|
||||
@ -71,5 +70,4 @@ export default [
|
||||
{ name: 'pointerEvents', generator: pointerEvents },
|
||||
{ name: 'position', generator: position },
|
||||
{ name: 'resize', generator: resize },
|
||||
{ name: 'shadows', generator: shadows },
|
||||
]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user