Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iwatakeshi/css.js
A super shot for CSS.
https://github.com/iwatakeshi/css.js
Last synced: 6 days ago
JSON representation
A super shot for CSS.
- Host: GitHub
- URL: https://github.com/iwatakeshi/css.js
- Owner: iwatakeshi
- License: mit
- Created: 2015-04-24T20:02:10.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-11-03T16:00:24.000Z (about 6 years ago)
- Last Synced: 2024-03-18T01:11:02.977Z (10 months ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# css.js
A super shot for CSS.
## Introduction
css.js is a wrapper for `element.style[api]` written in ES6. Instead of using the element's `style` property you can easily use css.js to apply most styles:
```js
css('#myDiv').font().size('20px');
```
You may have noticed that most methods are chainable, this allows
you to apply multiple CSS styles on the element at once.## Usage
### Setting the Style
There are other ways to set your style. If you prefer to set your style
at once instead of using chains then you can do the following:```js
css('#myDiv').font('italic bold 20px arial,serif');
```
Note that some API do not have this capability as it does not apply.### Chaining API
To chain with other APIs, you can use the `then` function:
```js
css('#myDiv').font().size('20px')
.then()
.background().color('black');
```**TODO: Finish Docs**