Last active
August 29, 2015 14:21
-
-
Save cahnory/db15b969c050f9284d63 to your computer and use it in GitHub Desktop.
What I want to style react components
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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