ant-design / antd-style

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

🐛[BUG] createStyles token ts 提示有问题 #134

Closed DaphnisLi closed 5 months ago

DaphnisLi commented 5 months ago

"antd-style": "^3.4.4"

如图,primaryColor 提示不存在是否合理?如果是我的问题,那么正确写法应该是如何的? image image

arvinxx commented 5 months ago

应该是写法问题。 看下这个 https://ant-design.github.io/antd-style/api/theme-provider#typescript-type-support

DaphnisLi commented 5 months ago

应该是写法问题。看下这个https://ant-design.github.io/antd-style/api/theme-provider#typescript-type-support

这里的症状是 token 只是 ts 报错,还是可以正常生效的。 我的 createStyles 是从 createInstance 拿来的,按理说应该将 createStyles 里的 token 类型扩展一下。

DaphnisLi commented 5 months ago

应该是写法问题。看下这个https://ant-design.github.io/antd-style/api/theme-provider#typescript-type-support

这里的症状是 token 只是 ts 报错,还是可以正常生效的。 我的 createStyles 是从 createInstance 拿来的,按理说应该将 createStyles 里的 token 类型扩展一下。

@arvinxx

arvinxx commented 5 months ago

应该是写法问题。看下这个https://ant-design.github.io/antd-style/api/theme-provider#typescript-type-support

这里的症状是 token 只是 ts 报错,还是可以正常生效的。 我的 createStyles 是从 createInstance 拿来的,按理说应该将 createStyles 里的 token 类型扩展一下。

对,目前可能需要你手动扩展下。在 createInstance 自动集成这个感觉需要额外实现一下相关的类型能力

DaphnisLi commented 5 months ago

应该是写法问题。看下这个https://ant-design.github.io/antd-style/api/theme-provider#typescript-type-support

这里的症状是 token 只是 ts 报错,还是可以正常生效的。 我的 createStyles 是从 createInstance 拿来的,按理说应该将 createStyles 里的 token 类型扩展一下。

对,目前可能需要你手动扩展下。在 createInstance 自动集成这个感觉需要额外实现一下相关的类型能力