Skip to content

Instantly share code, notes, and snippets.

@pbteja1998
Last active September 30, 2020 11:59
Show Gist options
  • Save pbteja1998/95715d50f5db180cb559732ba51abb65 to your computer and use it in GitHub Desktop.
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).
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