Skip to content

Commit b36f4e4

Browse files
authored
Merge pull request #311 from iamgio/theme/hyperlegible
feat(theme): add hyperlegible layout theme
2 parents e81bbbc + 20af8bf commit b36f4e4

File tree

7 files changed

+118
-16
lines changed

7 files changed

+118
-16
lines changed

quarkdown-html/src/main/resources/render/theme/components/_code.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
}
8181

8282
.color-preview {
83+
margin-left: 0.4em;
8384
width: 0.5em;
8485
height: 0.5em;
8586
}

quarkdown-html/src/main/resources/render/theme/components/_table.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
.quarkdown table:not(pre table) {
2-
:is(th, td):not([align]) {
2+
th:not([align]) {
3+
text-align: var(--qd-table-default-header-alignment);
4+
}
5+
6+
td:not([align]) {
37
text-align: var(--qd-table-default-cell-alignment);
48
}
59

quarkdown-html/src/main/resources/render/theme/global.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105

106106
// Tables
107107
--qd-table-default-cell-alignment: initial; // Text alignment of table cells, if not specified
108+
--qd-table-default-header-alignment: var(--qd-table-default-cell-alignment); // Text alignment of table header cells, if not specified
108109

109110
// Quotes
110111
--qd-quote-type-label-suffix: ": "; // Suffix for localized quote type labels, e.g. Tip, Note, Warning, ...
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
@use "util/progressive-heading-sizes" as *;
2+
@use "util/progressive-heading-margins" as *;
3+
@use "util/gh-tables" as *;
4+
@use "util/minimal-toc" as *;
5+
//@use "util/docs-navigation" as docs-navigation;
6+
//@use "util/docs-headings-border" as *;
7+
@use "../components/util/location-selectors" as location-selectors;
8+
9+
:root {
10+
--qd-main-font: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
11+
--qd-code-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
12+
--qd-code-span-font-size: 0.9em;
13+
--qd-slides-code-block-font-size: 1.3em;
14+
--qd-line-height: 1.75;
15+
--qd-table-default-header-alignment: center;
16+
--qd-heading-label-suffix: "";
17+
--qd-mermaid-node-filter: drop-shadow(1px 2px var(--qd-mermaid-node-border-color));
18+
}
19+
20+
.quarkdown {
21+
@include progressive-heading-sizes($multiplier: 1.2);
22+
@include progressive-heading-margins($multiplier: 1.1, $bottomAddition: 0.4em);
23+
@include gh-tables;
24+
@include minimal-toc;
25+
//@include docs-headings-border;
26+
27+
h4, h5 {
28+
font-weight: 600;
29+
}
30+
31+
blockquote {
32+
border-left: 2px solid;
33+
padding-left: 1.5em;
34+
35+
&:not([class]) {
36+
background-color: transparent !important;
37+
}
38+
39+
&[data-labeled] > :first-child::before {
40+
display: block;
41+
}
42+
}
43+
44+
.box > header > h4 {
45+
gap: 0.4em;
46+
}
47+
48+
.codespan-content {
49+
padding: .12rem .35rem;
50+
background-color: color-mix(in srgb, currentColor 3%, transparent);
51+
}
52+
53+
#{location-selectors.$location-heading}::before {
54+
margin-right: .5em;
55+
}
56+
57+
nav, .nav {
58+
ul, ol {
59+
ul, ol {
60+
border-width: 1px;
61+
margin-left: .75em;
62+
padding-left: .9em;
63+
}
64+
}
65+
}
66+
}

quarkdown-html/src/main/resources/render/theme/layout/minimal.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
margin: 0 0.3em;
6363

6464
.color-preview {
65-
margin-left: 0.4em;
6665
border-radius: 3px;
6766
border: 0.1em solid color-mix(in srgb, currentColor 60%, transparent);
6867
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// GitHub style tables
2+
@mixin gh-tables {
3+
table:not(pre table) {
4+
border-spacing: 0;
5+
border-collapse: collapse;
6+
width: 100%;
7+
max-width: 100%;
8+
overflow: auto;
9+
10+
th, td {
11+
padding: 8px 14px;
12+
border: 1px solid color-mix(in srgb, var(--qd-main-color) 20%, transparent) !important;
13+
}
14+
15+
th {
16+
font-weight: 600;
17+
}
18+
19+
tr {
20+
background-color: var(--qd-background-color);
21+
22+
&:nth-child(2n) {
23+
background-color: color-mix(in srgb, var(--qd-main-color) 2%, transparent);
24+
}
25+
}
26+
27+
thead tr {
28+
background-color: var(--qd-background-color);
29+
}
30+
}
31+
}

quarkdown-html/src/main/resources/render/theme/layout/util/_progressive-heading-margins.scss

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,52 @@
33
@return calc($rem-size / var(--h-font-scale, 1.5));
44
}
55

6-
@mixin progressive-heading-margins($bottomAddition: 0) {
6+
@mixin progressive-heading-margins($multiplier: 1, $bottomAddition: 0) {
77
h1 {
8-
line-height: derive-size(3.25em);
9-
margin-bottom: derive-size(1.625em + $bottomAddition);
8+
line-height: derive-size(3.25em * $multiplier);
9+
margin-bottom: derive-size(1.625em * $multiplier + $bottomAddition);
1010
}
1111

1212
h2 {
13-
line-height: derive-size(2em);
14-
margin-top: derive-size(3em);
13+
line-height: derive-size(2em * $multiplier);
14+
margin-top: derive-size(3em * $multiplier);
1515
}
1616

1717
h3 {
18-
margin-top: derive-size(2.5em);
18+
margin-top: derive-size(2.5em * $multiplier);
1919
}
2020

2121
h4 {
22-
margin-top: derive-size(2em);
22+
margin-top: derive-size(2em * $multiplier);
2323
}
2424

2525
h5 {
26-
margin-top: derive-size(1.8em);
26+
margin-top: derive-size(1.8em * $multiplier);
2727
}
2828

2929
h6 {
30-
margin-top: derive-size(2.5rem);
30+
margin-top: derive-size(2.5rem * $multiplier);
3131
}
3232

3333
h3, h4, h5, h6 {
34-
line-height: derive-size(1.625em);
34+
line-height: derive-size(1.625em * $multiplier);
3535
}
3636

3737
h1 + h2 {
38-
margin-top: derive-size(1.625em);
38+
margin-top: derive-size(1.625em * $multiplier);
3939
}
4040

4141
h2 + h3,
4242
h3 + h4,
4343
h4 + h5 {
44-
margin-top: derive-size(0.8em);
44+
margin-top: derive-size(0.8em * $multiplier);
4545
}
4646

4747
h5 + h6 {
48-
margin-top: derive-size(0.8rem);
48+
margin-top: derive-size(0.8rem * $multiplier);
4949
}
5050

5151
h2, h3, h4, h5, h6 {
52-
margin-bottom: derive-size(0.8em + $bottomAddition);
52+
margin-bottom: derive-size(0.8em * $multiplier + $bottomAddition);
5353
}
5454
}

0 commit comments

Comments
 (0)