1.0.0 • Published 8 years ago

postcss-choose-color v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

PostCSS Choose Color Build Status

PostCSS plugin for choosing foreground color based on the background color brightness. The first argument is the background color in (hex, rgb or rgba). The second argument is the color that will be used on light background color. The third argument is the color that will be used on dark background color.

p {
    color: chooseColor("#000", "black", "white");
}

h1 {
    color: chooseColor("rgb(255, 255, 255)", "black", "white");
}
p {
    color: white;
}

h1 {
    color: black;
}

Usage

postcss([ require('postcss-choose-color') ])