@thebuilder/umbraco-docs 1.5.2 → 1.7.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 +12 -2
- package/components/LandingHero.astro +1 -4
- package/package.json +2 -1
- package/styles/diagrams.css +114 -0
- package/styles/landing.css +0 -2
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@ import { InstallCommand, LandingHero, LandingRoot } from "@thebuilder/umbraco-do
|
|
|
46
46
|
</LandingRoot>
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
`logo
|
|
49
|
+
`logo` and `description` are optional. There is no eyebrow: the family doesn't put small text labels above headings, so start with the title. A hero can also draw its own background, such as a canvas, through the `background` slot, which renders behind the glow and the content.
|
|
50
50
|
|
|
51
51
|
`layout="split"` puts the text on the left, left-aligned, and the logo large on the right, as on the social cards. Below 56rem the logo sits above the text, smaller, with the text centered under it. Below 36rem, in either layout, the action buttons share the full width of the text in equal parts and the install command spans the same width, so every site's hero lines up the same way on a phone. The default, `centered`, stacks a small logo and the text in the middle. Give a split hero a `logo` or a `HeroParticles` background to fill that column. Content in the default slot, such as a `ScreenshotFrame`, goes below either layout at full width.
|
|
52
52
|
|
|
@@ -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:
|
|
@@ -96,7 +106,7 @@ How it behaves:
|
|
|
96
106
|
|
|
97
107
|
- **Shape.** The logo is drawn into a 256 pixel square and particles are placed on its solid pixels, taking their colors. Soft glow layers, below 60% coverage, are left out. A logo that's small on screen, such as above the text on a phone, draws only some of its particles, so it keeps the same airy density as a large one instead of packing into a solid glow. An SVG logo's `viewBox` decides its shape. A cross-origin logo needs CORS; without it, the fallback below shows instead.
|
|
98
108
|
- **Motion.** Still shapes catch a slow band of light that sweeps across them. To make a stroke stream from one end to the other instead, pass `flow` with its center line as SVG path data, its width and the logo's `viewBox`, such as `flow={{ path: "M60 44v92a68 68 0 0 0 136 0V44", width: 36, viewBox: 256 }}`.
|
|
99
|
-
- **Readability.** Over the particles, the hero's description
|
|
109
|
+
- **Readability.** Over the particles, the hero's description and compatibility line are brighter than usual, and the action buttons get a frosted backdrop. In the centered layout, where the logo forms behind the text, the particles also dim behind the text, so it keeps 4.5:1 contrast even against the brightest particles.
|
|
100
110
|
- **Layout.** The particles fill the hero down to the first content after the text, such as a `ScreenshotFrame`. In the split layout the logo forms in the column beside the text, or above it on narrow screens; in the centered layout it fills the middle and steps back behind the text, so leave out the hero's own `logo` there. In the split layout a `logo` is replaced by the particles. When the hero sits under a sticky header, such as Blume's, the particles run on up behind it, and the header starts clear and turns to its usual frosted bar as the page scrolls. Browsers without scroll-driven animations, such as Firefox, get the same from a scroll listener. Don't clip vertical overflow on an element around the hero, such as `overflow: clip` on the `LandingRoot` class; use `overflow-x: clip`, or the particles can't reach the header.
|
|
101
111
|
- **Themes.** It follows `data-theme` on `<html>`, which Blume sets, and the system theme without one: light on dark, colored ink on light.
|
|
102
112
|
- **Fallbacks.** With reduced motion it draws one still frame. Without WebGPU, or if the logo can't be read, the logo itself shows where the particles would form, faded behind the text in the centered layout. It pauses while scrolled out of view.
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
interface Props {
|
|
3
3
|
title: string;
|
|
4
|
-
/** A short line above the title, such as what the package is for. */
|
|
5
|
-
eyebrow?: string;
|
|
6
4
|
description?: string;
|
|
7
5
|
logo?: string;
|
|
8
6
|
logoAlt?: string;
|
|
@@ -16,7 +14,7 @@ interface Props {
|
|
|
16
14
|
layout?: "centered" | "split";
|
|
17
15
|
}
|
|
18
16
|
|
|
19
|
-
const { title,
|
|
17
|
+
const { title, description, logo, logoAlt = "", accent, compatibility, layout = "centered" } = Astro.props;
|
|
20
18
|
const split = layout === "split";
|
|
21
19
|
---
|
|
22
20
|
|
|
@@ -26,7 +24,6 @@ const split = layout === "split";
|
|
|
26
24
|
<div class="udocs-shell udocs-hero__inner">
|
|
27
25
|
<div class="udocs-hero__copy">
|
|
28
26
|
{logo && !split && <img class="udocs-hero__logo" src={logo} width="72" height="72" alt={logoAlt} data-udocs-reveal />}
|
|
29
|
-
{eyebrow && <p class="udocs-hero__eyebrow" data-udocs-reveal>{eyebrow}</p>}
|
|
30
27
|
<h1 id="udocs-hero-title" class="udocs-hero__title" data-udocs-reveal>
|
|
31
28
|
{title}{accent && <> <span class="udocs-hero__accent">{accent}</span></>}
|
|
32
29
|
</h1>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thebuilder/umbraco-docs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.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
|
+
}
|
package/styles/landing.css
CHANGED
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
.udocs-hero__logo { width: 4.5rem; height: 4.5rem; object-fit: contain; }
|
|
48
48
|
.udocs-hero__title { max-width: 20ch; margin: 0; font-family: var(--blume-font-display, system-ui); font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
|
|
49
49
|
.udocs-hero__accent { color: transparent; background: var(--udocs-gradient); background-clip: text; -webkit-background-clip: text; }
|
|
50
|
-
.udocs-hero__eyebrow { margin: 0; color: var(--udocs-accent); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
|
|
51
50
|
.udocs-hero__description { max-width: 44rem; margin: 0; color: var(--udocs-muted-foreground); font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.65; }
|
|
52
51
|
.udocs-hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
|
|
53
52
|
.udocs-hero__compatibility { margin: 0; color: var(--udocs-muted-foreground); font-size: 0.875rem; }
|
|
@@ -55,7 +54,6 @@
|
|
|
55
54
|
behind it, so it keeps 4.5:1 even against the brightest of them. The buttons get a frosted
|
|
56
55
|
backdrop, which an outlined button needs to stay legible there. */
|
|
57
56
|
.udocs-hero:has(> .udocs-particles) :is(.udocs-hero__description, .udocs-hero__compatibility) { color: color-mix(in oklab, var(--udocs-foreground) 82%, transparent); }
|
|
58
|
-
.udocs-hero:has(> .udocs-particles) .udocs-hero__eyebrow { color: color-mix(in oklab, var(--udocs-accent) 60%, var(--udocs-foreground)); }
|
|
59
57
|
.udocs-hero:has(> .udocs-particles) .udocs-hero__actions > * { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
|
|
60
58
|
/* The split layout: the text on the left, the logo large on the right, where a particle logo
|
|
61
59
|
forms too. Narrow screens put a smaller logo above the text. */
|