Skip to content

🧐使用antd-style的createStyles方式创建的classname都是统一前缀“acss”,怎么使其生成的classname中包含对应的属性名? #11461

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

Open
LuckLin520 opened this issue Apr 27, 2025 · 0 comments

Comments

@LuckLin520
Copy link

LuckLin520 commented Apr 27, 2025

🧐使用antd-style的createStyles方式创建的classname都是统一前缀“acss”,怎么使其生成的classname中包含对应的属性名?

使用antd-style的createStyles方式创建的classname都是统一前缀“acss”,怎么使其生成的classname中包含对应的属性名?
我找到了官网文档https://ant-design.github.io/antd-style/guide/babel-plugin
根据文档描述测试安装babel-plugin-antd-style并配置.babelrc并不起作用,怎么解决这个问题?
我使用的时V6版本,同时官网的这个页面是404:
https://pro.ant.design/zh-CN/docs/faq#%E5%A6%82%E4%BD%95%E6%B7%BB%E5%8A%A0-babel-%E6%8F%92%E4%BB%B6
何添加 babel 插件?
详见 umi-babel

💻 示例代码 | Sample code

const useStyles = createStyles(({ token }) => { currentDate: { color: token.colorPrimary } })
// 默认生成的classname为acss-3btzkp,在开发时不方便调试

🚑 其他信息 | Other information

OS:

Node:

浏览器 | browser:

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

No branches or pull requests

1 participant