https://github.com/cssobj/cssobj-plugin-gencss
Generate css text from cssobj in server side.
https://github.com/cssobj/cssobj-plugin-gencss
Last synced: about 1 month ago
JSON representation
Generate css text from cssobj in server side.
- Host: GitHub
- URL: https://github.com/cssobj/cssobj-plugin-gencss
- Owner: cssobj
- Created: 2016-07-14T21:40:58.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-07-26T01:43:09.000Z (almost 9 years ago)
- Last Synced: 2025-02-28T19:55:10.260Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 39.1 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cssobj-plugin-gencss
[](https://gitter.im/css-in-js/cssobj)
Generate css text from [cssobj-core](https://github.com/cssobj/cssobj-core).
## Usage
``` javascript
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
``` javascript
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
``` javascript
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](https://github.com/cssobj/cssobj-plugin-stylize) to apply generated css text into `` tag.