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

主要指標

概覽
名稱與所有者nkbt/react-collapse
主編程語言JavaScript
編程語言JavaScript (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2015-10-15 12:10:12
推送於2022-10-19 15:32:19
最后一次提交2022-10-19 23:32:19
發布數54
最新版本名稱v5.1.1 (發布於 2021-11-24 00:33:50)
第一版名稱v1.0.0 (發布於 2015-10-16 01:43:54)
用户参与
星數1.1k
關注者數6
派生數111
提交數664
已啟用問題?
問題數150
打開的問題數8
拉請求數79
打開的拉請求數2
關閉的拉請求數81
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?