最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

reactjs - How to override TailwindCSS v4 default design using React and Vite - Stack Overflow

programmeradmin3浏览0评论

I have just installed my react project with Vite and TaiwindCSS v4 (latest version), but I don't find the tailwind.config.js.

Does anyone has an idea how to to override TailwindCSS v4 default design please? If I have to add tailwind.config.js, have you any idea how to configure it in the project? Thanks.

I have just installed my react project with Vite and TaiwindCSS v4 (latest version), but I don't find the tailwind.config.js.

Does anyone has an idea how to to override TailwindCSS v4 default design please? If I have to add tailwind.config.js, have you any idea how to configure it in the project? Thanks.

Share Improve this question edited yesterday rozsazoltan 7,6965 gold badges17 silver badges36 bronze badges asked yesterday user29295031user29295031 754 bronze badges 1
  • 1 Maybe related: How to setting Tailwind CSS v4 global class? – rozsazoltan Commented yesterday
Add a comment  | 

1 Answer 1

Reset to default 2

Tailwind v4 theme tokens are defined in CSS using the @theme directive:

@import "tailwindcss";

@theme {
  --color-primary: red;
}
<div class="text-primary">I will be red</div>

You shouldn't need a tailwind.config.js file anymore, but if you do, you will need to explicitly load it with the @config directive:

/* Path relative to this CSS file. */
@config "../../tailwindcss.config.js";
发布评论

评论列表(0)

  1. 暂无评论