Last active
September 30, 2020 11:59
-
-
Save pbteja1998/95715d50f5db180cb559732ba51abb65 to your computer and use it in GitHub Desktop.
This will generate `shadow-outline-*` utilities for all the colors (including your own custom-defined colors).
This file contains 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 colors = require('@tailwindcss/ui/colors') | |
module.exports = { | |
// ... | |
theme: { | |
// ... | |
extend: { | |
// ... | |
colors: { | |
brand: colors.indigo, | |
success: colors.green, | |
danger: colors.red, | |
warning: colors.orange, | |
info: colors.blue, | |
normal: colors.gray, | |
lightSurface: 'hsl(210, 20%, 98%)', | |
}, | |
boxShadow: (theme) => { | |
const variants = {} | |
const allColors = theme('colors') | |
for (const colorName in allColors) { | |
const color = allColors[colorName] | |
variants[`outline-${colorName}`] = `0 0 0 3px ${ | |
typeof color === 'string' ? color : color['300'] | |
}` | |
} | |
return variants | |
}, | |
}, | |
}, | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment