Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 如何在ant设计中使用主题颜色?_Reactjs_Antd - Fatal编程技术网

Reactjs 如何在ant设计中使用主题颜色?

Reactjs 如何在ant设计中使用主题颜色?,reactjs,antd,Reactjs,Antd,我想使用蚂蚁设计主题的原色。我相信较少的标签是:@primarycolor。如何将此值用于希望边框颜色匹配的自定义div?这也是一个由CreateReact应用程序制作的应用程序 我希望能够做到以下几点: border: '2px solid #fff' // Instead of white, it uses the theme's primary color 在.less文件导入Ant设计样式的最顶端:@import'~antd/dist/antd.less' 然后可以使用任何antd颜色

我想使用蚂蚁设计主题的原色。我相信较少的标签是:
@primarycolor
。如何将此值用于希望边框颜色匹配的自定义div?这也是一个由CreateReact应用程序制作的应用程序

我希望能够做到以下几点:

border: '2px solid #fff' // Instead of white, it uses the theme's primary color

在.less文件导入Ant设计样式的最顶端:@import'~antd/dist/antd.less'

然后可以使用任何antd颜色变量:

@import '~antd/dist/antd.less';

.box {
    border: 2px solid @primary-color;
}