I encountered an issue while trying to implement the Tailwind plugin in my project. It seems that a TypeScript error
has occurred. I'm curious about the data types of matchUtilities and themes. Can someone provide some insight?
const plugin = require('tailwindcss/plugin')
const flattenColorPalette = require('tailwindcss/lib/util/flattenColorPalette')
import type { Config } from 'tailwindcss'
type colorArray = ["wh","bla","ora","gra"];
const config: Config = {
plugins: [
plugin(function ({ matchUtilities, theme } : { matchUtilities : any, theme : any }) {
matchUtilities(
{
'my-custom-class': (value : colorArray) => ({
backgroundColor: value,
color: theme('colors.white')
}),
},
{ values: flattenColorPalette(theme('colors')) }
)
}),
],
}
export default config