cssobj-plugin-gencss

2.0.7 • Public • Published

cssobj-plugin-gencss

Join the chat at https://gitter.im/css-in-js/cssobj

Generate css text from cssobj-core.

Usage

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

Install

npm install cssobj/cssobj-plugin-gencss

API

var plugin = pluginGenCSS(option)

Get plugin function to apply, pass option.

PARAMS

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 ''.

RETURN

A function can be as cssobj plugin.

Example

pluginGenCSS({indent:'\t', initIndent:'\t'})  // all lines will have \t infront
 
pluginGenCSS({newLine:''})  //all lines will join together
 

Helpers

This plugin can use with plugin-stylize to apply generated css text into <style> tag.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.7
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.7
    3
  • 2.0.5
    1
  • 2.0.3
    3

Package Sidebar

Install

npm i cssobj-plugin-gencss

Weekly Downloads

8

Version

2.0.7

License

MIT

Last publish

Collaborators

  • cssobj