Extracted mdx-mapped headings to a separate file. Applied correct sizing to headings

This commit is contained in:
Piotr Janosz
2019-07-15 14:58:48 +02:00
committed by fabioberger
parent 9df09e2464
commit 9b9960c7b9
2 changed files with 37 additions and 19 deletions

View File

@@ -0,0 +1,33 @@
import styled from 'styled-components';
import { Heading } from 'ts/components/text';
const H1 = styled(Heading).attrs({
size: 'large',
marginBottom: '1.875rem',
})``;
const H2 = styled(Heading).attrs({
size: 34,
asElement: 'h2',
marginBottom: '1rem',
})`
/* @TODO: adjust the heading size variables in global styles instead of using custom size here */
@media (max-width: 768px) {
font-size: 20px !important;
}
`;
const H3 = styled(Heading).attrs({
size: 'default',
asElement: 'h3',
marginBottom: '1rem',
})``;
const H4 = styled(Heading).attrs({
size: 'small',
asElement: 'h4',
fontWeight: '300',
marginBottom: '1rem',
})``;
export { H1, H2, H3, H4 };