feat: add lineHeight config for headings (#894)

This commit is contained in:
Kris Kalavantavanich 2019-04-19 15:31:50 +07:00 committed by Roman Hotsiy
parent 82c0cb1a3c
commit 5dd5d6d704
2 changed files with 5 additions and 2 deletions

View File

@ -7,14 +7,15 @@ const headerFontSize = {
};
export const headerCommonMixin = level => css`
font-family: ${props => props.theme.typography.headings.fontFamily};
font-family: ${({ theme }) => theme.typography.headings.fontFamily};
font-weight: ${({ theme }) => theme.typography.headings.fontWeight};
font-size: ${headerFontSize[level]};
line-height: ${({ theme }) => theme.typography.headings.lineHeight};
`;
export const H1 = styled.h1`
${headerCommonMixin(1)};
color: ${props => props.theme.colors.primary.main};
color: ${({ theme }) => theme.colors.primary.main};
${extensionsHook('H1')};
`;

View File

@ -105,6 +105,7 @@ const defaultTheme: ThemeInterface = {
headings: {
fontFamily: 'Montserrat, sans-serif',
fontWeight: '400',
lineHeight: '1.6em',
},
code: {
fontSize: '13px',
@ -282,6 +283,7 @@ export interface ResolvedThemeInterface {
headings: {
fontFamily: string;
fontWeight: string;
lineHeight: string;
};
links: {