Shadcn UI ( https://ui.shadcn.com/ ) 工作正常,直到我只工作了几周,直到昨天,当我在本地主机中运行我的 NextJS 应用程序时,所有顺风车都不起作用。为了调试这个问题,我在一个全新的文件位置创建了一个空白的 NextJS 13 应用程序,一切正常;tailwind 正在默认的 nextJS 13 页面上工作。然后我跑了
npx shadcn-ui init
Run Code Online (Sandbox Code Playgroud)
无需安装任何组件。它没有吐出任何错误,但随后顺风样式不再起作用。
注入后我的tailwind.config.js:
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: ["class"],
content: [
'./pages/**/*.{ts,tsx}',
'./components/**/*.{ts,tsx}',
'./app/**/*.{ts,tsx}',
],
theme: {
container: {
center: true,
padding: "2rem",
screens: {
"2xl": "1400px",
},
},
extend: {
colors: {
border: "hsl(var(--border))",
input: "hsl(var(--input))",
ring: "hsl(var(--ring))",
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
primary: {
DEFAULT: "hsl(var(--primary))",
foreground: "hsl(var(--primary-foreground))",
},
secondary: {
DEFAULT: "hsl(var(--secondary))",
foreground: "hsl(var(--secondary-foreground))",
},
destructive: {
DEFAULT: …Run Code Online (Sandbox Code Playgroud)