reactcss

:lipstick: Inline Styles in JS

Github星跟踪图

ReactCSS

Build Status
dependency status
dev dependency status
License
Downloads

Inline Styles in JS with support for React, React Native, Autoprefixing, Hover, Pseudo-Elements & Media Queries

Install

npm install reactcss --save

Style Object

Define a default styles for your elements:

import reactCSS from 'reactcss'

const styles = reactCSS({
  'default': {
    card: {
      background: this.props.background,
      boxShadow: '0 2px 4px rgba(0,0,0,.15)',
    },
  },
})

Pass style definitions via inline styles:

<div style={ styles.card } />

Activating Classes

Activate additional classes by passing down objects as additional parameters to reactCSS:

const styles = reactCSS({
  'default': {
    card: {
      background: '#fff',
      boxShadow: '0 2px 4px rgba(0,0,0,.15)',
    },
  },
  'zIndex-2': {
    card: {
      boxShadow: '0 4px 8px rgba(0,0,0,.15)',
    },
  },
}, {
  'zIndex-2': props.zIndex === 2,
})

Documentation

See the Full Documentation

Examples

Examples and projects built with reactCSS:

Felony - Next Level PGP Desktop App
React Color - Color Pickers from Sketch, Photoshop, Chrome, Github, Twitter & more
Buffer App Components - A shared set of UI Components
React Reactions - Use Reactions from Slack, Facebook, Pokemon, Github and Youtube

主要指标

概览
名称与所有者casesandberg/reactcss
主编程语言JavaScript
编程语言JavaScript (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2015-06-25 06:20:52
推送于2020-08-14 15:49:07
最后一次提交2017-09-07 16:39:57
发布数3
最新版本名称1.2.0 (发布于 )
第一版名称1.0.0 (发布于 )
用户参与
星数1.6k
关注者数23
派生数75
提交数384
已启用问题?
问题数45
打开的问题数2
拉请求数31
打开的拉请求数5
关闭的拉请求数72
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?