Last active
April 23, 2017 20:42
-
-
Save JonathanZWhite/f758446fad0520e4792cfe027354991b 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, { PropTypes } from 'react'; | |
import { StyleSheet, css } from 'aphrodite/no-important'; | |
import { tagMapping, fontSize, fontWeight, lineHeight } from '../styles/base/typography'; | |
function Heading(props) { | |
const { children, tag: Tag } = props; | |
return <Tag className={css(styles[tagMapping[Tag]])}>{children}</Tag>; | |
} | |
export default Heading; | |
export const styles = StyleSheet.create({ | |
displayLarge: { | |
fontSize: fontSize.displayLarge, | |
fontWeight: fontWeight.bold, | |
lineHeight: lineHeight.displayLarge, | |
}, | |
displayMedium: { | |
fontSize: fontSize.displayMedium, | |
fontWeight: fontWeight.normal, | |
lineHeight: lineHeight.displayLarge, | |
}, | |
displaySmall: { | |
fontSize: fontSize.displaySmall, | |
fontWeight: fontWeight.bold, | |
lineHeight: lineHeight.displaySmall, | |
}, | |
heading: { | |
fontSize: fontSize.heading, | |
fontWeight: fontWeight.bold, | |
lineHeight: lineHeight.heading, | |
}, | |
subheading: { | |
fontSize: fontSize.subheading, | |
fontWeight: fontWeight.bold, | |
lineHeight: lineHeight.subheading, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment