-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstyles.ts
144 lines (139 loc) · 3.63 KB
/
styles.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import { mode } from "@chakra-ui/theme-tools"
import { lightTheme as oldTheme } from "../../theme"
const styles = {
global: (props) => ({
/**
* THESE ARE OLD GLOBAL STYLES - carried over from old css files
*
* They are needed just to keep style consistency as we transition out of
* the old styled components to Chakra.
*
* TODO: remove these overrides as we adopt the new Design System and we
* don't need the global styles anymore
*/
body: {
// TODO: when we have Chakra v2, this should be done by overriding the
// native Chakra semantic tokens
bg: mode("white", "gray.700")(props),
lineHeight: "1.6rem",
},
a: {
color: "primary",
textDecoration: "underline",
},
// should be replace with https://chakra-ui.com/docs/components/text
p: {
margin: "0px 0px 1.45rem",
},
// should be replace with https://chakra-ui.com/docs/components/list
"ul, ol": {
margin: "0px 0px 1.45rem 1.45rem",
padding: 0,
},
// imported global CSS styles for list items
li: {
"margin-bottom": "calc(1.45rem / 2)",
},
"ol li": {
"padding-left": "0",
},
"ul li": {
"padding-left": "0",
},
"li > ol": {
"margin-left": "1.45rem",
"margin-bottom": "calc(1.45rem / 2)",
"margin-top": "calc(1.45rem / 2)",
},
"li > ul": {
"margin-left": "1.45rem",
"margin-bottom": "calc(1.45rem / 2)",
"margin-top": "calc(1.45rem / 2)",
},
"li *:last-child": {
"margin-bottom": "0",
},
"p *:last-child": {
"margin-bottom": "0",
},
"li > p": {
"margin-bottom": "calc(1.45rem / 2)",
},
// should be replace by the usage of https://chakra-ui.com/docs/components/heading
// also, the media queries defined on each of these heading tags are bearly used
"h1,h2,h3,h4,h5,h6": {
margin: "2rem 0",
lineHeight: 1.4,
scrollMarginTop: "navHeight",
scrollSnapMargin: "navHeight",
},
h1: {
fontSize: "3rem",
fontWeight: 700,
[`@media (max-width: ${oldTheme.breakpoints.m})`]: {
fontSize: "2.5rem",
},
},
h2: {
fontSize: "2rem",
marginTop: "3rem",
fontWeight: 600,
[`@media (max-width: ${oldTheme.breakpoints.m})`]: {
fontSize: "1.5rem",
},
},
h3: {
fontSize: "1.5rem",
marginTop: "2.5rem",
fontWeight: 600,
[`@media (max-width: ${oldTheme.breakpoints.m})`]: {
fontSize: "1.25rem",
},
},
h4: {
fontSize: "1.25rem",
fontWeight: 500,
[`@media (max-width: ${oldTheme.breakpoints.m})`]: {
fontSize: "1rem",
},
},
h5: {
fontSize: "1rem",
fontWeight: 450,
},
h6: {
fontSize: "0.9rem",
fontWeight: 400,
textTransform: "uppercase",
},
// Anchor tag styles
// Selected specifically for mdx rendered side icon link
".header-anchor": {
position: "relative !important",
display: "initial",
marginLeft: "-1.5em",
paddingRight: "0.5rem !important",
fontSize: "1rem",
verticalAlign: "middle",
svg: {
display: "inline",
fill: "primary",
visibility: "hidden",
},
},
"h1:hover,h2:hover,h3:hover,h4:hover,h5:hover,h6:hover": {
".header-anchor svg": {
visibility: "visible",
},
},
".header-anchor:focus svg": {
visibility: "visible",
},
"pre, code, kbd, samp": {
fontSize: "0.8em",
lineHeight: "1.1rem",
fontFamily: "SFMono-Regular,Menlo,Monaco,Consolas,monospace",
},
}),
}
export default styles