这是我的
tailwind.config.js
:
import defaultTheme from 'tailwindcss/defaultTheme';
/** @type {import('tailwindcss').Config} */
export default {
content: [
'./resources/**/*.blade.php',
'./resources/**/*.js',
],
theme: {
extend: {
fontFamily: {
sans: ['Figtree', ...defaultTheme.fontFamily.sans],
},
colors: {
black: "#060606",
},
},
},
plugins: [],
};
我的app.css
文件是:
@import "tailwindcss";
@source "../views";
和我的Postcss配置文件(postcss.config.js
):
export default {
plugins: {
"@tailwindcss/postcss": {},
autoprefixer: {},
},
};
如果有人知道为什么它不按预期工作,我将非常感谢您的帮助。
您使用尾风V3配置的混合物,但已安装了V4。修复:
unInstall the
autoprefixer
npm软件包。 Tailwind V4不再需要这,因为Tailwind在内部进行相同的工作。unInstall the
@tailwind/postcss
删除
postcss.config.js
tailwind.config.js
@import "tailwindcss";
@source "../views";
/**
* You may need to modify these paths to the real path relative
* to this CSS file.
*/
@source "../resources/**/*.blade.php";
/**
* You may not need the following directive if the JS files are
* processed in Vite.
*/
@source "../resources/**/*.js";
@theme {
--font-sans: Figtree, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
/**
* Not strictly needed as this is the default anyway.
*/
--color-black: #000000;
}
文件。