Skip to content

anaslaham/ant-post-css-theme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published