apeman-react-style
apeman react package for style component.
Last updated a year ago by okunishinishi .
MIT · Repository · Bugs · Original npm · Tarball
$ cnpm install apeman-react-style 
SYNC missed versions from official npm registry.

apeman-react-style

Build Status Code Climate Code Coverage npm Version JS Standard

apeman react package for style component.

Installation

$ npm install apeman-react-style --save

Usage

Convert react inline style attribute into style tag.

'use strict'

import React from 'react'
import {ApStyle} from 'apeman-react-style'

const ExampleComponent = React.createClass({
  render () {
    let style01 = {
      'my-component-01 button': {
        backgroundColor: '#FFF',
        color: '#555'
      }
    }
    let style02 = {
      'my-component-02 button': { /* ... */ }
    }
    return (
      <div>
        <ApStyle data={ style01 }/>
        <ApStyle data={ style02 }/>
      </div>
    )
  }
})

This will results,

<html>
<head>
    <style type="text/css">
        .my-component-01 button {
            background-color: #FFF;
            color: #555;
        }

        .my-component-02 button {
            /*...*/
        }
    </style>
</head>
</html>

Props

Key Type Description
data string|object Css string or style data.
prefix string Parent selector for each styles to add.

Components

ApStyle

Props

Name Type Default Description
data string objectOf null
smallMediaData string object null
mediumMediaData string object null
largeMediaData string object null
type string 'text/css'

License

This software is released under the MIT License.

Links

Maintainers (1)
Downloads
Today 0
This Week 2
This Month 5
Last Day 2
Last Week 0
Last Month 2
Dependencies (2)
Dev Dependencies (24)
Dependents (86)

Copyright 2014 - 2017 © taobao.org |