Вот файл tailwind.config.ts , который мне нужно добавить в свой проект, но в Tailwind v4 у меня нет файла tailwind.config.ts . Пожалуйста, сообщите мне решение для решения этой проблемы. Я не смог найти никакого решения для этого. < /P>
const svgToDataUri = require("mini-svg-data-uri");
const colors = require("tailwindcss/colors");
const {
default: flattenColorPalette,
} = require("tailwindcss/lib/util/flattenColorPalette");
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{ts,tsx}"],
darkMode: "class",
theme: {
// rest of the code
},
plugins: [
addVariablesForColors,
function ({ matchUtilities, theme }: any) {
matchUtilities(
{
"bg-grid": (value: any) => ({
backgroundImage: `url("${svgToDataUri(
``
)}")`,
}),
"bg-grid-small": (value: any) => ({
backgroundImage: `url("${svgToDataUri(
``
)}")`,
}),
"bg-dot": (value: any) => ({
backgroundImage: `url("${svgToDataUri(
``
)}")`,
}),
},
{ values: flattenColorPalette(theme("backgroundColor")), type: "color" }
);
},
],
};
function addVariablesForColors({ addBase, theme }: any) {
let allColors = flattenColorPalette(theme("colors"));
let newVars = Object.fromEntries(
Object.entries(allColors).map(([key, val]) => [`--${key}`, val])
);
addBase({
":root": newVars,
});
} ```
Подробнее здесь: https://stackoverflow.com/questions/794 ... e-this-the
В Tailwind 4.0 нет файла tailwind.config.ts, как мне настроить эту тему в next.js сейчас? ⇐ CSS
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
В Tailwind 4.0 нет файла tailwind.config.ts, как мне настроить эту тему в next.js сейчас?
Anonymous » » в форуме CSS - 0 Ответы
- 5 Просмотры
-
Последнее сообщение Anonymous
-