In Tailwind 4.0 gibt es keine Datei twilwind.config.ts Datei. Wie konfiguriere ich dieses Thema jetzt im nächsten JS?CSS

CSS verstehen
Anonymous
 In Tailwind 4.0 gibt es keine Datei twilwind.config.ts Datei. Wie konfiguriere ich dieses Thema jetzt im nächsten JS?

Post by Anonymous »

Hier ist die Datei tailwind.config.ts, die ich in meinem Projekt hinzufügen muss, aber in Tailwind V4 habe ich keine Datei tailwind.config.ts. Bitte sagen Sie mir eine Lösung, um dieses Problem zu lösen. Ich konnte keine Lösung dafür finden.

Code: Select all

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,
});
} ```

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post