Port svgFill module to plugin
This commit is contained in:
parent
efb9e6953d
commit
e6c0da03df
4 changed files with 15 additions and 12 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import svgFill from './plugins/svgFill'
|
||||
import svgStroke from './plugins/svgStroke'
|
||||
import tableLayout from './plugins/tableLayout'
|
||||
import textAlign from './plugins/textAlign'
|
||||
|
|
@ -13,6 +14,7 @@ import width from './plugins/width'
|
|||
import zIndex from './plugins/zIndex'
|
||||
|
||||
export default [
|
||||
svgFill(),
|
||||
svgStroke(),
|
||||
tableLayout(),
|
||||
textAlign(),
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
import _ from 'lodash'
|
||||
import defineClass from '../util/defineClass'
|
||||
|
||||
export default function({ svgFill }) {
|
||||
return _.map(svgFill, (color, modifier) => {
|
||||
return defineClass(`fill-${modifier}`, {
|
||||
fill: color,
|
||||
})
|
||||
})
|
||||
}
|
||||
13
src/plugins/svgFill.js
Normal file
13
src/plugins/svgFill.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import _ from 'lodash'
|
||||
|
||||
export default function () {
|
||||
return function ({ addUtilities, config, e }) {
|
||||
const utilities = _.fromPairs(_.map(config('svgFill'), (value, modifier) => {
|
||||
return [`.${e(`fill-${modifier}`)}`, {
|
||||
'fill': value,
|
||||
}]
|
||||
}))
|
||||
|
||||
addUtilities(utilities, config('modules.svgFill'))
|
||||
}
|
||||
}
|
||||
|
|
@ -34,7 +34,6 @@ import pointerEvents from './generators/pointerEvents'
|
|||
import position from './generators/position'
|
||||
import resize from './generators/resize'
|
||||
import shadows from './generators/shadows'
|
||||
import svgFill from './generators/svgFill'
|
||||
|
||||
export default [
|
||||
{ name: 'lists', generator: lists },
|
||||
|
|
@ -73,5 +72,4 @@ export default [
|
|||
{ name: 'position', generator: position },
|
||||
{ name: 'resize', generator: resize },
|
||||
{ name: 'shadows', generator: shadows },
|
||||
{ name: 'svgFill', generator: svgFill },
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue