DocSpring / craco-antd

A craco plugin to use Ant Design with create-react-app
MIT License
234 stars 49 forks source link

How to use ant less colors in theme.less file ? #17

Open LoicUV opened 5 years ago

LoicUV commented 5 years ago

Hi,

The way to use default colors in antd is to import '~antd/lib/style/themes/default.less' in one of your less files.

I tried to import the base color file from @import '~/antd/lib/style/color/colors'; in the theme.less but it's ignored (which I assume is normal behaviour).

Is there any other way than to compile the colors to hex and put them at the top of the file, or to import the file in my code outside theme.less (which is not optimal since I need colors to redefine some variables) ?

Janaka-Steph commented 3 years ago

In antd.customize.less I have:

@import '~antd/lib/style/themes/default.less';
@body-background: @black;
...

But getting error Variable @black is undefined