-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
Copy pathheaders.ts
60 lines (48 loc) · 1.47 KB
/
headers.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import styled, { css, extensionsHook } from '../styled-components';
const headerFontSize = {
1: '1.85714em',
2: '1.57143em',
3: '1.27em',
};
export const headerCommonMixin = level => css`
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.attrs(props => ({
tabIndex: props.tabIndex || '0',
}))`
${headerCommonMixin(1)};
color: ${({ theme }) => theme.colors.text.primary};
${extensionsHook('H1')};
`;
export const H2 = styled.h2.attrs(props => ({
tabIndex: props.tabIndex || '0',
}))`
${headerCommonMixin(2)};
color: ${({ theme }) => theme.colors.text.primary};
margin: 0 0 20px;
${extensionsHook('H2')};
`;
export const H3 = styled.h2.attrs(props => ({
tabIndex: props.tabIndex || '0',
}))`
${headerCommonMixin(3)};
color: ${({ theme }) => theme.colors.text.primary};
${extensionsHook('H3')};
`;
export const RightPanelHeader = styled.h3`
color: ${({ theme }) => theme.rightPanel.textColor};
${extensionsHook('RightPanelHeader')};
`;
export const UnderlinedHeader = styled.h4`
border-bottom: 1px solid rgba(38, 50, 56, 0.3);
margin: 1em 0 1em 0;
color: rgba(38, 50, 56, 0.5);
font-weight: normal;
text-transform: uppercase;
font-size: 0.929em;
line-height: 20px;
${extensionsHook('UnderlinedHeader')};
`;