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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?