styled-style
css modules like styled-components
Why?
styled-components are wonderful!!! However, if there are many existing css, it can not be transferred immediately. styled-style can be transferred step by step. You can use readable components immediately.
Install
$ yarn add styled-style
Usage
styles.module.css
.center {
display: flex;
justify-content: center;
align-items: center;
}
.input {
padding: 0.5em;
margin: 0.5em;
color: palevioletred;
background: papayawhip;
border: none;
border-radius: 3px;
}
import { styledStyle } from 'styled-style'
import styles from './styles.module.css'
const { div, button } = styledStyle(styles)
const Center = div('center')
const Input = button('input')
render(
<Center>
<Input type="text" placeholder="akameco" />
<Input type="text" value="styled-components" />
</Center>
)
API
styledStyle(styles: {[key: string]: string})
Examples
Contributors
Thanks goes to these wonderful people (emoji key):
akameco |
---|
This project follows the all-contributors specification. Contributions of any kind welcome!
License
MIT ยฉ akameco