Skip to content

Commit 5dd5d6d

Browse files
kkalavantavanichRomanHotsiy
authored andcommitted
feat: add lineHeight config for headings (#894)
1 parent 82c0cb1 commit 5dd5d6d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/common-elements/headers.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ const headerFontSize = {
77
};
88

99
export const headerCommonMixin = level => css`
10-
font-family: ${props => props.theme.typography.headings.fontFamily};
10+
font-family: ${({ theme }) => theme.typography.headings.fontFamily};
1111
font-weight: ${({ theme }) => theme.typography.headings.fontWeight};
1212
font-size: ${headerFontSize[level]};
13+
line-height: ${({ theme }) => theme.typography.headings.lineHeight};
1314
`;
1415

1516
export const H1 = styled.h1`
1617
${headerCommonMixin(1)};
17-
color: ${props => props.theme.colors.primary.main};
18+
color: ${({ theme }) => theme.colors.primary.main};
1819
1920
${extensionsHook('H1')};
2021
`;

src/theme.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ const defaultTheme: ThemeInterface = {
105105
headings: {
106106
fontFamily: 'Montserrat, sans-serif',
107107
fontWeight: '400',
108+
lineHeight: '1.6em',
108109
},
109110
code: {
110111
fontSize: '13px',
@@ -282,6 +283,7 @@ export interface ResolvedThemeInterface {
282283
headings: {
283284
fontFamily: string;
284285
fontWeight: string;
286+
lineHeight: string;
285287
};
286288

287289
links: {

0 commit comments

Comments
 (0)