首页 > 解决方案 > 如何在情感中使用 Antd 主题变量

问题描述

我在 Next.js 网站中使用 Antd 和情感。我希望能够访问组件内的 Antd 主题变量(用 Less 编写)。像这样的东西:

const StyledButton = styled(Button)`
  background-color: @primary-color
`

做了一些研究,发现这个问题Using Ant Design Variables in Styled Components但它对我不起作用。此外,样式现在已被弃用。

谢谢

标签: reactjsnext.jslessantdemotion

解决方案


推荐阅读