Skip to content

Instantly share code, notes, and snippets.

@colingourlay
Last active January 17, 2016 05:01
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 colingourlay/3b35fd25c79643799955 to your computer and use it in GitHub Desktop.
Save colingourlay/3b35fd25c79643799955 to your computer and use it in GitHub Desktop.
Using crel + hyperstyles (browser only)
var hyperstyles = require('hyperstyles');
var styles = { /* Mock CSS Module */
'root': 'Car__root___fg434',
'front-door': 'Car__front-door___b85f9',
'back-door': 'Car__back-door___p9h7j'
};
var crel = hyperstyles(require('crel'), styles);
function render() {
return crel('div.root',
crel('div.front-door'),
crel('div.back-door')
);
}
console.log(render());
<div class="Car__root___fg434">
<div class="Car__front-door___b85f9"></div>
<div class="Car__back-door___p9h7j"></div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment