-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathobsidian.css
439 lines (378 loc) · 12.7 KB
/
obsidian.css
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
/*====================_Ars Magna Lucis et Umbrae_===================*/
/* 2020-06-28 Theme by @mediapathic, but honeslty mostly composed of bits from @death_au and @cotemaxime, */
/* and a few other fragments here and there. */
/* font */
body {
/* font stacks taken directly from Notion */
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
--font-monospace: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
-webkit-font-smoothing: auto;
}
body.theme-light, body.theme-dark {
/* change these numbers for an entirely new look */
--hue: 203;
--sat: 8%;
--interactive-accent-rgb: 200, 120, 0;
--code: #EB5757;
}
/* Dark theme */
.theme-dark {
--L0: 0%;
--L1: 23%;
--L2: 20%;
--L3: 25%;
--pulp-color: rgba(255, 180, 0, 0.75);
--text-rgb: 240, 240, 240;
--text-highlight-bg: rgb(89, 86, 59);
--text-selection: var(--pulp-color);
--interactive-normal: #2a2a2a;
--interactive-hover: #303030;
--GText: hsl(var(--hue), var(--sat), 90%);
--GFill: hsl(var(--hue), var(--sat), 50%);
--GLine: hsl(var(--hue), var(--sat), var(--L0));
}
/* Light theme */
.theme-light {
--L0: 0%;
--L1: 100%;
--L2: 96%;
--L3: 90%;
--text-rgb: 55, 53, 47;
--text-highlight-bg: rgb(251, 243, 219);
--text-selection: rgba(255, 180, 0, 0.15);
--interactive-normal: #f2f3f5;
--interactive-hover: #e9e9e9;
--GText: hsl(var(--hue), var(--sat), 1i0%);
--GFill: hsl(var(--hue), var(--sat), 50%);
--GLine: hsl(var(--hue), var(--sat), var(--L3));
}
body.theme-light, body.theme-dark {
--background-primary: hsl(var(--hue), var(--sat), var(--L1));
--background-primary-alt: hsl(var(--hue), var(--sat), var(--L3));
--background-secondary: hsl(var(--hue), var(--sat), var(--L2));
--background-secondary-alt: hsl(var(--hue), var(--sat), var(--L3));
--background-accent: hsl(var(--hue), var(--sat), var(--L0));
--background-modifier-border: rgba(var(--text-rgb), 0.14);
--text-accent: rgba(var(--text-rgb), 0.45);
--text-accent-hover: rgba(var(--text-rgb), 0.45);
--text-normal: rgba(var(--text-rgb), 0.9);
/* --text-muted: rgba(var(--text-rgb), 0.45); /* subtle mode */
--text-muted: var(--pulp-color); /* Full Pulp */
--text-faint: rgba(var(--text-rgb), 0.25);
--text-on-accent: rgba(var(--text-rgb), 0.9);
--interactive-accent: rgb(var(--interactive-accent-rgb));
--interactive-accent-hover: rgba(var(--interactive-accent-rgb), 0.8);
}
body.theme-light {
--background-primary-alt: hsl(var(--hue), var(--sat), var(--L2));
}
/* Fix font weights */
.view-header-title {
font-weight: 700;
}
h1, h2, h3, h4, h5, h6, strong, .cm-s-obsidian .cm-header {
font-weight: 600;
}
/* headings */
.markdown-preview-view h1{
font-size: 30px;
margin-top: 32px;
margin-bottom: 4px;
}
.markdown-preview-view h2{
font-size: 24px;
margin-top: 23px;
margin-bottom: 1px;
}
.markdown-preview-view h3,
.markdown-preview-view h4,
.markdown-preview-view h5,
.markdown-preview-view h6{
font-size: 20px;
margin-top: 16px;
margin-bottom: 0px;
}
.cm-s-obsidian .cm-header-1 { font-size: 30px; }
.cm-s-obsidian .cm-header-2 { font-size: 24px; }
.cm-s-obsidian .cm-header-3,
.cm-s-obsidian .cm-header-4,
.cm-s-obsidian .cm-header-5,
.cm-s-obsidian .cm-header-6{ font-size: 20px; }
.cm-s-obsidian .cm-header-6 { color: var(--text-muted); }
/* links */
.external-link {
background-image: none; /* no external link indicator */
padding:0;
color: var(--text-normal);
}
.markdown-preview-view .internal-link, .popover.hover-popover .markdown-embed .internal-link {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-weight: 500;
line-height: 1.3;
border-bottom: 1px solid var(--background-modifier-border);
color: var(--text-normal);
text-decoration: none;
}
/* Nifty SVG arrow before internal links */
/* Also applies to embeds */
.internal-link::before, .markdown-embed-link::before {
content: " ";
background-color: var(--text-normal);
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpolygon points='5.4 26 24 7.4 24 20 26 20 26 4 10 4 10 6 22.6 6 4 24.6'%3E%3C/polygon%3E%3C/svg%3E");
display: inline-block;
width: 1em;
height: 1em;
margin-right: 4px;
}
/* embeds (mimics embedded tables from Notion) */
.markdown-embed-title {
font-size: 1.25em;
line-height: 1.5;
font-weight: 600;
text-align: left;
}
.markdown-preview-view .markdown-embed {
border:none;
margin:0;
border-bottom: 1px solid var(--background-modifier-border);
border-radius: 0;
}
.markdown-embed-link {
color: var(--text-normal);
right:unset;
left: 0;
height: 30px;
width: calc(100% - 20px);
margin-left: 4px;
border-bottom: 1px solid var(--background-modifier-border);
}
.markdown-embed-link::before {
font-size: 0.8em;
}
.markdown-embed-link svg {
display: none; /* hide the svg link icon, gets replaced with a nifty arrow */
}
/* table headers and first column styling */
.markdown-preview-view th:first-child, .markdown-preview-view td:first-child {
border-left: none;
}
.markdown-preview-view th:last-child, .markdown-preview-view td:last-child {
border-right: none;
}
.markdown-preview-view th {
text-align: left;
font-weight: normal;
color: var(--text-muted);
}
.markdown-preview-view td:first-child {
font-weight: 600;
}
.markdown-preview-view hr {
height: 1px;
opacity: 0.5;
}
/* popover fixes */
.popover.hover-popover .markdown-embed-link {
border-bottom: none;
}
/* task lists! */
.markdown-preview-view .task-list-item-checkbox {
-webkit-appearance: none;
box-sizing: border-box;
border: 1px solid var(--text-normal);
border-radius: 2px;
position: relative;
width: 1em;
height: 1em;
margin: 0;
margin-right: 4px;
margin-bottom: 2px;
transition: background-color 0.3s ease;
cursor: pointer;
}
.markdown-preview-view .task-list-item-checkbox:checked {
border:none;
background-color: var(--interactive-accent);
}
.markdown-preview-view .task-list-item-checkbox:hover {
background-color: var(--background-primary-alt);
}
/* the SVG check mark */
.markdown-preview-view .task-list-item-checkbox:checked::before {
content: ' ';
position: absolute;
background-color: white;
left:1px;
top:1px;
right:1px;
bottom:1px;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpolygon points='5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039'%3E%3C/polygon%3E%3C/svg%3E");
}
/* this should strike through checked off items, once CSS supports :has
(it's draft right now) */
.markdown-preview-view .task-list-item:has(.task-list-item-checkbox:checked) {
text-decoration: line-through;
color: var(--text-muted);
}
.markdown-preview-view .task-list-item {
margin-left: -40px;
}
/* Blockquotes */
.markdown-preview-view blockquote, .cm-s-obsidian pre.HyperMD-quote-1 {
border:none;
border-left: 3px solid currentcolor;
}
/* for some reason messing with the padding and size like this caused weirdness
with the editor mode cursor position. So just preview for now */
.markdown-preview-view blockquote {
padding: 0 0.9em;
font-size: 1.2em;
margin: 3px 2px;
}
/* code */
.markdown-preview-view code, .cm-s-obsidian span.cm-inline-code, .cm-s-obsidian pre.HyperMD-codeblock {
color: var(--code);
font-family: var(--font-monospace);
}
/* escape character */
.cm-s-obsidian span.cm-hmd-escape-backslash {
color: var(--text-faint);
}
/* highlight */
.markdown-preview-view mark {
color: var(--text-normal);
}
/* bulleted lists */
ul {
list-style-type: disc;
padding-inline-start: 40px;
}
ul ul {
padding-inline-start: 60px;
}
/* graph view colours */
.graph-view.color-fill {
color: var(--GFill);
}
.graph-view.color-line {
color: var(--GLine);
}
.graph-view.color-text {
color: var(--GText);
}
.graph-view.color-fill-highlight {
color: var(--interactive-accent);
}
.graph-view.color-line-highlight {
color: var(--interactive-accent);
}
/* misc fixes */
.cm-s-obsidian span.cm-quote {
color: var(--text-normal);
}
/* Andy Matuschak mode! V2! for 0.7.0! (so... 2.7?) I think by @cotemaxime and @death_au, I certainly can't claim any of it */
/* everything under .mod-root now. Don't want Andy messing with sidebars */
/* also, Andy only makes sense for vertical splits, at the root level, right? */
.mod-root.workspace-split.mod-vertical {
overflow-x:auto;
--header-width: 36px; /* <- 36px is the header height in the default theme */
}
.mod-root.workspace-split.mod-vertical > div {
min-width: calc(700px + var(--header-width)); /* <-- 700px is the default theme's "readable" max-width */
box-shadow: 0px 0px 20px 20px rgba(0,0,0,0.25);
position:sticky;
left:0;
}
/* shift sticky position, so titles will stack up to the left */
/* This will currently stack to a maximum of 10 before resetting */
.mod-root.workspace-split.mod-vertical > div:nth-child(10n-8) { left: calc(var(--header-width) * 0); }
.mod-root.workspace-split.mod-vertical > div:nth-child(10n-7) { left: calc(var(--header-width) * 1); }
.mod-root.workspace-split.mod-vertical > div:nth-child(10n-6) { left: calc(var(--header-width) * 2); }
.mod-root.workspace-split.mod-vertical > div:nth-child(10n-5) { left: calc(var(--header-width) * 3); }
.mod-root.workspace-split.mod-vertical > div:nth-child(10n-4) { left: calc(var(--header-width) * 4); }
.mod-root.workspace-split.mod-vertical > div:nth-child(10n-3) { left: calc(var(--header-width) * 5); }
.mod-root.workspace-split.mod-vertical > div:nth-child(10n-2) { left: calc(var(--header-width) * 6); }
.mod-root.workspace-split.mod-vertical > div:nth-child(10n-1) { left: calc(var(--header-width) * 7); }
.mod-root.workspace-split.mod-vertical > div:nth-child(10n+0) { left: calc(var(--header-width) * 8); }
.mod-root.workspace-split.mod-vertical > div:nth-child(10n+1) { left: calc(var(--header-width) * 9); }
/* now it's time for the fancy vertical titles */
/* first we'll add a bit of gap for the title to sit inside of */
.workspace-leaf-content {
padding-left: var(--header-width);
position: relative;
}
/* this is where the magic happens */
.view-header {
writing-mode: vertical-lr;
border-right: 1px solid var(--background-secondary-alt);
border-left: 2px solid var(--background-secondary-alt);
border-top: none;
border-bottom: none;
height: auto;
width: var(--header-width);
position: absolute;
left:0;
top:0;
bottom:0;
}
/* active titles have different border colours */
.workspace-leaf.mod-active .view-header {
border-right: 2px solid var(--interactive-accent);
border-bottom: none;
}
/* unset the title container height and swap padding */
.view-header-title-container {
height: unset;
padding-left: unset;
padding-top: 5px;
}
/* fix the long-title-obscuring shadows */
.view-header-title-container:after {
width: 100%;
height: 30px;
top:unset;
bottom: 0;
background: linear-gradient(to bottom, transparent, var(--background-secondary));
}
.workspace-leaf.mod-active .view-header-title-container:after {
background: linear-gradient(to bottom, transparent, var(--background-primary-alt));
}
/* swap the padding/margin around for the header and actions icons */
.view-header-icon, .view-actions {
padding: 10px 5px;
}
.view-action {
margin: 8px 0;
}
/* get rid of the gap left by the now-missing horizontal title */
.view-content {
height: 100%;
}
/* make the fake drop target overlay have a background so you can see it. */
/* TODO: figure out how the fake target overlay works so we can put the title back, too */
.workspace-fake-target-overlay {
background-color: var(--background-primary);
}
/* Auto-collapsing sidebars courtesy @kmaasrud */
.app-container.is-left-sidedock-collapsed .side-dock.mod-left:not(:hover), .app-container.is-right-sidedock-collapsed .side-dock.mod-right:not(:hover) {
width: 0px !important;
}
/* Naked Embeds */
.markdown-embed-title { display:none; }
.markdown-preview-view .markdown-embed { border:none; padding:0; margin:0; }
.markdown-preview-view .markdown-embed-content { max-height: unset;}
.markdown-preview-view .markdown-embed-content>:first-child { margin-top: 0; }
.markdown-preview-view .markdown-embed-content>:last-child { margin-bottom: 0; }
/* level indicators for bullet list */
.cm-hmd-list-indent .cm-tab, ul ul { position: relative; }
.cm-hmd-list-indent .cm-tab::before, ul ul::before {
content:'';
border-left: 1px solid rgba(0, 122, 255, 0.25);
position: absolute;
}
.cm-hmd-list-indent .cm-tab::before { left: 0; top: -5px; bottom: -4px;
}
ul ul::before { left: -11px; top: 0; bottom: 0;
}