Skip to content

Instantly share code, notes, and snippets.

@colingourlay
Created January 17, 2016 03:38
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/689186ba58b5cf1e9e4d to your computer and use it in GitHub Desktop.
Save colingourlay/689186ba58b5cf1e9e4d to your computer and use it in GitHub Desktop.
Using virtual-hypercript + hyperstyles + hyperx
var vdom = require('virtual-dom');
var hyperx = require('hyperx');
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 hx = hyperx(hyperstyles(vdom.h, styles));
function render() {
return hx`<div styleName="root">
<div styleName="front-door"></div>
<div styleName="back-door"></div>
</div>`;
}
console.log(vdom.create(render()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment