npm.io
1.0.0 • Published 9 years ago

emmet-hyperscript

Licence
MIT
Version
1.0.0
Deps
0
Vulns
0
Weekly
0
Stars
1
DeprecatedThis package is deprecated

emmet-hyperscript

Travis CI build status Codacy grade

Emmet-style syntactic sugar for HyperScript and virtual-hyperscript.

Inspired by HtmlElement.

Examples

Plain HyperScript:

const h = require("hyperscript");

h(
    "div#page",
    h(
        "div#header",
        h("h1.classy", "Example", {style: {"background-color": "#22f"}})
    )
);

emmet-hyperscript:

const h = require("hyperscript");
const eh = require("emmet-hyperscript")(h);

eh(
    "div#page > div#header > h1.classy",
    "Example",
    {style: {"background-color": "#22f"}}
);

It works with hyperscript-helpers too:

const h = require("hyperscript");
const eh = require("emmet-hyperscript")(h);
const {div} = require("hyperscript-helpers")(eh);

div(
    "#page > div#header > h1.classy",
    "Example",
    {style: {"background-color": "#22f"}}
);

Changelog

License

MIT

Keywords