1.0.0 • Published 7 years ago

emmet-hyperscript v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

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