A post-css plugin that can replace all ant design colors with css variables
npm install ant-post-css-theme
$ npm install ant-post-css-theme
css
:root {
--hover-color: #40a9ff;
--primary-color: #1890ff;
--success-color: #52c41a;
--warning-color: #faad14;
--error-color: #f5222d;
}
`
add plugin to postcss
`JS
postcss([ require('ant-post-css-theme') ])
`
See PostCSS docs for examples regarding usage.
Options
$3
- Type: object
- Default: {}
This is a another way to pass color values the plugin will provide those colors as a fallback if the css variable is not present see [css var fallback].
e.g:
`JS
defaults: {
hoverColor: "#40a9ff",
primaryColor: "#1890ff",
successColor: "#52c41a",
warningColor: "#faad14",
errorColor: "#f5222d",
}
`
[postcss]: https://github.com/postcss/postcss
[antd]: https://ant.design/
[css change variables with javascript]: https://www.w3schools.com/css/css3_variables_javascript.asp
[css var fallback]: https://developer.mozilla.org/en-US/docs/Web/CSS/var()#syntax