-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyles.css
More file actions
463 lines (394 loc) · 12.1 KB
/
Copy pathstyles.css
File metadata and controls
463 lines (394 loc) · 12.1 KB
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
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
/* Code Linker 1.4.0 — assembled from the shared styles and src/styles.css by "npm run build". Do not edit directly. */
/* Styles every linker plugin uses. The token below stands for the plugin class prefix;
build.mjs substitutes it when it assembles styles.css. See CONTRIBUTING.md. */
.code-linker-preview-table {
width: 100%;
border-collapse: collapse;
font-size: var(--font-ui-small);
}
.code-linker-preview-buttons {
display: flex;
gap: 8px;
justify-content: flex-end;
margin-top: 16px;
}
.code-linker-folder-row .setting-item-name {
font-family: var(--font-monospace);
font-size: var(--font-ui-smaller);
overflow-wrap: anywhere;
}
.code-linker-folder-add {
display: flex;
gap: 8px;
margin: 6px 0 18px 1.5em;
}
.code-linker-folder-input {
flex: 1 1 auto;
min-width: 0;
}
.code-linker-folder-addbtn {
display: flex;
flex: 0 0 auto;
align-items: center;
justify-content: center;
cursor: pointer;
}
.code-linker-folder-addbtn svg {
width: 16px;
height: 16px;
}
/* Priority order among the installed linker plugins. Our own row is the movable one, so
it is the one that reads as active; the others are context. */
.code-linker-precedence-list {
margin: 0 0 18px 1.5em;
}
.code-linker-precedence-list .setting-item {
border-top: none;
/* Padding matches the folder-list rows, so this nested list lines up with the other one in the same pane: text off the left edge, arrows level with the remove buttons. */ padding: 4px 6px 4px 0.75em;
}
.code-linker-precedence-list .setting-item-name {
color: var(--text-muted);
}
.code-linker-precedence-self .setting-item-name {
color: var(--text-normal);
font-weight: var(--font-semibold);
}
/* Styles both sigil linkers use. The plugin class prefix is substituted by build.mjs. */
.code-linker-suggestion {
display: flex;
gap: 0.5em;
align-items: baseline;
}
.code-linker-name {
font-weight: var(--font-semibold);
}
.code-linker-kind {
color: var(--text-muted);
font-size: var(--font-ui-smaller);
}
.code-linker-path {
margin-left: auto;
color: var(--text-faint);
font-size: var(--font-ui-smaller);
}
.code-linker-input {
width: 100%;
}
/* Muted helper / status line under a control or section — one class for every such
note in the pane. .is-error tints it for a missing folder or other problem. */
.code-linker-note {
color: var(--text-muted);
font-size: var(--font-ui-small);
margin: 4px 0 14px;
}
.code-linker-note.is-error {
color: var(--text-error);
}
/* User editor preset rows: name + template + remove on one line, wrapping to
two lines on a narrow pane so nothing collides. The full control area is used
(the empty name label is hidden) and the theme styles the row like any other. */
.code-linker-editor-row .setting-item-info {
display: none;
}
.code-linker-editor-row .setting-item-control {
width: 100%;
flex-wrap: wrap;
justify-content: flex-start;
gap: 8px;
}
.code-linker-editor-name {
flex: 1 1 140px;
min-width: 0;
}
.code-linker-editor-tpl {
flex: 3 1 240px;
min-width: 0;
}
.code-linker-hover {
position: fixed;
z-index: var(--layer-popover);
max-width: min(720px, 90vw);
box-shadow: var(--shadow-s);
user-select: text;
-webkit-user-select: text;
}
.code-linker-hover.code-linker-hidden {
display: none;
}
.code-linker-embed {
margin: var(--p-spacing, 1em) 0;
}
.code-linker-embed-error,
.code-linker-embed-note {
padding: 6px 10px;
color: var(--text-muted);
font-size: var(--font-ui-smaller);
}
.code-linker-embed-error {
color: var(--text-error);
}
/* Drifted line (stale) and renamed/removed symbol (broken), in both render modes.
A border-bottom rather than text-decoration: wavy/offset underlines render
inconsistently across platforms, so a plain border is the reliable choice. */
.code-linker-stale,
.code-linker-broken {
border-bottom-width: 1px;
border-bottom-style: var(--code-linker-mark-underline-style, dotted);
}
.code-linker-stale {
border-bottom-color: var(--code-linker-stale-color, var(--text-warning));
}
.code-linker-broken {
border-bottom-color: var(--code-linker-broken-color, var(--text-error));
}
/* Nested sub-rows — searchable kinds under a language, and chosen folders under a
folder list — share one indent and compact height so the pane reads as one list
style. The kind rule is unqualified so it also indents the plain rebuild hint. */
.code-linker-kind-row,
.code-linker-folder-row {
margin-left: 1.5em;
padding-left: 0.75em;
border-left: 2px solid var(--background-modifier-border);
}
.code-linker-kind-row.setting-item,
.code-linker-folder-row.setting-item {
border-top: 0;
padding: 4px 6px 4px 0.75em;
}
.code-linker-kind-row .setting-item-name {
font-size: 0.9em;
opacity: 0.85;
}
/* Folder-set editor: a full-width input with autocomplete and an add button below
the chosen-folder rows. */
.code-linker-folder-rows:not(:empty) {
margin: 6px 0;
}
.code-linker-preview-file {
font-weight: var(--font-semibold);
margin: 12px 0 4px;
overflow-wrap: anywhere;
}
.code-linker-preview-table td {
border-bottom: 1px solid var(--background-modifier-border);
padding: 3px 8px;
text-align: left;
vertical-align: top;
}
.code-linker-preview-pick {
width: 1%;
padding-right: 0;
vertical-align: middle;
}
.code-linker-preview-move {
font-family: var(--font-monospace);
white-space: nowrap;
width: 1%;
color: var(--text-muted);
}
/* A guessed move (file matched by symbol or basename), not a plain line drift — tinted so
it stands out for a closer look before applying. */
.code-linker-preview-moved .code-linker-preview-move {
color: var(--code-linker-stale-color, var(--text-warning));
white-space: normal;
}
.code-linker-preview-more,
.code-linker-preview-empty {
color: var(--text-muted);
padding: 8px 0;
}
.code-linker-preview-attention {
color: var(--code-linker-broken-color, var(--text-error));
}
.code-linker-preview-broken {
font-size: var(--font-ui-small);
color: var(--code-linker-broken-color, var(--text-error));
padding: 2px 8px;
overflow-wrap: anywhere;
}
/* @settings
name: Code Linker
id: code-linker
settings:
-
id: code-linker-highlight-color
title: Preview line highlight
description: Background of the target line in hover previews and embeds. Default follows the theme's selection colour.
type: variable-themed-color
format: hex
opacity: true
default-light: '#c8dcff80'
default-dark: '#3a4a6b80'
-
id: code-linker-stale-color
title: Stale-link underline colour
description: Pinned links and embeds whose code has moved — the update commands can fix them. Default follows the theme's warning colour.
type: variable-themed-color
format: hex
opacity: false
default-light: '#c1810b'
default-dark: '#e0a526'
-
id: code-linker-broken-color
title: Broken-link underline colour
description: Pinned links and embeds whose pin no longer matches anything — renamed, removed, or the line rewritten. Default follows the theme's error colour.
type: variable-themed-color
format: hex
opacity: false
default-light: '#c4302b'
default-dark: '#e35555'
-
id: code-linker-mark-underline-style
title: Stale / broken underline style
type: variable-select
default: dotted
options:
- dotted
- dashed
- solid
- double
*/
/* Snippet chrome shared by the hover popover and the inline embed. Both containers carry
.code-linker-code (see the token colours below). The popover is a fixed overlay; the
embed flows inline — otherwise the parts match. --cl-lh is fixed so the highlight band
can be placed by row index, and body/pre carry no vertical padding so row 0 sits at
top 0. user-select on the popover lets the snippet be copied. */
.code-linker-hover,
.code-linker-embed {
overflow: hidden;
background: var(--background-primary);
border: 1px solid var(--background-modifier-border);
border-radius: var(--radius-m);
}
.code-linker-hover-header,
.code-linker-embed-header {
padding: 4px 10px;
border-bottom: 1px solid var(--background-modifier-border);
color: var(--text-muted);
font-size: var(--font-ui-smaller);
font-family: var(--font-monospace);
white-space: nowrap;
}
.code-linker-embed-header {
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
}
.code-linker-hover-body,
.code-linker-embed-body {
position: relative;
overflow: auto;
padding: 0;
font-family: var(--font-monospace);
font-size: var(--font-ui-smaller);
--cl-lh: 1.5em;
}
.code-linker-hover-body {
max-height: 40vh;
}
.code-linker-embed-body {
max-height: 60vh;
}
/* The .code-linker-code prefix raises specificity above the theme's / editor's own
`pre` rules — in Live Preview an embed is rendered where those would otherwise add a
top margin, border or a different line-height and push the code off the fixed band. */
.code-linker-code .code-linker-hover-body pre,
.code-linker-code .code-linker-embed-body pre {
position: relative;
z-index: 1;
margin: 0;
padding: 0 10px;
border: 0;
background: transparent;
font-size: inherit;
/* keep it equal to the band's, so their em line heights match */ line-height: var(--cl-lh);
white-space: pre;
}
.code-linker-code .code-linker-hover-body code,
.code-linker-code .code-linker-embed-body code {
margin: 0;
padding: 0;
font-family: inherit;
font-size: inherit;
background: transparent;
color: var(--code-normal, var(--text-normal));
}
.code-linker-hover-band,
.code-linker-embed-band {
position: absolute;
left: 0;
right: 0;
top: 0;
/* actual row offset (row-index * line-height) is set inline */ height: var(--cl-lh);
background: var(--code-linker-highlight-color, var(--text-selection));
z-index: 0;
pointer-events: none;
}
/* Prism token colours, shared by the hover popover and the inline embed (both carry
.code-linker-code). The popover sits outside Obsidian's markdown containers where the
theme's token CSS doesn't reach, so map the tokens to Obsidian's --code-* variables. */
.code-linker-code .token.comment,
.code-linker-code .token.prolog,
.code-linker-code .token.doctype,
.code-linker-code .token.cdata {
color: var(--code-comment, var(--text-faint));
}
.code-linker-code .token.punctuation {
color: var(--code-punctuation, var(--text-muted));
}
.code-linker-code .token.property,
.code-linker-code .token.tag,
.code-linker-code .token.constant,
.code-linker-code .token.symbol,
.code-linker-code .token.deleted {
color: var(--code-tag, var(--text-normal));
}
.code-linker-code .token.boolean,
.code-linker-code .token.number {
color: var(--code-value, var(--text-normal));
}
.code-linker-code .token.selector,
.code-linker-code .token.attr-name,
.code-linker-code .token.string,
.code-linker-code .token.char,
.code-linker-code .token.builtin,
.code-linker-code .token.inserted {
color: var(--code-string, var(--text-normal));
}
.code-linker-code .token.operator,
.code-linker-code .token.entity,
.code-linker-code .token.url {
color: var(--code-operator, var(--text-normal));
}
.code-linker-code .token.atrule,
.code-linker-code .token.attr-value,
.code-linker-code .token.keyword {
color: var(--code-keyword, var(--text-accent));
}
.code-linker-code .token.function,
.code-linker-code .token.class-name {
color: var(--code-function, var(--text-normal));
}
.code-linker-code .token.regex,
.code-linker-code .token.important,
.code-linker-code .token.variable {
color: var(--code-property, var(--text-normal));
}
/* A pinned embed whose code moved is showing the wrong lines, so it says so: the header
is tinted and a note under the snippet explains. Same colours as the link marks, but
their own classes — an embed is a block, and the links' underline doesn't suit it. */
.code-linker-embed-stale {
color: var(--code-linker-stale-color, var(--text-warning));
}
.code-linker-embed-broken {
color: var(--code-linker-broken-color, var(--text-error));
}
/* Update preview: each note is a checkable group, its link changes a compact table, and
the code that's gone is listed apart in the warning colour — so an update is something
you look over and confirm, not a blind sweep. */
.code-linker-preview-check {
display: flex;
align-items: center;
gap: 6px;
}
/* Code Linker 1.4.0 */