@thebuilder/umbraco-docs 1.5.2 → 1.6.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.
package/README.md CHANGED
@@ -67,6 +67,16 @@ export default defineConfig({
67
67
 
68
68
  The accent has a shade per color mode, `#7557e8` in light and `#a78bfa` in dark, and each meets WCAG AA as link text and with its button label, which Blume picks: white in light, dark in dark. It needs Blume 2. `DOCS_ACCENT` exports the two shades for other uses, such as the hub's own CSS.
69
69
 
70
+ ## Diagrams
71
+
72
+ Blume turns a ` ```mermaid ` fence in an `.mdx` page into a [Mermaid](https://mermaid.js.org) diagram, and only loads Mermaid on pages that have one. Out of the box it uses Mermaid's own lavender and yellow. `styles/diagrams.css` repaints diagrams from the site's Blume tokens instead, so boxes take the family accent, notes and frames use the muted surface, and the text uses the body font, in both color modes. Import it at the top of the site's `theme.css`:
73
+
74
+ ```css
75
+ @import "@thebuilder/umbraco-docs/styles/diagrams.css";
76
+ ```
77
+
78
+ Use a diagram where a page explains a flow or a choice that's hard to follow in prose, such as a request passing through several parts, and keep it next to the text it illustrates, not instead of it. Sequence diagrams and flowcharts fit the 48rem column best; keep labels short so they stay readable without scrolling sideways.
79
+
70
80
  ## Particle hero
71
81
 
72
82
  `HeroParticles` draws the site's logo in glowing WebGPU particles, as on [umbraco.thebuilder.dk](https://umbraco.thebuilder.dk). The particles swirl in from a scattered sky, settle into the logo in its own colors, and scatter around the pointer. Put it in the hero's `background` slot. Package docs sites use the split layout, so the logo forms beside the text instead of behind it:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thebuilder/umbraco-docs",
3
- "version": "1.5.2",
3
+ "version": "1.6.0",
4
4
  "description": "Composable Blume presentation and metadata contracts for TheBuilder Umbraco package documentation.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -31,6 +31,7 @@
31
31
  "./astro": "./components/index.ts",
32
32
  "./components/*": "./components/*.astro",
33
33
  "./styles/landing.css": "./styles/landing.css",
34
+ "./styles/diagrams.css": "./styles/diagrams.css",
34
35
  "./behaviors": "./dist/behaviors.js",
35
36
  "./og": {
36
37
  "types": "./dist/og/index.d.ts",
@@ -0,0 +1,114 @@
1
+ /*
2
+ * Mermaid diagrams in the docs family's colors. Blume renders ```mermaid fences with Mermaid's
3
+ * stock "default" and "dark" themes, which bring their own lavender and yellow. These rules repaint
4
+ * the rendered SVG from Blume's tokens instead, so a diagram follows the site's accent and surfaces
5
+ * in both color modes. Mermaid scopes its own styles to the diagram's id, hence !important.
6
+ */
7
+ blume-mermaid svg {
8
+ --udocs-diagram-fill: color-mix(in oklab, var(--blume-accent) 9%, var(--blume-background));
9
+ --udocs-diagram-stroke: color-mix(in oklab, var(--blume-accent) 55%, var(--blume-background));
10
+ --udocs-diagram-line: var(--blume-muted-foreground);
11
+ --udocs-diagram-text: var(--blume-foreground);
12
+ }
13
+
14
+ /*
15
+ * SVG text, as in sequence diagrams, takes the body font: Mermaid sizes those boxes with room to
16
+ * spare. HTML labels, as in flowcharts, keep Mermaid's font, because Mermaid sizes each box to its
17
+ * label in that font and a wider one would be clipped.
18
+ */
19
+ blume-mermaid svg text,
20
+ blume-mermaid svg tspan {
21
+ font-family: var(--blume-font-body) !important;
22
+ fill: var(--udocs-diagram-text) !important;
23
+ }
24
+
25
+ blume-mermaid svg .nodeLabel,
26
+ blume-mermaid svg .edgeLabel,
27
+ blume-mermaid svg foreignObject div,
28
+ blume-mermaid svg foreignObject span,
29
+ blume-mermaid svg foreignObject p {
30
+ color: var(--udocs-diagram-text) !important;
31
+ }
32
+
33
+ /* Boxes: sequence participants, flowchart nodes, state and class boxes. */
34
+ blume-mermaid svg rect.actor,
35
+ blume-mermaid svg .node rect,
36
+ blume-mermaid svg .node circle,
37
+ blume-mermaid svg .node ellipse,
38
+ blume-mermaid svg .node polygon,
39
+ blume-mermaid svg .node path,
40
+ blume-mermaid svg .basic.label-container {
41
+ fill: var(--udocs-diagram-fill) !important;
42
+ stroke: var(--udocs-diagram-stroke) !important;
43
+ stroke-width: 1px !important;
44
+ }
45
+
46
+ blume-mermaid svg rect.actor {
47
+ rx: 6px;
48
+ ry: 6px;
49
+ }
50
+
51
+ /* Lines and arrows. */
52
+ blume-mermaid svg .actor-line {
53
+ stroke: var(--blume-border) !important;
54
+ }
55
+
56
+ blume-mermaid svg .messageLine0,
57
+ blume-mermaid svg .messageLine1,
58
+ blume-mermaid svg .flowchart-link,
59
+ blume-mermaid svg .edgePath .path,
60
+ blume-mermaid svg .relation,
61
+ blume-mermaid svg .transition {
62
+ stroke: var(--udocs-diagram-line) !important;
63
+ }
64
+
65
+ blume-mermaid svg marker path,
66
+ blume-mermaid svg .arrowheadPath,
67
+ blume-mermaid svg .arrowMarkerPath,
68
+ blume-mermaid svg #arrowhead path {
69
+ fill: var(--udocs-diagram-line) !important;
70
+ stroke: var(--udocs-diagram-line) !important;
71
+ }
72
+
73
+ /* Edge labels sit on the page, not on a colored chip. */
74
+ blume-mermaid svg .edgeLabel,
75
+ blume-mermaid svg .edgeLabel rect,
76
+ blume-mermaid svg .edgeLabel p,
77
+ blume-mermaid svg .labelBkg {
78
+ background-color: var(--blume-background) !important;
79
+ fill: var(--blume-background) !important;
80
+ }
81
+
82
+ /* Notes: the muted surface instead of a yellow sticky. */
83
+ blume-mermaid svg .note {
84
+ fill: var(--blume-muted) !important;
85
+ stroke: var(--blume-border) !important;
86
+ }
87
+
88
+ /* alt, opt and loop frames: a quiet dashed outline with the accent on the label tab. */
89
+ blume-mermaid svg .loopLine {
90
+ stroke: var(--blume-border) !important;
91
+ }
92
+
93
+ blume-mermaid svg .labelBox {
94
+ fill: var(--udocs-diagram-fill) !important;
95
+ stroke: var(--udocs-diagram-stroke) !important;
96
+ }
97
+
98
+ blume-mermaid svg .loopText,
99
+ blume-mermaid svg .loopText tspan,
100
+ blume-mermaid svg .labelText,
101
+ blume-mermaid svg .labelText tspan,
102
+ blume-mermaid svg .edgeLabel *,
103
+ blume-mermaid svg .noteText,
104
+ blume-mermaid svg .noteText tspan {
105
+ fill: var(--blume-muted-foreground) !important;
106
+ color: var(--blume-muted-foreground) !important;
107
+ }
108
+
109
+ /* Flowchart subgraphs. */
110
+ blume-mermaid svg .cluster rect {
111
+ fill: transparent !important;
112
+ stroke: var(--blume-border) !important;
113
+ stroke-dasharray: 4 3;
114
+ }