Created
September 5, 2019 07:16
-
-
Save leMaur/9eca6adff0a424e8891bd2a326c87df1 to your computer and use it in GitHub Desktop.
Background gradient
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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