在tailwind.config.js文件中,您可以使用插件来实现所需的结果。您可以使用以下代码:-
const plugin = require("tailwindcss/plugin");
const {default: flattenColorPalette,} = require("tailwindcss/lib/util/flattenColorPalette");
export default {
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {},
},
plugins: [
plugin(function ({ matchUtilities, theme }) {
matchUtilities(
{
"drop-shadow-custom": (value) => ({
filter: `drop-shadow(20px 20px 20px ${value})`,
}),
},
{
values: flattenColorPalette(theme("colors")),
type: "color",
}
);
}),
],
};