Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/johanholmerin/style9-jsx-prop

CSS prop for style9
https://github.com/johanholmerin/style9-jsx-prop

Last synced: 2 months ago
JSON representation

CSS prop for style9

Awesome Lists containing this project

README

        

# style9-jsx-prop

**Experimental**

Style JSX elements with [style9](https://github.com/johanholmerin/style9) using
a prop. Supports dynamic values using CSS custom properties.

```javascript
// From

;

// To
import style9 from 'style9';

const styles = style9.create({
base: {
color: 'blue',
':hover': {
color: 'var(--hover-color)'
},
animationName: style9.keyframes({
from: { opacity: 0 }
})
},
red: {
color: 'red',
}
});


```

## Install

```sh
# Yarn
yarn add -D style9-jsx-prop

# npm
npm install -D style9-jsx-prop
```

## Babel default options

```json
{
"plugins": [
["module:style9-jsx-prop", {
"propName": "css",
"importPath": "style9"
}]
]
}
```

## Typescript

To get Typescript to recognize the `css` prop you need to add the following
import once in your app.

```javascript
import {} from 'style9-jsx-prop/types';
```