ant-post-css-theme

1.0.3 • Public • Published

Ant Post CSS Theme PostCSS

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

Demo

Installation

$ npm install ant-post-css-theme

Usage

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.

Options

defaults

  • 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",
}

Readme

Keywords

Package Sidebar

Install

npm i ant-post-css-theme

Weekly Downloads

671

Version

1.0.3

License

MIT

Unpacked Size

8.08 kB

Total Files

5

Last publish

Collaborators

  • anaslaham