Skip to content

Instantly share code, notes, and snippets.

@aaronmcadam
Created September 26, 2017 14:54
Show Gist options
  • Save aaronmcadam/5823f519a21922ab890f4b4cca79cfc9 to your computer and use it in GitHub Desktop.
Save aaronmcadam/5823f519a21922ab890f4b4cca79cfc9 to your computer and use it in GitHub Desktop.
import React from 'react';
import styled, { css } from 'styled-components';
import { baseTheme, getFont } from '@crowdlab/themes';
import { getFontSize } from './helpers';
const HeadingBase = styled.h1`
font-family: ${getFont('bold')};
font-weight: 500;
font-size: ${getFontSize};
margin: 0;
margin-top: 1rem;
margin-bottom: 1rem;
`;
const Heading = ({ level, ...props }) => {
const Component = HeadingBase.withComponent(`h${level}`);
return <Component {...props} />;
};
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