Generate css text from cssobj-core.
var cssobj_core = require('cssobj-core')
var pluginGenCSS = require('cssobj-plugin-gencss')
var cssobj = cssobj_core({plugins: [pluginGenCSS(option)] })
var result = cssobj(obj)
// result.css will have the css text generated
npm install cssobj/cssobj-plugin-gencss
Get plugin function to apply, pass option.
-
indent
: {string} Indent string for each level when format css, default is ' ' (2 space). -
newLine
: {string} New-line string. default is '\n'. -
initIndent
: {string} Init indent for all lines. default is ''.
A function can be as cssobj plugin.
pluginGenCSS({indent:'\t', initIndent:'\t'}) // all lines will have \t infront
pluginGenCSS({newLine:''}) //all lines will join together
This plugin can use with plugin-stylize to apply generated css text into <style>
tag.