vantage-md 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,55 @@
1
+ /* vantage-md/styles/inline-svg.css
2
+ *
3
+ * Sizing for an `<svg>` a document writes inline (see "Inline SVG" in
4
+ * `docs/reference/inline-markup.md`). Without it a `width="2400"` drawing
5
+ * overflows the column instead of shrinking to it.
6
+ *
7
+ * It lives in the package, not the app, so that every renderer sizes a drawing
8
+ * the same way (D5): the app imports this file by relative source path, and
9
+ * `styles/index.css` re-exports it for the package's own <MarkdownViewer> and
10
+ * any other consumer of `vantage-md/styles`. It targets both container classes,
11
+ * Tailwind typography's `.prose` (the app, and the package viewer) and
12
+ * `.vantage-prose` (the package's `prose.css`), for the reason `task-list.css`
13
+ * gives.
14
+ *
15
+ * **Unlike its siblings this file IS layered, in `components`, and that is the
16
+ * point.** The rules reach every `svg` inside prose, including the icons a
17
+ * viewer draws there itself. A layered rule loses to every utility (Tailwind v4
18
+ * puts them in the later `utilities` layer) and to any unlayered rule a
19
+ * consumer writes. Unlayered, this would outrank all of them regardless of
20
+ * specificity.
21
+ *
22
+ * **It loses only on the properties the icon sets, though.** An icon's size
23
+ * utilities keep its size, and nothing keeps its display: the rule for an svg
24
+ * in a sentence made the Mermaid toolbar icons `inline-block` for a diagram in
25
+ * a list item, and their buttons grew. So an icon drawn inside prose states its
26
+ * display (`block`, in `MermaidDiagram.tsx`), and `inline_svg.spec.ts` deletes
27
+ * every rule in this file and requires that no icon or button moves.
28
+ */
29
+
30
+ @layer components {
31
+ :is(.prose, .vantage-prose) svg {
32
+ max-width: 100%;
33
+ }
34
+
35
+ /* Only a drawing with a viewBox scales to its box, so only there may the
36
+ height follow the capped width. Without one, `height: auto` shrank the
37
+ viewport and left the drawing at full size inside it: a 1600x100 drawing
38
+ in a 928px column measured 58px tall, with everything below cut off. */
39
+ :is(.prose, .vantage-prose) svg[viewBox] {
40
+ height: auto;
41
+ }
42
+
43
+ /* An svg written inside a sentence stays in it. Tailwind's preflight makes
44
+ every svg `display: block`, which put a 16px icon on a line of its own and
45
+ split its paragraph into three. Only inside the blocks that hold phrasing
46
+ content, so a drawing in a `<div>` of its own is still a block — and so
47
+ is an icon in a `<div>` with text around it, which this cannot tell from
48
+ a drawing. `caption` is not listed because the sanitizer drops it. */
49
+ :is(.prose, .vantage-prose)
50
+ :where(p, li, td, th, h1, h2, h3, h4, h5, h6, summary, dt, dd, figcaption)
51
+ svg {
52
+ display: inline-block;
53
+ vertical-align: middle;
54
+ }
55
+ }
@@ -0,0 +1,22 @@
1
+ /* ──────────────────────────────────────────
2
+ Line anchor highlights (#L42, #L42-L50)
3
+ ────────────────────────────────────────── */
4
+ .line-anchor-highlight {
5
+ background: rgb(59 130 246 / 0.08);
6
+ border-left: 3px solid rgb(59 130 246 / 0.5);
7
+ padding-left: 12px;
8
+ border-radius: 4px;
9
+ cursor: pointer;
10
+ transition: background 0.2s;
11
+ scroll-margin-top: 32px;
12
+ }
13
+ .line-anchor-highlight:hover {
14
+ background: rgb(59 130 246 / 0.12);
15
+ }
16
+ .dark .line-anchor-highlight {
17
+ background: rgb(59 130 246 / 0.1);
18
+ border-left-color: rgb(96 165 250 / 0.5);
19
+ }
20
+ .dark .line-anchor-highlight:hover {
21
+ background: rgb(59 130 246 / 0.16);
22
+ }