An open API service indexing awesome lists of open source software.

https://github.com/cssobj/cssobj-plugin-csstext

Get cssText from CSSOM.
https://github.com/cssobj/cssobj-plugin-csstext

Last synced: 2 months ago
JSON representation

Get cssText from CSSOM.

Awesome Lists containing this project

README

          

# cssobj-plugin-csstext

[![Join the chat at https://gitter.im/css-in-js/cssobj](https://badges.gitter.im/css-in-js/cssobj.svg)](https://gitter.im/css-in-js/cssobj)

DEPRECATED! Use this: [cssobj-helper-showcss](https://github.com/cssobj/cssobj-helper-showcss)

Get cssText from cssobj and CSSOM, for debug purpose.

## Install

- **npm**

``` javascript
npm install cssobj/cssobj-plugin-csstext
```

## Usage:

### Option 1 (recommanded): as callback for onUpdate

``` javascript
var result = cssobj(obj, { onUpdate: pluginCssText(callback).post })

function callback(cssText) {
// for each result.update
// cssText be the whole cssom text of result

console.log(cssText)
// open your console and see the result
}
```

### Option 2: as a plugin

It **must** load after [plugin-cssom](https://github.com/cssobj/cssobj-plugin-cssom).

``` javascript
var pluginCssText = require('cssobj-plugin-csstext')

var result = cssobj(obj)

result.options.plugins.push( pluginCssText(callback) )
```