Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/component/css
DOM element css helper
https://github.com/component/css
Last synced: 12 days ago
JSON representation
DOM element css helper
- Host: GitHub
- URL: https://github.com/component/css
- Owner: component
- Created: 2012-12-21T22:35:52.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2017-10-28T21:06:06.000Z (about 7 years ago)
- Last Synced: 2024-08-08T15:27:58.578Z (5 months ago)
- Language: JavaScript
- Size: 33.2 KB
- Stars: 30
- Watchers: 9
- Forks: 21
- Open Issues: 6
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# css
jQuery's [css()](http://api.jquery.com/css/) method.
## Installation
Install with [component(1)](http://component.io):
$ component install component/css
## API
### css(el, prop)
Get the computed value of the `prop` on `el`.
```js
css(p, 'color')
```### css(el, prop, value)
Set the CSS `value` on the `prop` on `el`
```js
css(p, 'color', 'red')
```### css(el, styles)
Set a `styles` object to `el`
```js
css(p, {
color: 'red',
background: 'blue'
})
```## TODO
- Finish porting jQuery [css unit tests](https://github.com/jquery/jquery/blob/master/test/unit/css.js) over
## License
MIT