https://github.com/cssobj/cssobj-plugin-cssom
Apply cssobj Virtual CSS into browser's CSSOM.
https://github.com/cssobj/cssobj-plugin-cssom
Last synced: 2 months ago
JSON representation
Apply cssobj Virtual CSS into browser's CSSOM.
- Host: GitHub
- URL: https://github.com/cssobj/cssobj-plugin-cssom
- Owner: cssobj
- Created: 2016-07-15T02:32:46.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-03-19T02:17:46.000Z (about 8 years ago)
- Last Synced: 2025-09-23T00:39:02.246Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 109 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cssobj-plugin-cssom
[](https://gitter.im/css-in-js/cssobj)
Apply cssobj Virtual CSS into browser's [CSSOM](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model).
This plugin already integrated into [cssobj](https://github.com/cssobj/cssobj), don't apply it twice if you use **cssobj**.
## Usage
``` javascript
var cssobj_core = require('cssobj-core')
var pluginCSSOM = require('cssobj-plugin-cssom')
var cssobj = cssobj_core({plugins: [pluginCSSOM(option)] })
cssobj(obj)
// cssobj will auto applied into
```
## Install
``` javascript
npm install cssobj/cssobj-plugin-cssom
```
## API
### `var plugin = pluginCSSOM(option)`
Get plugin function to apply, pass option.
### *PARAMS*
### `option`
- `name` : {string} The id for `` tag, if omit, will using random string.
- `attrs` : {object} The key/val to apply to `<style>` tag as attributes.
### *RETURN*
A function can be as cssobj plugin.
## Example
``` javascript
pluginCSSOM({name:'index-page-style'})
pluginCSSOM({name:'index-page-style', attrs:{type:'text/css', media:'screen'} })
```
## Helpers
This plugin can use with [plugin-csstext](https://github.com/cssobj/cssobj-plugin-csstext) to display cssText from generated CSSOM.