Skip to content

Instantly share code, notes, and snippets.

@mfix22
Created May 6, 2019 18:31
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 mfix22/f48aec2bbb52552dbbb7229b64b46ce8 to your computer and use it in GitHub Desktop.
Save mfix22/f48aec2bbb52552dbbb7229b64b46ce8 to your computer and use it in GitHub Desktop.
Basic styled-system component that accesses theme
// No need to import `react` or `styled-components`!
import system from 'system-components'
export const Heading = system(
{
is: 'h1',
// primary, medium, text, etc. are all theme variables!
fontFamily: 'primary',
fontSize: 5,
fontWeight: 'medium',
lineHeight: 'normal',
m: 0,
color: 'text'
},
// only allow a few props to be used
'fontFamily',
'textAlign'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment