PostCSS plugin for replacing the default antd colors with css variables.
Be able to to change ant design theme in realtime! see CSS Change Variables With JavaScript
$ npm install ant-post-css-theme
Just add yous css theme variables to your project
variables.css
:root {
--hover-color: #40a9ff;
--primary-color: #1890ff;
--success-color: #52c41a;
--warning-color: #faad14;
--error-color: #f5222d;
}
add plugin to postcss
postcss([ require('ant-post-css-theme') ])
See PostCSS docs for examples regarding usage.
- 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:
defaults: {
hoverColor: "#40a9ff",
primaryColor: "#1890ff",
successColor: "#52c41a",
warningColor: "#faad14",
errorColor: "#f5222d",
}