Skip to content

Instantly share code, notes, and snippets.

@leMaur
Created September 5, 2019 07:16
Show Gist options
  • Save leMaur/9eca6adff0a424e8891bd2a326c87df1 to your computer and use it in GitHub Desktop.
Save leMaur/9eca6adff0a424e8891bd2a326c87df1 to your computer and use it in GitHub Desktop.
Background gradient
const _ = require('lodash')
module.exports = function ({addUtilities, e, theme, variants}) {
const gradients = theme('gradients', {})
const gradientsVariants = variants('gradients', [])
const utilities = _.map(gradients, ([start, end, direction], name) => ({
[`.bg-gradient-${e(name)}`]: {
backgroundImage: `linear-gradient(${direction}, ${start}, ${end})`
}
}))
addUtilities(utilities, gradientsVariants)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment