Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: tailwind 配置修改不生效 #5209

Closed
5 tasks done
frankchen211 opened this issue Dec 22, 2024 · 6 comments
Closed
5 tasks done

Bug: tailwind 配置修改不生效 #5209

frankchen211 opened this issue Dec 22, 2024 · 6 comments

Comments

@frankchen211
Copy link

Version

Vben Admin V5

Describe the bug?

修改 internal/tailwind-config/src/index.ts 下的tailwind配置不起作用,甚至清空整个文件,也不影响项目样式,即使清空node_modules/.vite并重启服务。

Reproduction

例如在config的theme中的extend添加如下项覆盖

      spacing: {
        '1': '18rem',
      },

vscode的代码提示已是新的18rem,但页面依然是默认值。

删除清空index.ts内容,页面样式也依然正常。

System Info

System:
    OS: Linux 6.8 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
    CPU: (16) x64 AMD Ryzen 9 6900HX with Radeon Graphics
    Memory: 18.41 GB / 29.11 GB
    Container: Yes
    Shell: 5.2.21 - /bin/bash
  Binaries:
    Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node
    npm: 10.9.0 - ~/.nvm/versions/node/v22.11.0/bin/npm
    pnpm: 9.15.0 - ~/.nvm/versions/node/v22.11.0/bin/pnpm

Vben Version:5.5.1

Relevant log output

No response

Validations

@mynetfan
Copy link
Collaborator

修改之后,运行一次 pnpm i

@frankchen211
Copy link
Author

修改之后,运行一次 pnpm i

可以了,谢谢!另外请问如果想在指定的app下修改tailwind配置项,配置插件应该如何操作呢?

@mynetfan
Copy link
Collaborator

每个app下不是都有个tailwind.config.mjs吗?

@frankchen211
Copy link
Author

frankchen211 commented Dec 22, 2024

不是太会写,尝试了一下不生效……
@mynetfan

import { config as baseConfig } from '@vben/tailwind-config';

export default {
  ...baseConfig,
  theme: {
    ...baseConfig.theme,
    extend: {
      spacing: {
        1: '3.25rem',
        15: '3.75rem',
        128: '32rem',
        144: '36rem',
      },
    },
  },
};

@anncwb anncwb closed this as completed Dec 25, 2024
@frankchen211
Copy link
Author

frankchen211 commented Dec 26, 2024

每个app下的tailwind配置如何覆盖呢?
@anncwb @mynetfan

@zzx18023
Copy link

zzx18023 commented Jan 6, 2025

每个app下的tailwind配置如何覆盖呢? @anncwb @mynetfan

你还需要修改app下的postcss.config.mjs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants