DocSpring / craco-antd

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

Custom theme does not work #3

Closed rush-levint closed 5 years ago

rush-levint commented 5 years ago

https://github.com/FormAPI/craco-antd/blob/093f672d29a43f1b2060c4393131500be69353a7/lib/craco-antd.js#L59

Setting the value of style to true makes it work.

ndbroadbent commented 5 years ago

Oh, sorry about that! I was following the Ant Design docs, which had style: ‘css’. Maybe that worked with an older version.

This article looks a bit better. I’ll also add the less-vars-to-js package and support antd.customize.less. That’s a bit nicer than using JSON.

rush-levint commented 5 years ago

The documentation still holds true for that case as mentioned in the Customize Theme section.

ndbroadbent commented 5 years ago

OH now that makes sense. Thanks!

ndbroadbent commented 5 years ago

Hi @rush-levint, thanks for your help. I've published 1.4.0, which fixes the issue. I've also added the less-vars-to-js package to parse Less vars from ./antd.customize.less, and you can customize this path with the customizeThemeLessPath option.