Skip to content

Commit

Permalink
feat: add lineHeight config for headings (#894)
Browse files Browse the repository at this point in the history
  • Loading branch information
kkalavantavanich authored and RomanHotsiy committed Apr 19, 2019
1 parent 82c0cb1 commit 5dd5d6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/common-elements/headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')};
`;
Expand Down
2 changes: 2 additions & 0 deletions src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ const defaultTheme: ThemeInterface = {
headings: {
fontFamily: 'Montserrat, sans-serif',
fontWeight: '400',
lineHeight: '1.6em',
},
code: {
fontSize: '13px',
Expand Down Expand Up @@ -282,6 +283,7 @@ export interface ResolvedThemeInterface {
headings: {
fontFamily: string;
fontWeight: string;
lineHeight: string;
};

links: {
Expand Down

0 comments on commit 5dd5d6d

Please sign in to comment.