Skip to content

Commit 540a382

Browse files
authored
Bring CSS closer to Dokka
Right now the specification looks very different from the rest of the Kotlin documentation. This PR brings it closer to the fonts and colors used in Dokka.
1 parent 96ea9eb commit 540a382

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

web/resources/css/main.css

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* I add this to html files generated with pandoc.
33
*/
44

5+
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');
6+
57
html {
68
font-size: 100%;
79
overflow-y: scroll;
@@ -11,9 +13,9 @@ html {
1113

1214
body {
1315
color: #444;
14-
font-family: Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', serif;
15-
font-size: 12px;
16-
line-height: 1.7;
16+
font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Droid Sans, Helvetica Neue, Arial, sans-serif;
17+
font-size: 16px;
18+
line-height: 26px;
1719
padding: 1em 1em 1em 300px;
1820
margin: auto;
1921
max-width: 700px;
@@ -63,7 +65,7 @@ h2 {
6365
background: #fbfbfd;
6466

6567
font-size: 13px;
66-
font-family: Arial, serif;
68+
font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Droid Sans, Helvetica Neue, Arial, sans-serif;
6769

6870
z-index: 2;
6971
border-right: 1px solid rgba(39, 40, 44, 0.20);
@@ -355,7 +357,7 @@ h1, h2, h3, h4, h5, h6 {
355357
color: #111;
356358
line-height: 125%;
357359
margin-top: 2em;
358-
font-weight: normal;
360+
font-weight: 600;
359361
}
360362

361363
h4, h5, h6 {
@@ -366,6 +368,7 @@ h1 {
366368
font-size: 2.5em;
367369
counter-increment: part;
368370
counter-reset: chapter section subsection subsubsection paragraph;
371+
text-align: center;
369372
}
370373

371374
h1.unnumbered {
@@ -374,10 +377,6 @@ h1.unnumbered {
374377
counter-reset: none;
375378
}
376379

377-
h1:before {
378-
content: counter(part) "\0000a0\0000a0";
379-
}
380-
381380
h1.unnumbered:before {
382381
content: none;
383382
}
@@ -397,7 +396,9 @@ h2.unnumbered {
397396
h2:before {
398397
content: "Chapter\00a0" counter(chapter);
399398
display: block;
400-
margin-bottom: 2ex;
399+
margin-bottom: 5px;
400+
color: grey;
401+
font-style: italic;
401402
}
402403

403404
h2.unnumbered:before {
@@ -487,8 +488,7 @@ hr {
487488

488489
pre, code, kbd, samp {
489490
color: #000;
490-
font-family: monospace, monospace;
491-
_font-family: 'courier new', monospace;
491+
font: 400 15.5px/24px JetBrains Mono,SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;
492492
font-size: 0.98em;
493493
}
494494

@@ -498,6 +498,10 @@ pre {
498498
word-wrap: break-word;
499499
}
500500

501+
em {
502+
font-style: oblique;
503+
}
504+
501505
b, strong {
502506
font-weight: bold;
503507
}
@@ -612,6 +616,13 @@ table td {
612616
.author {
613617
font-size: 1.2em;
614618
text-align: center;
619+
margin: 0;
620+
}
621+
622+
.subtitle {
623+
font-size: 1.2em;
624+
text-align: center;
625+
font-style: italic;
615626
}
616627

617628
@media only screen and (min-width: 480px) {
@@ -1228,4 +1239,4 @@ h2, h3, h4, h5 {
12281239
#toc-element-kotlincore{
12291240
pointer-events: none;
12301241
cursor: default;
1231-
}
1242+
}

0 commit comments

Comments
 (0)