Skip to content

Instantly share code, notes, and snippets.

@jamiejohnsonkc
Last active June 4, 2020 16:21
Show Gist options
  • Select an option

  • Save jamiejohnsonkc/7fc31b8c93d7ee3d406abeaa8977ee0f to your computer and use it in GitHub Desktop.

Select an option

Save jamiejohnsonkc/7fc31b8c93d7ee3d406abeaa8977ee0f to your computer and use it in GitHub Desktop.
For shorthand properties or ones not automaically mapped to values in the theme, use an inline function to reference values from the theme object
/** @jsx jsx */
import { jsx } from 'theme-ui'
export default props => (
<div
{...props}
sx={{
boxShadow: theme => `0 0 4px ${theme.colors.primary}`,
}}
/>
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment