Skip to content

Instantly share code, notes, and snippets.

@karlsander
Created January 22, 2020 12:23
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 karlsander/69c6eac6e3309f0b242cad9af07c1ebe to your computer and use it in GitHub Desktop.
Save karlsander/69c6eac6e3309f0b242cad9af07c1ebe to your computer and use it in GitHub Desktop.
theme-ui sx for className
import { theme } from "./theme"
import sxCSS from "@styled-system/css"
import { css } from "emotion"
export function csx(style) {
return css(sxCSS(style)(theme))
}
import React from "react"
import { csx } from "csx"
export const Hi = () => <div className={csx({m: 4, color: "primary")}>Hi</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment