tailwindcss/src/plugins/backgroundSize.js

19 lines
410 B
JavaScript
Raw Normal View History

2019-01-09 21:46:11 -05:00
import _ from 'lodash'
export default function() {
return function({ addUtilities, e, theme, variants }) {
2019-01-11 12:29:33 -05:00
const utilities = _.fromPairs(
_.map(theme('backgroundSize'), (value, modifier) => {
2019-01-11 12:29:33 -05:00
return [
`.${e(`bg-${modifier}`)}`,
{
'background-size': value,
},
]
})
)
2019-01-09 21:46:11 -05:00
addUtilities(utilities, variants('backgroundSize'))
2019-01-09 21:46:11 -05:00
}
}