ant-design / antd-style

css-in-js library with antd v5 token system
https://ant-design.github.io/antd-style/
MIT License
219 stars 35 forks source link

antd css 应用级方案 #7

Closed arvinxx closed 1 year ago

arvinxx commented 1 year ago

https://github.com/ant-design/ant-design/discussions/40489

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
antd-style ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 27, 2023 at 7:25PM (UTC)
codecov[bot] commented 1 year ago

Codecov Report

Merging #7 (fe14edb) into master (dcd8ba2) will not change coverage. The diff coverage is 100.00%.

:exclamation: Current head fe14edb differs from pull request most recent head 1bd8114. Consider uploading reports for the commit 1bd8114 to get more accurate results

@@            Coverage Diff             @@
##            master        #7    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           24        41    +17     
  Lines          124       284   +160     
  Branches         9        36    +27     
==========================================
+ Hits           124       284   +160     
Impacted Files Coverage Δ
src/functions/createGlobalStyle.tsx 100.00% <ø> (ø)
src/functions/styled.ts 100.00% <ø> (ø)
src/hooks/useAntdToken.ts 100.00% <ø> (ø)
src/types/styled.ts 100.00% <ø> (ø)
src/types/theme.ts 100.00% <ø> (ø)
src/containers/StyleProvider/index.tsx 100.00% <100.00%> (ø)
src/containers/ThemeProvider/AntdProvider.tsx 100.00% <100.00%> (ø)
src/containers/ThemeProvider/ThemeProvider.tsx 100.00% <100.00%> (ø)
src/containers/ThemeProvider/ThemeSwitcher.tsx 100.00% <100.00%> (ø)
src/containers/ThemeProvider/TokenContainer.tsx 100.00% <100.00%> (ø)
... and 31 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

arvinxx commented 1 year ago

问题:

  1. emotion/css 不支持 className 嵌套;
  2. styled 不支持 组件名称嵌套;

当前实现需要使用 emotion/react 的 css 做一层中间层;

另外的想法:

createStyles 方式的入参由于 theme 变量是确定的,然后props 也是确定的。那么是否可以做基于 props 和 theme 的缓存,进而提升样式效率?

github-actions[bot] commented 1 year ago

🎊 PR Preview 46dbcb671a34512d543a48b7f31c8d2232147a12 has been successfully built and deployed to https://ant-design-antd-style-preview-pr-7.surge.sh

:clock1: Build time: 105.268s

🤖 By surge-preview

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 3.0.0-beta.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: