From 5dd5d6d704ec6e6f739c6f0c4ac868c73fbca0a0 Mon Sep 17 00:00:00 2001 From: Kris Kalavantavanich Date: Fri, 19 Apr 2019 15:31:50 +0700 Subject: [PATCH] feat: add lineHeight config for headings (#894) --- src/common-elements/headers.ts | 5 +++-- src/theme.ts | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common-elements/headers.ts b/src/common-elements/headers.ts index 4e38b485..88b1c377 100644 --- a/src/common-elements/headers.ts +++ b/src/common-elements/headers.ts @@ -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')}; `; diff --git a/src/theme.ts b/src/theme.ts index c31fd369..9b274097 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -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: {