1.1.0 • Published 7 years ago

es-to-css v1.1.0

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

es-to-css

Convert ES6 objects into CSS stylesheet

Installation

npm install --save es-to-css

Usage

Basic usage:

const toCSS = require('es-to-css')

const css = toCSS({
	'#my-id-element': {
		'background-color': 'red'
	},
	'.my-class-element': {
		'font-family': 'arial'
	}
})
console.log(css)

// => Outputs:
// #my-id-element { background-color: red; }
// .my-class-element { font-family: arial; }

Even nested pseudo-classes supported

const toCSS = require('es-to-css')

const css = toCSS({
	'#my-id-element': {
		'background-color': 'red',
		'&:hover': {
			'background-color': 'black'
		}
	}
})
console.log(css)

// => Outputs:
// #my-id-element { background-color: red; }
// #my-id-element:hover { background-color: black; }
1.1.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago