Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

💄 Inline Styles in JS

License

NotificationsYou must be signed in to change notification settings

casesandberg/reactcss

Repository files navigation

Build Statusdependency statusdev dependency statusLicenseDownloads

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

Install

npm install reactcss --save

Style Object

Define a default styles for your elements:

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

Pass style definitions via inline styles:

<divstyle={styles.card}/>

Activating Classes

Activate additional classes by passing down objects as additional parameters toreactCSS:

conststyles=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 theFull Documentation

Examples

Examples and projects built with reactCSS:

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


[8]ページ先頭

©2009-2025 Movatter.jp