Skip to content

Repository files navigation

atra

npmnpmBuild StatusCodecovcdn

separate attribute by immutable / mutable in render.

basic features:

Automatic Vendor PrefixingPseudo ClassesMedia QueriesStyles As Object LiteralsExtract CSS File
×××

Installation

yarn add atra

Usage

importReactfrom'react'importAtrafrom'atra'exportdefault(props)=>(<div{...atra('div',{className: props.foo ? 'hoge' : ''})}><span{...atra('span1')}/><span{...atra('span2',{style: {transition: props.bar&&'1s',opacity: props.bar ? 1 : 0}})}/></div>)constatra=Atra({div: {id: 'semantic',style: {position: 'relative'}},span1: {className: 'fuga',style: {color: '#483738'}},span2: {style: {color: '#482716',opacity: 0.5// <= ignore}}})

API

Atra({ [name]: immutable }[, prefixerConfig])

atra(name[, mutable])

immutable, mutable is used as attribute object.

prefixerConfig is inline-style-prefixer's.

License

MIT (http://opensource.org/licenses/MIT)

About

manage attributes in react

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages