summaryrefslogtreecommitdiff
path: root/source/infra/css/main.css
blob: 93f8baa6eaf8ce17d56009b891c33535b3b711ac (plain)
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
/*** COLOR SCHEME ***/
:root {
	color-scheme: light dark;
	--b: #ededed;
	--f: #121212;
	--a: #0000ff;
	--l: #7f7f7f;
}
/* Invert the colors in dark mode, including for some images */
@media only screen and (prefers-color-scheme: dark) {
	:root {
		--b: #121212;
		--f: #ededed;
		--a: #ffff00;
		--l: #7f7f7f;
	}
	.darkinv {
		filter: invert(100%);
	}
}
html {
	color: #121212;
	color: var(--f);
	background: #ededed;
	background: var(--b);
}


/*** BASIC STRUCTURE ***/
/* Increase font size on mobile Firefox. I don't like this kind
 * of specific fix, but the font is ridiculously small for me. */
@supports (-moz-appearance: none) {
	@media only screen and (hover: none) and (pointer: coarse) {
		html {
			font-size: 200%
		}
	}
}
body {
	/* Improve consistency between systems */
	font-family: sans-serif;
	line-height: 1.5;
	-webkit-text-size-adjust: none;
	text-size-adjust: none;
	/* Center text and limit its width */
	max-width: 80ch;
	padding: 1ch;
	margin: auto;

}
/* Basic layout: header, article, footer */
#header {
	display: block;
	height: 3rem;
	font-size: 2.1rem;
	position: relative; /* for `#nav' */
}
#article {
	display: block;
	margin: 1rem 0;
}
#footer {
	display: block;
}
/* Ensure that `body' padding applies to bottom of `#footer' too */
#footer:after {
	content: "";
	display: block;
	clear: both;
}


/*** COMMON TAGS ***/
h1 {
	text-align: center;
	font-size: 2.1rem;
}
h2 {
	text-align: center;
	font-size: 1.8rem;
}
h3 {
	text-align: center;
	font-size: 1.5rem;
}
h4 {
	text-align: center;
	font-size: 1.2rem;
	font-style: italic;
}
a {
	background-color: transparent; /* normalize.css */
	text-decoration: none;
	color: #0000ff;
	color: var(--a);
}
img {
	border-style: none; /* normalize.css */
	display: block;
	max-width: 100%;
	height: auto;
	margin: auto;
}
table {
	margin: auto;
}
td {
	padding: 0 1.5rem;
}
/* TODO: this rule fixes code font on Firefox and Chromium,
 * but currently messes with code snippets a bit too much. */
/*code, pre {
	font-family: monospace, monospace;
	font-size: 1em;
}*/


/*** HEADER & FOOTER ***/
/* Break footer into multiple lines on narrow screens */
@media only screen and (max-width: 69ch) {
	#footer > div {
		width: 100%;
	}
}
/* Only highlight header/footer links on hover/click */
.no-hl-a a:link,
.no-hl-a a:visited {
	color: #121212;
	color: var(--f);
}
.no-hl-a a:hover,
.no-hl-a a:focus,
.no-hl-a a:active {
	color: #0000ff;
	color: var(--a);
}
/* Push header/footer elements to edges of body */
.align-l {
	float: left;
	text-align: left;
}
.align-r {
	float: right;
	text-align: right;
}
/* Visual separator between header, article and footer */
hr {
	border-top: 2px solid;
	border-color: #7f7f7f;
	border-color: var(--l);
	border-bottom: none;
}


/*** NAVIGATION ***/
/* Don't let `#nav-list` affect surroundings */
#nav {
	position: absolute;
	top: 0;
	right: 0;
}
/* Not a real link, so don't highlight it */
#nav-show {
	color: #121212;
	color: var(--f);
}
/* Submenu hidden until interaction, then appears on top.
 * Delay disappearance to hide flicker on mobile Firefox. */
#nav-list {
	visibility: hidden;
	max-height: 0;
	transition-delay: 0.3s;
	position: relative;
	z-index: 1;
	border: 2px solid;
	background: #ededed;
	background: var(--b);
}
/* Unhide on hover, click, and Tab-key focus */
#nav:hover > #nav-list,
#nav:focus-within > #nav-list,
#nav-show:hover + #nav-list,
#nav-show:focus + #nav-list,
#nav-show:active + #nav-list {
	visibility: visible;
	max-height: 9999px;
	transition-delay: 0s;
}
/* For the entries in `#nav-list' */
.nav-entry {
	padding: 0 0.5rem 0.2rem 0.5rem;
}
.nav-entry + .nav-entry {
	border-top: 2px solid;
	border-color: #7f7f7f;
	border-color: var(--l);
}
.nav-entry-name {
	font-size: 2rem;
}
.nav-entry-desc {
	font-size: 1rem;
}


/*** COLLAPSIBLE BOXES ***/
.collapse-hidden {
	display: none;
}
/* Invisible checkbox, toggled by clicking label */
.collapse-toggle {
	display: none;
}
.collapse > label,
.collapse-starts + p > label {
	color: #0000ff;
	color: var(--a);
	cursor: pointer;
}
/* When the checkbox is ticked, hide label and show contents */
.collapse-toggle:checked + label {
	display: none;
}
.collapse-toggle:checked + label + .collapse-hidden {
	display: block;
}
.collapse-starts + p {
	margin-top: 0;
}
/* Visual differentiator for collapsible proofs */
.proof {
	padding: 0.25rem 0.5rem;
	border: 3px dotted;
}


/*** MATHS TWEAKS ***/
/* Prevent vertical overflow, allow horizontal scrolling */
.katex-display {
	padding-top: 0.25rem;
	overflow-x: auto;
	overflow-y: hidden;
}
/* Don't allow line breaks in inline formulas */
p > .katex {
	white-space: nowrap;
}