Skip to content

CSS-in-JS for @transclusion/vdom (inspired by styled-components).

Notifications You must be signed in to change notification settings

transclusion/vdom-styled

Repository files navigation

@transclusion/vdom-styled

CSS-in-JS for @transclusion/vdom (inspired by styled-components).

Usage

/* @jsx createVElement */

import { createVElement, diff, patch } from "@transclusion/vdom";
import { handleHook, styled } from "@transclusion/vdom-styled";

const noop = () => void 0;

const Headline = styled("h1")`
  font-size: ${props => props.size || 1}em;
`;

function App() {
  return (
    <div id="root">
      <Headline size={2}>Hello, world</Headline>
    </div>
  );
}

let vNode = <div id="root" />;

// Render app
patch(document.getElementById("root"), diff(vNode, <App />), noop, handleHook);

About

CSS-in-JS for @transclusion/vdom (inspired by styled-components).

Resources

Stars

Watchers

Forks

Packages

No packages published