Skip to content

Instantly share code, notes, and snippets.

@aaronmcadam
Created May 11, 2017 15:42
Show Gist options
  • Save aaronmcadam/d955ec9ce950b280b4f6707dc4457242 to your computer and use it in GitHub Desktop.
Save aaronmcadam/d955ec9ce950b280b4f6707dc4457242 to your computer and use it in GitHub Desktop.
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