-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyles.css
More file actions
489 lines (437 loc) · 13.9 KB
/
Copy pathstyles.css
File metadata and controls
489 lines (437 loc) · 13.9 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
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
/*
* Lookout — "drafting / survey instrument" UI.
*
* Surfaces and text follow Obsidian's theme variables so the controls read as
* native in both light and dark themes. The one deliberate signature is the
* survey-cyan accent, used only for focus, the active gauge tick, and hover
* emphasis — everything else stays quiet.
*/
.lookout-viewport,
.lookout-fs {
--lookout-accent: #0e9cc4;
--lookout-accent-soft: color-mix(in srgb, var(--lookout-accent) 16%, transparent);
--lookout-accent-ring: color-mix(in srgb, var(--lookout-accent) 45%, transparent);
}
/* The host (Obsidian's .mermaid wrapper) should no longer clamp or scroll. */
.lookout-host {
width: 100%;
max-width: 100%;
text-align: left;
}
/*
* Obsidian's `.mermaid` wrapper sets `overflow` to clamp/scroll the diagram.
* The plugin stamps `.lookout-host` onto that `.mermaid` element (via
* `closest('.mermaid')`), so qualifying with `.mermaid` here adds our own class
* on top of Obsidian's `.mermaid` — enough specificity to win without `!important`.
*/
.mermaid.lookout-host {
overflow: visible;
}
/* ---------- viewport (the windowed frame over the diagram) ---------- */
.lookout-viewport {
position: relative;
width: 100%;
overflow: hidden;
border: 1px solid var(--background-modifier-border);
border-radius: 6px;
background-color: var(--background-primary);
/* faint drafting grid — present but barely there */
background-image:
linear-gradient(to right, color-mix(in srgb, var(--text-muted) 7%, transparent) 1px, transparent 1px),
linear-gradient(to bottom, color-mix(in srgb, var(--text-muted) 7%, transparent) 1px, transparent 1px);
background-size: 24px 24px;
cursor: grab;
outline: none;
}
.lookout-viewport.is-dragging {
cursor: grabbing;
}
.lookout-viewport:focus-visible {
border-color: var(--lookout-accent);
box-shadow: 0 0 0 2px var(--lookout-accent-ring);
}
.lookout-stage {
position: absolute;
top: 0;
left: 0;
transform-origin: 0 0;
will-change: transform;
}
.lookout-stage.is-animating {
transition: transform 0.18s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.lookout-stage svg {
display: block;
}
/* ---------- instrument toolbar ---------- */
.lookout-toolbar {
position: absolute;
top: 10px;
right: 10px;
display: inline-flex;
align-items: center;
gap: 1px;
padding: 3px;
border-radius: 7px;
background-color: color-mix(in srgb, var(--background-primary) 88%, transparent);
backdrop-filter: saturate(1.1) blur(6px);
border: 1px solid var(--background-modifier-border);
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
opacity: 0.55;
transition: opacity 0.15s ease;
z-index: 2;
}
.lookout-host:hover .lookout-toolbar,
.lookout-viewport:hover .lookout-toolbar,
.lookout-toolbar:focus-within {
opacity: 1;
}
.lookout-divider {
width: 1px;
align-self: stretch;
margin: 4px 3px;
background-color: var(--background-modifier-border);
}
.lookout-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
padding: 0;
border: none;
border-radius: 5px;
background: transparent;
color: var(--text-muted);
cursor: pointer;
box-shadow: none;
transition: background-color 0.12s ease, color 0.12s ease;
}
.lookout-btn:hover {
background-color: var(--background-modifier-hover);
color: var(--text-normal);
}
.lookout-btn:active {
background-color: var(--background-modifier-active-hover, var(--background-modifier-hover));
}
.lookout-btn:focus-visible {
outline: none;
box-shadow: inset 0 0 0 2px var(--lookout-accent-ring);
color: var(--lookout-accent);
}
.lookout-btn:disabled {
opacity: 0.32;
cursor: default;
background: transparent;
color: var(--text-muted);
}
.lookout-btn--close:hover {
background-color: color-mix(in srgb, var(--text-error) 16%, transparent);
color: var(--text-error);
}
.lookout-ico {
display: block;
}
/* ---------- signature: the survey gauge ---------- */
.lookout-gauge {
display: inline-flex;
flex-direction: column;
align-items: stretch;
justify-content: center;
gap: 3px;
min-width: 56px;
height: 28px;
padding: 0 8px;
border: none;
border-radius: 5px;
background: transparent;
color: var(--text-normal);
cursor: pointer;
box-shadow: none;
}
.lookout-gauge:hover {
background-color: var(--background-modifier-hover);
}
.lookout-gauge:focus-visible {
outline: none;
box-shadow: inset 0 0 0 2px var(--lookout-accent-ring);
}
.lookout-gauge-num {
font-family: var(--font-monospace);
font-size: 11px;
font-weight: 600;
line-height: 1;
letter-spacing: 0.02em;
text-align: center;
font-variant-numeric: tabular-nums;
color: var(--text-normal);
}
.lookout-gauge-track {
display: block;
position: relative;
height: 2px;
border-radius: 1px;
background-color: var(--background-modifier-border);
overflow: hidden;
}
.lookout-gauge-fill {
display: block;
position: absolute;
inset: 0 auto 0 0;
width: 50%;
background-color: var(--lookout-accent);
transition: width 0.12s ease;
}
/* ---------- full-screen view ---------- */
.lookout-fs {
position: fixed;
inset: 0;
z-index: 9999;
display: flex;
background-color: var(--background-primary);
/* a touch more pronounced drafting grid in the focal full-screen canvas */
background-image:
radial-gradient(circle, color-mix(in srgb, var(--lookout-accent) 12%, transparent) 1px, transparent 1.4px);
background-size: 26px 26px;
animation: lookout-fade 0.16s ease;
}
@keyframes lookout-fade {
from { opacity: 0; }
to { opacity: 1; }
}
.lookout-viewport--fs {
flex: 1;
border: none;
border-radius: 0;
background-color: transparent;
background-image: none;
}
/* In full screen the controls become a console docked at the bottom center. */
.lookout-toolbar--fs {
top: auto;
right: auto;
bottom: 22px;
left: 50%;
transform: translateX(-50%);
opacity: 1;
padding: 4px;
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
}
/* ---------- tables (full-screen only, no zoom) ---------- */
/*
* The host is a 1x1 grid; the scroller and the button share that single cell
* (they overlay). `minmax(0, 1fr)` + the scroller's `min-width: 0` cap the host
* at the available column width so it never balloons to the table's intrinsic
* width — even when an ancestor is a shrink-to-fit / horizontally-scrolling
* block (Obsidian's `.cm-table-widget`). That keeps the table's overflow inside
* our own scroller and the button pinned to the *visible* corner instead of
* floating off-screen at the table's far-right edge.
*/
.lookout-table-host {
position: relative;
display: grid;
grid-template-columns: minmax(0, 1fr);
width: 100%;
max-width: 100%;
}
.lookout-table-scroll {
grid-area: 1 / 1;
min-width: 0;
overflow-x: auto;
overflow-y: hidden;
}
.lookout-table-scroll > table {
margin: 0;
width: auto;
max-width: none;
}
.lookout-table-btn {
grid-area: 1 / 1;
justify-self: end;
align-self: start;
/* `sticky` keeps the button in view should any ancestor still scroll the
whole host horizontally; the grid alignment fixes it to the top-right. */
position: sticky;
top: 6px;
right: 6px;
z-index: 2;
color: var(--text-muted);
background-color: color-mix(in srgb, var(--background-primary) 88%, transparent);
backdrop-filter: saturate(1.1) blur(6px);
border: 1px solid var(--background-modifier-border);
border-radius: 6px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
opacity: 0;
transition: opacity 0.15s ease, background-color 0.12s ease, color 0.12s ease;
}
/*
* `:focus` as well as `:focus-visible`. Closing the full-screen view from the
* keyboard hands focus back here, and that route already matches
* `:focus-visible`; the plain `:focus` is the safety net for any programmatic
* focus that does not, because a focused-but-invisible button is a control the
* reader cannot see they are about to activate with Space.
*/
.lookout-table-host:hover .lookout-table-btn,
.lookout-table-btn:focus,
.lookout-table-btn:focus-visible {
opacity: 1;
}
.lookout-table-btn:hover {
background-color: var(--background-modifier-hover);
color: var(--text-normal);
}
/* full-screen table view */
.lookout-fs--table {
background-image: none; /* the table is the focus; no drafting grid */
}
.lookout-table-fs-scroll {
flex: 1;
overflow: auto;
padding: clamp(24px, 4vw, 64px);
padding-top: 64px; /* clearance for the close button */
display: flex;
align-items: flex-start;
justify-content: safe center; /* center small tables, scroll wide ones from the left */
}
/*
* The scroll container carries `.markdown-rendered` so the full-screen clone
* inherits the theme's table styling (matching the inline view). Scope this
* two-class selector under it so it outranks Obsidian's single-class table
* styles — overriding them without !important.
*/
.lookout-table-fs-scroll .lookout-table-fs-table {
margin: 0;
width: auto;
max-width: none;
height: max-content;
}
/*
* The full-screen table together with its footnote definitions. This wrapper
* only exists when at least one footnote resolves; otherwise the table stays
* the scroll container's single flex child exactly as before.
*
* Its width drives the footnote measure, so it must not simply hug the table:
* - `width: max-content` lets it span a table *wider* than the viewport, so
* the footnotes stay aligned with the table while panning right (it is
* deliberately not capped at `max-width: 100%`, which would stop the section
* and its divider at the viewport edge);
* - `min-width` gives it a readable floor, so a *narrow* table cannot squeeze
* the footnote text into a one-word-per-line ribbon — the note renders that
* same text at full note width.
* The table is centered within that floor, so the container's
* `justify-content: safe center` still centers small tables as before.
*/
.lookout-table-fs-scroll .lookout-fs-doc {
display: flex;
flex-direction: column;
align-items: center;
gap: 20px;
/* flex-shrink would otherwise clamp a wide wrapper back to the viewport. */
flex: none;
width: max-content;
min-width: min(100%, 60ch);
}
/*
* `width: 0` + `min-width: 100%` makes the section fill the wrapper without
* contributing to its max-content width — a long footnote must not widen (and
* so off-center) the table above it. Same two-class-under-container trick as
* the table rule above: enough specificity to outrank the theme's bare
* `.footnotes` styles without !important.
*/
.lookout-table-fs-scroll .lookout-fs-footnotes {
width: 0;
min-width: 100%;
margin: 0;
padding-top: 14px;
border-top: 1px solid var(--background-modifier-border);
color: var(--text-muted);
}
.lookout-table-fs-scroll .lookout-fs-footnotes ol {
margin: 0;
padding-inline-start: 1.6em;
/* The section spans the table by design (its divider is the table's rule),
but the prose inside it must not: a 2200px table would otherwise lay a
one-sentence footnote out as a single 2200px line. 70ch sits above the
wrapper's 60ch floor, so narrow tables are unaffected. */
max-width: 70ch;
}
/* Media inside a cloned definition (e.g. an already-processed Mermaid svg) must
not widen the overlay's scroll container. */
.lookout-table-fs-scroll .lookout-fs-footnotes :is(img, svg, video, canvas) {
max-width: 100%;
height: auto;
}
.lookout-table-fs-scroll .lookout-fs-footnotes li {
scroll-margin-top: 72px; /* clear the fixed close button when jumped to */
}
/* MarkdownRenderer wraps a definition's first block in <p>; the cloned <li>
contents used to be inline, so trim the outer margins to keep the list tight. */
.lookout-table-fs-scroll .lookout-fs-footnotes li > p:first-child {
margin-top: 0;
}
.lookout-table-fs-scroll .lookout-fs-footnotes li > p:last-child {
margin-bottom: 0;
}
/* Pointer-driven jumps focus the li programmatically and need no ring; a
keyboard-driven jump must keep one after `.is-lookout-target` expires. */
.lookout-table-fs-scroll .lookout-fs-footnotes li:focus {
outline: none;
}
.lookout-table-fs-scroll .lookout-fs-footnotes li:focus-visible {
outline: 2px solid var(--lookout-accent);
outline-offset: 2px;
}
.lookout-table-fs-scroll .is-lookout-target {
background-color: color-mix(in srgb, var(--lookout-accent) 14%, transparent);
border-radius: 4px;
transition: background-color 0.18s ease;
}
/*
* A marker whose definition could not be resolved: visible, but plainly inert.
* The dotted underline is the point: muting the colour alone would leave the
* only cue that a marker is deliberately dead to colour perception, and
* `cursor`/`title` say nothing until the pointer is already on it. Obsidian
* renders `.footnote-link` without an underline, so the dots read as "not the
* live thing" rather than as ordinary link styling.
*/
.lookout-table-fs-scroll .lookout-fn-unresolved {
color: var(--text-muted);
cursor: default;
/* A border, not `text-decoration` — and not its longhands either. Obsidian's
plugin CSS check groups the whole `text-decoration` family under one
caniuse feature that Chrome only *partially* supports, so every spelling of
it is flagged; the dotted bottom border draws the same cue out of CSS1
properties nothing has ever qualified. `padding-bottom` stands in for the
underline offset. */
border-bottom: 1px dotted currentColor;
padding-bottom: 1px;
}
.lookout-fs-close {
position: fixed;
top: 16px;
right: 18px;
z-index: 1;
width: 34px;
height: 34px;
color: var(--text-muted);
background-color: color-mix(in srgb, var(--background-primary) 90%, transparent);
border: 1px solid var(--background-modifier-border);
border-radius: 8px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
}
.lookout-fs-close:hover {
background-color: color-mix(in srgb, var(--text-error) 16%, transparent);
color: var(--text-error);
}
@media (prefers-reduced-motion: reduce) {
.lookout-stage.is-animating,
.lookout-gauge-fill {
transition: none;
}
.lookout-fs {
animation: none;
}
.lookout-table-fs-scroll .is-lookout-target {
transition: none;
}
}