Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juliangruber/yo-css
yo-yo helper for inline css
https://github.com/juliangruber/yo-css
Last synced: 21 days ago
JSON representation
yo-yo helper for inline css
- Host: GitHub
- URL: https://github.com/juliangruber/yo-css
- Owner: juliangruber
- Created: 2016-06-29T09:59:19.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-20T06:22:19.000Z (over 7 years ago)
- Last Synced: 2024-10-17T19:51:25.648Z (26 days ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 22
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# yo-css
[yo-yo](https://github.com/maxogden/yo-yo) helper for inline css, inspired by [React: CSS in JS by vjeux](https://speakerdeck.com/vjeux/react-css-in-js).
## Example
```js
const css = require('yo-css')
const yo = require('yo-yo')const style = {
backgroundColor: 'red',
width: 0,
border: '3px'
}const overwrite = {
backgroundColor: 'green'
}const el = yo`
Test!
`document.body.appendChild(el)
```## Installation
```bash
$ npm install yo-css
```## API
### css(...styles)
Given any number of style objects, merges them into one and returns a valid string of css. Later style objects have precedence. Use camelCase for your properties, this function converts them into proper css case.
## License
MIT