Created
May 11, 2017 15:42
-
-
Save aaronmcadam/d955ec9ce950b280b4f6707dc4457242 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import styled, { css } from 'styled-components'; | |
import { baseTheme, getFont } from '../../../themes/src/index'; | |
import { getFontSize } from './helpers'; | |
const styles = css` | |
font-family: ${getFont('bold')}; | |
font-weight: 500; | |
font-size: ${getFontSize}; | |
margin: 0; | |
margin-top: 1rem; | |
margin-bottom: 1rem; | |
`; | |
const Heading = styled(({ level, children, ...props }) => | |
React.createElement(`h${level}`, props, children) | |
)`${styles}`; | |
Heading.defaultProps = { | |
level: 1, | |
theme: baseTheme, | |
}; | |
export default Heading; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment