general.css

  1/* Base styles and content styles */
  2
  3@import "variables.css";
  4
  5:root {
  6  /* Browser default font-size is 16px, this way 1 rem = 10px */
  7  font-size: 62.5%;
  8  color-scheme: var(--color-scheme);
  9}
 10
 11html {
 12  font-family: var(--font);
 13  color: var(--fg);
 14  background-color: var(--bg);
 15  text-size-adjust: none;
 16  -webkit-text-size-adjust: none;
 17
 18  text-rendering: geometricPrecision !important;
 19  -webkit-font-smoothing: antialiased !important;
 20  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.005);
 21}
 22
 23body {
 24  margin: 0;
 25  font-size: 1.6rem;
 26  overflow-x: hidden;
 27}
 28
 29code {
 30  font-family: var(--mono-font) !important;
 31  font-size: var(--code-font-size);
 32  direction: ltr !important;
 33}
 34
 35/* make long words/inline code not x overflow */
 36main {
 37  overflow-wrap: break-word;
 38}
 39
 40/* make wide tables scroll if they overflow */
 41.table-wrapper {
 42  overflow-x: auto;
 43}
 44
 45h1,
 46h2,
 47h3,
 48h4,
 49h5,
 50h6 {
 51  font-family: var(--title-font);
 52  font-weight: 480;
 53  color: var(--title-color);
 54}
 55
 56/* Don't change font size in headers. */
 57h1 code,
 58h2 code,
 59h3 code,
 60h4 code,
 61h5 code,
 62h6 code {
 63  font-size: unset;
 64}
 65
 66.left {
 67  float: left;
 68}
 69.right {
 70  float: right;
 71}
 72.boring {
 73  opacity: 0.6;
 74}
 75.hide-boring .boring {
 76  display: none;
 77}
 78.hidden {
 79  display: none !important;
 80}
 81
 82h2,
 83h3 {
 84  margin-block-start: 1.5em;
 85  margin-block-end: 0;
 86}
 87h4,
 88h5 {
 89  margin-block-start: 2em;
 90}
 91
 92.header + .header h3,
 93.header + .header h4,
 94.header + .header h5 {
 95  margin-block-start: 1em;
 96}
 97
 98h1:target::before,
 99h2:target::before,
100h3:target::before,
101h4:target::before,
102h5:target::before,
103h6:target::before {
104  display: inline-block;
105  content: "ยป";
106  margin-inline-start: -30px;
107  width: 30px;
108}
109
110/* This is broken on Safari as of version 14, but is fixed
111   in Safari Technology Preview 117 which I think will be Safari 14.2.
112   https://bugs.webkit.org/show_bug.cgi?id=218076
113*/
114:target {
115  /* Safari does not support logical properties */
116  scroll-margin-top: calc(var(--menu-bar-height) + 2rem);
117}
118
119.page {
120  outline: 0;
121  padding: 0 var(--page-padding);
122  margin-block-start: calc(
123    0px - var(--menu-bar-height)
124  ); /* Compensate for the #menu-bar-hover-placeholder */
125}
126.page-wrapper {
127  box-sizing: border-box;
128  background-color: var(--bg);
129}
130.no-js .page-wrapper,
131.js:not(.sidebar-resizing) .page-wrapper {
132  transition:
133    margin-left 0.3s ease,
134    transform 0.3s ease; /* Animation: slide away */
135}
136[dir="rtl"] .js:not(.sidebar-resizing) .page-wrapper {
137  transition:
138    margin-right 0.3s ease,
139    transform 0.3s ease; /* Animation: slide away */
140}
141
142.content {
143  overflow-y: auto;
144  padding: 48px 4px;
145}
146.content main {
147  margin-inline-start: auto;
148  margin-inline-end: auto;
149  max-width: var(--content-max-width);
150}
151.content p {
152  line-height: 1.625em;
153}
154.content div.video {
155  margin-top: 1rem;
156  border: 1px solid;
157  border-color: var(--border);
158  border-radius: 8px;
159  overflow: clip;
160}
161.content div.video iframe {
162  margin: 0;
163}
164.content ol {
165  line-height: 1.8;
166  padding-left: 1.8em;
167}
168.content ul {
169  line-height: 1.8;
170  padding-left: 1.8em;
171}
172.content li {
173  padding-left: 0.5em;
174}
175.content a {
176  text-decoration: underline;
177  text-decoration-color: hsl(219, 93%, 42%, 0.2);
178}
179.content a:hover {
180  text-decoration-color: hsl(219, 93%, 42%, 0.5);
181}
182.content img,
183.content video {
184  max-width: 100%;
185  border: 1px solid;
186  border-color: var(--border);
187  border-radius: 8px;
188  overflow: clip;
189}
190.content .header:link,
191.content .header:visited {
192  color: var(--title-color);
193}
194.content .header:link,
195.content .header:visited:hover {
196  text-decoration: none;
197}
198
199iframe {
200  margin-top: 1rem;
201  margin-bottom: 10rem;
202}
203
204table {
205  width: 100%;
206  border-collapse: collapse;
207  font-size: 1.4rem;
208}
209table td {
210  padding: 4px 12px;
211  border: 1px var(--table-border-color) solid;
212}
213table thead {
214  background: var(--table-header-bg);
215}
216table thead td {
217  font-weight: 700;
218  border: none;
219}
220table thead th {
221  padding: 6px 12px;
222  color: #000;
223  text-align: left;
224  border: 1px var(--table-border-color) solid;
225}
226table thead tr {
227  border: 1px var(--table-border-color) solid;
228}
229/* Alternate background colors for rows */
230table tbody tr:nth-child(2n) {
231  background: var(--table-alternate-bg);
232}
233
234blockquote {
235  margin: auto;
236  margin-top: 1rem;
237  padding: 1rem 1.25rem;
238  color: var(--fg);
239  background-color: var(--quote-bg);
240  border: 1px solid var(--quote-border);
241}
242
243blockquote > p {
244  margin: 0;
245  padding-left: 2.6rem;
246  font-size: 1.4rem;
247}
248
249blockquote:before {
250  position: absolute;
251  content: "โ“˜";
252  margin: 0.3rem 0;
253  width: 1.6rem;
254  height: 1.6rem;
255  font-size: 1.6rem;
256  font-weight: bold;
257  color: var(--icons);
258  display: flex;
259  align-items: center;
260  justify-content: center;
261  line-height: 1.625em;
262}
263
264blockquote .warning:before {
265  background-color: var(--quote-bg);
266}
267
268.warning {
269  margin: auto;
270  padding: 1rem 1.25rem;
271  background-color: var(--warning-bg);
272  border: 1px solid var(--warning-border);
273}
274
275.warning > p {
276  margin: 0;
277  padding-left: 2.6rem;
278  font-size: 1.4rem;
279}
280
281.warning:before {
282  position: absolute;
283  content: "โ“˜";
284  margin: 0.3rem 0;
285  width: 1.6rem;
286  height: 1.6rem;
287  font-size: 1.6rem;
288  font-weight: bold;
289  color: var(--warning-icon);
290  display: flex;
291  align-items: center;
292  justify-content: center;
293  line-height: 1.625em;
294}
295
296kbd {
297  background-color: rgba(8, 76, 207, 0.1);
298  border-radius: 4px;
299  border: solid 1px var(--theme-popup-border);
300  box-shadow: inset 0 -1px 0 var(--theme-hover);
301  display: inline-block;
302  font-size: var(--code-font-size);
303  font-family: var(--mono-font);
304  line-height: 10px;
305  padding: 4px 5px;
306  vertical-align: middle;
307}
308
309:not(.footnote-definition) + .footnote-definition,
310.footnote-definition + :not(.footnote-definition) {
311  margin-block-start: 2em;
312}
313.footnote-definition {
314  font-size: 0.9em;
315  margin: 0.5em 0;
316}
317.footnote-definition p {
318  display: inline;
319}
320
321.tooltiptext {
322  position: absolute;
323  visibility: hidden;
324  color: #fff;
325  background-color: #333;
326  transform: translateX(
327    -50%
328  ); /* Center by moving tooltip 50% of its width left */
329  left: -8px; /* Half of the width of the icon */
330  top: -35px;
331  font-size: 0.8em;
332  text-align: center;
333  border-radius: 6px;
334  padding: 5px 8px;
335  margin: 5px;
336  z-index: 1000;
337}
338.tooltipped .tooltiptext {
339  visibility: visible;
340}
341
342.chapter li.part-title {
343  font-size: 18px;
344  font-family: var(--title-font);
345  font-weight: 520;
346  color: var(--title-color);
347  margin: 5px 0;
348  margin-top: 2rem;
349}
350
351.result-no-output {
352  font-style: italic;
353}
354
355code.hljs {
356  color: hsl(221, 13%, 10%) !important;
357  background-color: hsla(221, 93%, 42%, 0.1);
358}