Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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