blob: 2623f50cba31a0d82e89da0a5a73a2f13933ef98 (
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
|
code {
-webkit-text-size-adjust: 100%;
border-radius: 5px;
background-color: var(--bg-1);
padding-inline: 0.2em;
padding-block: 0.1em;
font-size: 0.9rem;
font-family: var(--code-font);
mark {
display: block;
filter: brightness(110%);
background-color: var(--codeblock-highlight);
color: inherit;
}
table {
margin: 0rem;
border-collapse: collapse;
border-spacing: 0rem;
width: 100%;
text-align: start;
td,
th,
tr {
border: none;
padding: 0rem;
}
// Line number col.
tbody td:first-child {
opacity: 50%;
padding-inline-end: 0.8rem;
width: 1px; // Without this, iOS Safari centres short lines.
user-select: none;
text-align: end;
}
tbody tr:nth-child(even) {
background-color: inherit;
}
}
}
a:hover code {
background-color: inherit;
padding-block: 0;
}
pre {
display: block;
position: relative;
border-radius: 5px;
padding-inline: 1rem;
padding-block-start: 2.4rem;
padding-block-end: 1rem;
overflow: hidden;
overflow-x: auto;
line-height: 1.4;
code,
code td {
font-size: 0.8rem; // Fits ~77 characters.
}
// Supports both native Zola way of adding src, and old shortcode-based logic.
// See: https://github.com/welpo/tabi/pull/489
&::after,
code .source-path {
display: block;
position: absolute;
top: 0;
inset-inline-end: 1.3rem;
padding-top: 0.3rem;
padding-inline-end: 1.3rem;
max-width: calc(100% - 14em);
height: 0.9rem;
overflow: hidden;
content: attr(data-name);
color: var(--hover-color);
font-size: 0.65rem;
text-align: end;
text-overflow: ellipsis;
white-space: nowrap;
}
code {
display: block;
border: 0rem;
border-radius: 5px;
background-color: transparent;
padding: 0rem;
overflow-x: auto;
color: inherit;
white-space: pre;
&::before {
display: block;
position: absolute;
top: 0;
inset-inline-start: 0;
background-color: var(--primary-color);
padding: 0.3rem;
padding-inline-start: 1rem;
width: calc(100% - 1.3rem);
height: 0.9rem;
content: attr(data-lang);
color: var(--hover-color);
font-size: 0.65rem;
text-align: start;
text-transform: uppercase;
}
}
}
// Default to LTR codeblocks.
code, pre {
direction: ltr;
}
// Allows RTL codeblocks if `force_codeblock_ltr` is set to false.
html[data-code-direction="inherit"] {
code, pre {
direction: inherit;
}
}
.copy-code {
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960' %3E%3Cpath d='M217.002-67.694q-37.732 0-64.02-26.288-26.287-26.287-26.287-64.019V-707.69h77.999v549.689q0 4.615 3.846 8.462 3.846 3.846 8.462 3.846h451.689v77.999H217.002Zm175.999-175.999q-37.733 0-64.02-26.287T302.694-334v-463.383q0-37.732 26.287-64.02 26.287-26.287 64.02-26.287h365.383q37.732 0 64.019 26.287 26.288 26.288 26.288 64.02V-334q0 37.733-26.288 64.02-26.287 26.287-64.019 26.287H393.001Zm0-77.998h365.383q4.615 0 8.462-3.847 3.846-3.846 3.846-8.462v-463.383q0-4.616-3.846-8.462-3.847-3.846-8.462-3.846H393.001q-4.616 0-8.462 3.846-3.847 3.846-3.847 8.462V-334q0 4.616 3.847 8.462 3.846 3.847 8.462 3.847Zm-12.309 0v-488V-321.691Z'/%3E%3C/svg%3E");
position: absolute;
top: 0.3rem;
align-self: center;
z-index: 1;
cursor: pointer;
inset-inline-end: 0.7rem;
background: var(--hover-color);
background-size: contain;
width: 0.9rem;
height: 0.9rem;
color: white;
}
.copy-code.checked {
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960' %3E%3Cpath d='M395-253 194-455l83-83 118 117 288-287 83 84-371 371Z'/%3E%3C/svg%3E");
width: 1rem;
height: 1rem;
}
.copy-code.error {
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960' %3E%3Cpath d='M479.386-248Q509-248 529-267.386q20-19.386 20-49T529.614-366.5q-19.386-20.5-49-20.5T431-366.886q-20 20.114-20 49.728t19.386 49.386q19.386 19.772 49 19.772ZM416-431h128v-265H416v265Zm64.276 381q-88.916 0-167.743-33.104-78.828-33.103-137.577-91.852-58.749-58.749-91.852-137.535Q50-391.277 50-480.458q0-89.438 33.162-167.491 33.163-78.053 92.175-136.942 59.011-58.889 137.533-91.999Q391.393-910 480.458-910q89.428 0 167.518 33.093T784.94-784.94q58.874 58.874 91.967 137.215Q910-569.385 910-480.192q0 89.192-33.11 167.518-33.11 78.326-91.999 137.337-58.889 59.012-137.167 92.174Q569.447-50 480.276-50Z'/%3E%3C/svg%3E");
}
|