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: normal;
 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: 2em;
 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) + 0.5em);
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: 24px 4px 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: 0.5rem;
156    margin-bottom: 3rem;
157}
158.content ol {
159    line-height: 1.625em;
160}
161.content ul {
162    line-height: 1.625em;
163}
164.content a {
165    text-decoration: underline;
166    text-decoration-color: hsl(219, 93%, 42%, 0.2);
167}
168.content a:hover {
169    text-decoration-color: hsl(219, 93%, 42%, 0.5);
170}
171.content img,
172.content video {
173    max-width: 100%;
174}
175.content .header:link,
176.content .header:visited {
177    color: var(--title-color);
178}
179.content .header:link,
180.content .header:visited:hover {
181    text-decoration: none;
182}
183
184iframe {
185    margin-top: 1rem;
186    margin-bottom: 10rem;
187}
188
189table {
190    margin: 0 auto;
191    border-collapse: collapse;
192}
193table td {
194    padding: 3px 20px;
195    border: 1px var(--table-border-color) solid;
196}
197table thead {
198    background: var(--table-header-bg);
199}
200table thead td {
201    font-weight: 700;
202    border: none;
203}
204table thead th {
205    padding: 3px 20px;
206}
207table thead tr {
208    border: 1px var(--table-header-bg) solid;
209}
210/* Alternate background colors for rows */
211table tbody tr:nth-child(2n) {
212    background: var(--table-alternate-bg);
213}
214
215blockquote {
216    margin: auto;
217    margin-top: 1rem;
218    padding: 1rem 1.25rem;
219    color: var(--fg);
220    background-color: var(--quote-bg);
221    border: 1px solid var(--quote-border);
222}
223
224blockquote > p {
225    margin: 0;
226    padding-left: 2.6rem;
227    font-size: 1.4rem;
228}
229
230blockquote:before {
231    position: absolute;
232    content: "โ“˜";
233    margin: 0.3rem 0;
234    width: 1.6rem;
235    height: 1.6rem;
236    font-size: 1.6rem;
237    font-weight: bold;
238    color: var(--icons);
239    display: flex;
240    align-items: center;
241    justify-content: center;
242    line-height: 1.625em;
243}
244
245blockquote .warning:before {
246    background-color: var(--quote-bg);
247}
248
249.warning {
250    margin: auto;
251    padding: 1rem 1.25rem;
252    background-color: var(--warning-bg);
253    border: 1px solid var(--warning-border);
254}
255
256.warning > p {
257    margin: 0;
258    padding-left: 2.6rem;
259    font-size: 1.4rem;
260}
261
262.warning:before {
263    position: absolute;
264    content: "โ“˜";
265    margin: 0.3rem 0;
266    width: 1.6rem;
267    height: 1.6rem;
268    font-size: 1.6rem;
269    font-weight: bold;
270    color: var(--warning-icon);
271    display: flex;
272    align-items: center;
273    justify-content: center;
274    line-height: 1.625em;
275}
276
277kbd {
278    background-color: rgba(8, 76, 207, 0.1);
279    border-radius: 4px;
280    border: solid 1px var(--theme-popup-border);
281    box-shadow: inset 0 -1px 0 var(--theme-hover);
282    display: inline-block;
283    font-size: var(--code-font-size);
284    font-family: var(--mono-font);
285    line-height: 10px;
286    padding: 4px 5px;
287    vertical-align: middle;
288}
289
290:not(.footnote-definition) + .footnote-definition,
291.footnote-definition + :not(.footnote-definition) {
292    margin-block-start: 2em;
293}
294.footnote-definition {
295    font-size: 0.9em;
296    margin: 0.5em 0;
297}
298.footnote-definition p {
299    display: inline;
300}
301
302.tooltiptext {
303    position: absolute;
304    visibility: hidden;
305    color: #fff;
306    background-color: #333;
307    transform: translateX(
308        -50%
309    ); /* Center by moving tooltip 50% of its width left */
310    left: -8px; /* Half of the width of the icon */
311    top: -35px;
312    font-size: 0.8em;
313    text-align: center;
314    border-radius: 6px;
315    padding: 5px 8px;
316    margin: 5px;
317    z-index: 1000;
318}
319.tooltipped .tooltiptext {
320    visibility: visible;
321}
322
323.chapter li.part-title {
324    font-size: 18px;
325    font-family: var(--title-font);
326    color: var(--title-color);
327    margin: 5px 0;
328    margin-top: 2rem;
329}
330
331.result-no-output {
332    font-style: italic;
333}
334
335code.hljs {
336    color: rgb(75, 83, 97) !important;
337    background-color: rgba(8, 76, 207, 0.1);
338}