package
Apply styles from CSS to React DOM
npm install react-styledGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
:warning: Highly experimental tool for applying styles to React components.
TODO:
:before is used<style> tag generation for custom classesindex.css:
button {
border: 1px solid #eee;
}
button span {
color: blue;
}
button[pressed="yes"] span {
color: red;
}index.jsx:
var React = require('react');
var Styled = require('react-styled');
// Somehow get index.css contents, webpack for example:
var styled = new Styled(require('css!./index.css'));
var Button = React.createClass({
getInitialState: function() {
return {pressed: 'no'};
},
onMouseUp: function () {
this.setState({pressed: 'no'});
},
onMouseLeave: function () {
Magic.
Returns decorator Function for wrapping render method of React component.
Not so much yet.
MIT © Vsevolod Strukchinsky