-
-
Notifications
You must be signed in to change notification settings - Fork 46.7k
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
docs: migrate to antd-style #43623
docs: migrate to antd-style #43623
Conversation
Run & review this pull request in StackBlitz Codeflow. |
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: @emotion/babel-preset-css-prop@11.11.0, @emotion/css@11.11.2, antd-style@3.4.1 |
size-limit report 📦
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## master #43623 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 657 657
Lines 11064 11180 +116
Branches 2999 3051 +52
==========================================
+ Hits 11064 11180 +116 ☔ View full report in Codecov by Sentry. |
antd-style 之前有 SSR 过程的中的样式丢失问题,还特别改回 emotion,要注意一下:#43158 |
可能是导出方式问题 |
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
#40235
💡 Background and solution
去除
@emotion/react
和 css prop 的写法,全量用 antd-style全局样式的写法比较怪,去 antd-style 加个工厂方法再来
https://ant-design.github.io/antd-style/api/global-styles#%E7%BB%93%E5%90%88-antd-%E7%9A%84-token-%E4%BD%BF%E7%94%A8
📝 Changelog
☑️ Self-Check before Merge
🚀 Summary
🤖 Generated by Copilot at 5247fb2
The pull request migrates the dumi pages and theme components from
@emotion/react
toantd-style
for styling and theming. This improves the performance, compatibility, and consistency of the project and simplifies the code. It also fixes some minor issues with indentation, naming, and props. The unuseduseSiteToken
hook and theRecommendsOld
component were removed.🔍 Walkthrough
🤖 Generated by Copilot at 5247fb2
@emotion/react
withantd-style
in all import statements to use the wrapper package that provides additional features for styling components (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)useSiteToken
hook from all components and functions and replace it withuseTheme
hook fromantd-style
to access the theme token object consistently and support custom token types (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)useStyle
function withcreateStyles
function fromantd-style
in all components to create style objects with the theme token object and thecss
function as arguments, and return an object with thestyles
andcx
properties (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)css
prop withclassName
prop in all React elements and components to apply class names in a standard way, and useclassNames
function fromclassnames
package to combine multiple class names from thestyles
object (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)RecommendsOld
component toBanner
and change the file name and path accordingly to use a more concise and descriptive name for the component that displays the banner section of the landing page (link, link)NewToken
interface to declare a custom token type that extends the default token type fromantd-style
and defines some additional properties for the site theme, and use it to augment theCustomToken
interface fromantd-style
and specify the generic type parameter for theThemeProvider
component (link, link)Menu
andCard
component themes that override the default theme values and could cause inconsistency or unexpected appearance of the components (link, link)colorActiveBarWidth
property toactiveBarBorderWidth
in theMenu
component theme to match the correct property name for the component theme (link)overlay
prop withmenu
prop in theBreadcrumb.Item
component to use a more concise and consistent way to pass a menu object to the component (link)useCarouselStyle
function togetCarouselStyle
function to avoid using theuse
prefix for a function that is not a custom hook (link)size
prop from'large'
to"large"
in theInput
component to use double quotes instead of single quotes for string literals, which is the preferred style for TypeScript code (link).dumi/hooks/useSiteToken.ts
as it is no longer needed (link)