Skip to content

Instantly share code, notes, and snippets.

@cahnory
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cahnory/db15b969c050f9284d63 to your computer and use it in GitHub Desktop.
Save cahnory/db15b969c050f9284d63 to your computer and use it in GitHub Desktop.
What I want to style react components
// This code does not work!
// It's just a thought about a way of adding style to a react component
React.createClass({
render: function () {
return (
<div ref="module">
<div ref="title">{ props.user.title }</div>
<div ref="description">{ props.user.description }</div>
</div>
);
},
style: function () {
return (
module {
padding: 1em;
}
title {
font-size: 1.5em;
// `@` cause I'm used to sass but could be any working syntax
@if props.user.isAdmin {
font-weight: bold;
}
}
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment