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

使用 antd-style 替换 emotion 方案 #18

Open
Wxh16144 opened this issue Jul 21, 2023 · 1 comment
Open

使用 antd-style 替换 emotion 方案 #18

Wxh16144 opened this issue Jul 21, 2023 · 1 comment

Comments

@Wxh16144
Copy link

一直以来 Ant Design 官网都是使用 emotion 作为 CSS-in-JS 方案, 目前 antd 已经完成从 emoction 迁移至 antd-style ref: ant-design/ant-design#43623

注意到 dumi-theme-antd 一直有在活跃, 有没有考虑也做一波迁移, 如果没啥难度很乐意提供一份 PR. 感谢

@KuangPF
Copy link
Owner

KuangPF commented Jul 22, 2023

你好,首先欢迎给出相关的建议。
看了antd-style相关介绍,的确是一个不错的思路,也做了一些语法以及性能优化。如果迁移为antd-style方案的话,我大致看了下可以达到以下几个效果:

  • antd-style 内置 antd token,可以无缝对接,不用每次引入 antd.them.useToken
  • antd-style 支持自定义 token,可以实现覆盖现有业务逻辑
  • 可以拥有更快的网页性能CSS-in-JS 性能对比

但有个疑惑,查看目前 antd 官网样式,会发现有两个重复的样式作用,这一块具体的原因是啥
image
感觉一个像是 @emotion/css ,一个像是 @emotion/style

最后,肯定欢迎 PR~

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

2 participants