one-styled
v1.0.7
Published
Vue styled components
Downloads
1
Readme
one-styled
Vue styled components
Install
npm install one-styled
Usage
import Vue from 'vue'
import OneStyled from 'one-styled'
import { createRenderer } from 'fela'
Vue.use(OneStyled, {
renderer: createRenderer(// fela options),
// optional theme object
theme: {
primary: 'dodgerblue',
},
})
Create component
The 'one' function takes 3 arguments.
import { one } from 'one-styled'
const UIBtn = one('button', () => ({ color: 'red' }))
const UIBtnLarge = one(Btn, () => ({ height: '48px' }))
A tag name (String) or another component created with 'one' to extend on
A function that returns a Fela rule object
Vue props definitions (Optional)
import { one } from 'one-styled'
export default one(
'button',
({ primary, theme }) => ({
color: primary ? theme.primary : 'red',
}),
{
primary: Boolean,
}
)