Created
August 19, 2015 22:56
-
-
Save chrislloyd/55f6d77ef5ec5804acf7 to your computer and use it in GitHub Desktop.
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
function cssmodularize(strings) { | |
/* TODO: Un-stub */ | |
return { | |
'.foo': 'Button-foo-abcd' | |
} | |
} | |
class Button { | |
static styles = cssmodularize` | |
.foo { /* ... */ } | |
` | |
render() { | |
const s = this.constructor.styles | |
console.log(s) | |
// ... | |
} | |
} | |
const button = new Button() | |
button.render() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why is this awesome? Separation of concerns. Everything concerning a button is in the one file. Syntax highlighting might be a bitch, but that can come later (hey, it happened for JSX).