【问题标题】:I added tailwindcss to vite+react+ts+sass,but it doesn't work我将tailwindcss添加到vite + react + ts + sass,但它不起作用
【发布时间】:2022-02-13 23:05:12
【问题描述】:

index.css

@tailwind base;
@tailwind components;
@tailwind utilities;

index.tsx

...
import "./index.css";
<div className="p-xl text-center">1111</div>
...

但 'p-xl' 和 'text-center' 都不起作用。只有 tailwindcss 前缀 css 起作用。

【问题讨论】:

标签: reactjs sass tailwind-css vite


【解决方案1】:

我刚刚修好了。 添加到tailwind.config.js

 content: [
    "./index.html",
    "./src/**/*.{jsx,tsx}",
  ],

【讨论】:

    猜你喜欢
    • 2020-09-08
    • 2022-01-22
    • 2021-03-14
    • 2021-12-04
    • 2021-09-15
    • 1970-01-01
    • 2022-01-21
    • 2016-08-16
    • 1970-01-01
    相关资源
    最近更新 更多