This repository was archived by the owner on Feb 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 131
/
Copy pathGlobalStyles.js
74 lines (68 loc) · 1.51 KB
/
GlobalStyles.js
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
import React from "react";
import { createGlobalStyle, css } from "styled-components";
import styledNormalize from "styled-normalize";
import { FONT_FAMILY, MEDIA_QUERIES } from "constants/styles";
import { expansionStyles } from "components/Expansion";
// Nested styled-component styles in makeLinkedHeader helper were not rendering
// as expected in production (fine in development). Class style works and
// nesting is not necessary.
const linkedHeadingStyles = css`
position: relative;
scroll-margin-top: 5rem;
padding-left: 1.25rem;
margin-left: -1.25rem;
@media (${MEDIA_QUERIES.canHover}) {
&:hover svg {
visibility: visible;
}
}
& svg {
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
visibility: hidden;
}
`;
const Styles = createGlobalStyle`
body,
html,
input,
textarea,
button {
color: ${({ theme }) => theme.text};
}
body {
min-height: 100vh;
padding: 0;
margin: 0;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
${styledNormalize}
body,
html,
input,
textarea,
button {
font-size: 16px;
font-weight: 400;
font-family: ${FONT_FAMILY.base};
line-height: 1;
}
/* http://tachyons.io/docs/layout/box-sizing/ */
body * {
box-sizing: border-box;
}
twitter-widget {
margin: auto;
}
[hidden] {
display: block !important;
}
${expansionStyles}
.linkedHeading {
${linkedHeadingStyles}
}
`;
export const GlobalStyles = () => <Styles />;