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.
- Host: GitHub
- URL: https://github.com/cssobj/cssobj-plugin-csstext
- Owner: cssobj
- Created: 2016-07-28T13:31:35.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-12-16T05:50:42.000Z (over 9 years ago)
- Last Synced: 2025-06-27T06:54:02.607Z (12 months ago)
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cssobj-plugin-csstext
[](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) )
```