ant-design / antd-style

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

🧐[Is there a way to use Components Token?] #159

Open crhk opened 1 month ago

crhk commented 1 month ago

🧐 问题描述

I try to use antd-style with a component token but I get this error:

Property 'Progress' does not exist on type 'FullToken'.ts(2339)

How can I use it?

💻 示例代码

const useStyle = createStyles(({ token, css }) => ({
  container: css`
    color: ${token.Progress.defaultColor}px;
  `
}))

🚑 其他信息

When I check the console in my browser, I can see the object token and it contains Progress, so my app works but I get this type error in my IDE (VSCode)

arvinxx commented 1 month ago

I need to discuss about this usage with our teammates