Open popmanhe opened 4 years ago
@popmanhe Just use color based variables in your variables.less file or create another one like colors.less or theme.less and then read variables from there
I tried adding @font-size-base: 14px;
in my variables file in working example so when I restarted server, it did not work. So again, as I mentioned in above comment, use separate file for color based variables
it seems that adding @import "~antd/es/style/themes/default.less" in variables.less file will cause this problem. when i comments i, every thing is fine.
variables.less
// @import "~antd/es/style/themes/default.less";
...
it work for me!
by the way,
The official demo also have this problem, delete the lock file and reinstall, you will see!
So everything is working fine now?
Similar configuration is also appear this issue.
I also had this problem.
Describe the bug color.less file is empty
Show your code webpack.config
variables.less
The above worked fine with ant 3.x. I don't know if it's because I moved to 4.x
The issues is when webpack compiling the code, it complaints about ceil function that first arg must be number. @font-size-base soimetimes is random color code, like #405e3f. I don't know why. But @font-size-base: 14px; is defined in the variables.
@heading-1-size: ceil(@font-size-base 2.71); @heading-2-size: ceil(@font-size-base 2.14); @heading-3-size: ceil(@font-size-base 1.71); @heading-4-size: ceil(@font-size-base 1.42);
Screenshots![图片](https://user-images.githubusercontent.com/2193792/90341808-a6488080-dfb7-11ea-87ff-4b58d844873f.png)
Version ant: 4.5.4 antd-theme-webpack-plugin: 1.3.6