euphoria-colors
v0.1.1
Published
CSS-in-JS utils for colors.
Downloads
3
Readme
euphoria-colors
!!!!!!!!!!!!!!!!!!!!!!! MOVED TO Euphoria!!!!!!!!!!!!!!!!!
A Euphoria.css utility library to create color classes in your CSS-to-JS projects.
This module returns a string of class names you can then inject into a page, using something like glamor.
NOTE: Currently this only works with ES6 support using Babel or Node 7.x+.
Installation
# with yarn:
yarn add euphoria-colors
# with npm
npm i -S euphoria-colors
Usage
This module can be used in many ways. For example, using glamor, you would do the following:
import { css } from 'glamor'
import colors from 'euphoria-colors'
css.insert(
colors({
primary: '#ff6600',
danger: 'crimson',
blue: 'blue',
})
)
Now you will have the following classes available to you:
// Text colors
.text-primary { color: #ff6600; }
.text-danger { color: crimson; }
.text-blue { color: blue; }
// Background colors
.bg-primary { background: #ff6600; }
.bg-danger { background: crimson; }
.bg-blue { background: blue; }
Calling colors
without arguments will get you the default colors mapping, which is:
{
primary: 'lightseagreen',
success: 'forestgreen',
info: 'teal',
warning: 'orange',
danger: 'crimson',
}
Changelog
v0.1.0
- Initial release!
License
MIT
Credits
Dana Woodman