1.2.3 • Published 6 years ago

atra v1.2.3

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

atra

npm npm Build Status Codecov cdn

separate attribute by immutable / mutable in render.

basic features:

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

Installation

yarn add atra

Usage

import React from 'react'
import Atra from 'atra'

export default (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>
)

const atra = 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)

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago