@refrakt-md/lumina 0.24.2 → 0.24.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@refrakt-md/lumina",
3
3
  "description": "Lumina theme for refrakt.md — design tokens, CSS, identity transform, and layout configs",
4
- "version": "0.24.2",
4
+ "version": "0.24.4",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -84,10 +84,10 @@
84
84
  "generate-tokens": "node scripts/generate-tokens.mjs"
85
85
  },
86
86
  "dependencies": {
87
- "@refrakt-md/runes": "0.24.2",
88
- "@refrakt-md/skeleton": "0.24.2",
89
- "@refrakt-md/transform": "0.24.2",
90
- "@refrakt-md/types": "0.24.2"
87
+ "@refrakt-md/runes": "0.24.4",
88
+ "@refrakt-md/skeleton": "0.24.4",
89
+ "@refrakt-md/transform": "0.24.4",
90
+ "@refrakt-md/types": "0.24.4"
91
91
  },
92
92
  "devDependencies": {
93
93
  "postcss": "^8.4.0"
@@ -62,6 +62,17 @@
62
62
  calc((100% - var(--rf-content-max, 80rem)) / 2)
63
63
  );
64
64
  }
65
+ /* Page sections (data-content-measure="anchored") keep their content at the
66
+ * text measure when bled to the wide track — only the surface/background
67
+ * widens, matching how `full` reads as a band. The absolutely-positioned bg
68
+ * fills the padded box, so the inner padding restores content without pulling
69
+ * the bleed in. Runes without the flag fill the wide track (card breakout). */
70
+ .rf-page-content > article > [data-content-measure="anchored"][data-width="wide"] {
71
+ padding-inline: max(
72
+ var(--rf-content-gutter, 1.5rem),
73
+ calc((100% - var(--rf-content-max, 80rem)) / 2)
74
+ );
75
+ }
65
76
  /* Tinted sections also break out to full width */
66
77
  .rf-page-content > article > :is([data-tint], [data-color-scheme]):not([data-width]) {
67
78
  padding-inline: max(
@@ -23,9 +23,33 @@
23
23
  [data-section="media"] {
24
24
  border-radius: var(--rf-radius-media);
25
25
  }
26
- [data-section="media"] > * {
26
+
27
+ /* `data-guest-fit` (emitted from rune config) is the chrome/containment axis:
28
+ *
29
+ * clip — a framed well (card, bento-cell, recipe, playlist). Every guest
30
+ * adopts the slot radius so it reads as one surface with the well.
31
+ * bleed — a bare section host (hero, feature). A *rune* guest keeps its own
32
+ * chrome (its `data-elevation` radius, border, shadow) — the slot
33
+ * would otherwise just mask a sandbox / codegroup / juxtapose's
34
+ * corners. Leaf media still frames to the slot (an image has no
35
+ * chrome of its own, so a bare hero image stays rounded).
36
+ *
37
+ * Absence of the attribute reads as `clip` (the historical default). */
38
+ [data-section="media"]:not([data-guest-fit="bleed"]) > * {
27
39
  border-radius: inherit;
28
40
  }
41
+ [data-section="media"]:not([data-guest-fit="bleed"]) .rf-codegroup {
42
+ border-radius: var(--rf-radius-media);
43
+ }
44
+
45
+ /* Bleed host: leaf media adopts the slot radius; a rune guest does not, and the
46
+ * slot drops its own radius so its clip never rounds the guest's corners. */
47
+ [data-section="media"][data-guest-fit="bleed"] > :is(img, video, svg, .rf-placeholder) {
48
+ border-radius: inherit;
49
+ }
50
+ [data-section="media"][data-guest-fit="bleed"]:has(> [data-rune]) {
51
+ border-radius: 0;
52
+ }
29
53
 
30
54
  /* `preview` (negative-margin breakout) and a displaced `showcase` (peek spill)
31
55
  * want the slot fully de-chromed so the bleed reads as edge-to-edge. Juxtapose
@@ -44,12 +68,6 @@
44
68
  border-radius: 0;
45
69
  }
46
70
 
47
- /* A code-group dropped into a media zone uses the media radius tier so its
48
- * border and corners line up with the zone's clip. */
49
- [data-section="media"] .rf-codegroup {
50
- border-radius: var(--rf-radius-media);
51
- }
52
-
53
71
  /* Beside-layout images get subtle depth. Block runes carry their own visual
54
72
  * weight (topbars, frames) so the shadow is image-only. */
55
73
  [data-media-position="start"] > [data-section="media"] > img,
@@ -1,26 +1,42 @@
1
1
  @layer skin {
2
2
  /* Code Group — skin.
3
3
  *
4
- * Chrome (the wrapper + topbar + tabs) uses `--rf-color-surface` so it
5
- * reads against the page in both light and dark modes. The code areas
6
- * themselves inherit `--rf-color-code-bg` from the global `pre` rule.
4
+ * A codegroup is a *code container*: the topbar, tabs, and code body all
5
+ * belong to the code surface, not the page chrome. So the wrapper fill and
6
+ * its inner chrome derive from `--rf-color-code-bg` / `--rf-color-code-text`
7
+ * — the tokens a syntax preset (Nord, Dracula, …) owns. This keeps the whole
8
+ * component coherent with its code body even when the active preset gives the
9
+ * code surface a palette that diverges from the page (e.g. Nord's Polar Night
10
+ * code surface on an otherwise-neutral site). It also matches `diff`, whose
11
+ * body already fills from `--rf-color-code-bg`.
12
+ *
13
+ * Only the outer frame (border + shadow) stays in the page world so the
14
+ * component still reads as a card sitting on the page — same as diff's outer
15
+ * border. The chrome strip is a subtle elevation off the code surface, and
16
+ * the separators / text derive from the code tokens via color-mix so they
17
+ * stay legible against any code background in both light and dark modes.
7
18
  *
8
19
  * The wrapper clip, topbar flex, list reset, the scrollable tab strip, and the
9
20
  * tab flex live in @refrakt-md/skeleton (styles/runes/codegroup.css). The pre/code
10
21
  * rules stay here in skin: they deliberately override elements/code.css by source
11
22
  * order (the `data-overflow="wrap"` reset especially). */
12
23
  .rf-codegroup {
24
+ /* Code-surface-derived chrome — legible against any --rf-color-code-bg. */
25
+ --rf-codegroup-chrome: color-mix(in srgb, var(--rf-color-code-text) 5%, var(--rf-color-code-bg));
26
+ --rf-codegroup-line: color-mix(in srgb, var(--rf-color-code-text) 14%, var(--rf-color-code-bg));
27
+ --rf-codegroup-muted: color-mix(in srgb, var(--rf-color-code-text) 55%, var(--rf-color-code-bg));
28
+
13
29
  border: 1px solid var(--rf-color-border);
14
- background: var(--rf-color-surface);
15
- color: var(--rf-color-text);
30
+ background: var(--rf-color-code-bg);
31
+ color: var(--rf-color-code-text);
16
32
  box-shadow: var(--rf-shadow-md);
17
33
  padding: 0;
18
34
  }
19
35
  .rf-codegroup__topbar {
20
36
  gap: 0.375rem;
21
37
  padding: 0.75rem 1rem;
22
- background: transparent;
23
- border-bottom: 1px solid var(--rf-color-border);
38
+ background: var(--rf-codegroup-chrome);
39
+ border-bottom: 1px solid var(--rf-codegroup-line);
24
40
  margin-bottom: 0;
25
41
  }
26
42
  /* Window chrome — three traffic-light dots painted as gradients on one
@@ -43,21 +59,21 @@
43
59
  margin-left: 0.5rem;
44
60
  font-size: var(--rf-text-xs);
45
61
  font-weight: normal;
46
- color: var(--rf-color-muted);
62
+ color: var(--rf-codegroup-muted);
47
63
  }
48
64
  .rf-codegroup ul {
49
65
  padding: 0;
50
66
  margin: 0;
51
67
  }
52
68
  .rf-codegroup__tabs {
53
- background: transparent;
54
- border-bottom: 1px solid var(--rf-color-border);
69
+ background: var(--rf-codegroup-chrome);
70
+ border-bottom: 1px solid var(--rf-codegroup-line);
55
71
  }
56
72
  .rf-codegroup__tab {
57
73
  padding: 0.5rem 1rem;
58
74
  font-size: var(--rf-text-xs);
59
75
  font-family: var(--rf-font-mono);
60
- color: var(--rf-color-muted);
76
+ color: var(--rf-codegroup-muted);
61
77
  background: none;
62
78
  border: none;
63
79
  border-bottom: 2px solid transparent;
@@ -67,15 +83,15 @@
67
83
  }
68
84
  .rf-codegroup__tab:hover,
69
85
  .rf-codegroup button[data-state="inactive"]:hover {
70
- color: var(--rf-color-text);
86
+ color: var(--rf-color-code-text);
71
87
  }
72
88
  .rf-codegroup__tab--active,
73
89
  .rf-codegroup button[data-state="active"] {
74
- color: var(--rf-color-text);
90
+ color: var(--rf-color-code-text);
75
91
  border-bottom-color: var(--rf-color-primary);
76
92
  }
77
93
  .rf-codegroup button[data-state="inactive"] {
78
- color: var(--rf-color-muted);
94
+ color: var(--rf-codegroup-muted);
79
95
  }
80
96
  .rf-codegroup .rf-codeblock {
81
97
  margin: 0;
@@ -1,7 +1,20 @@
1
1
  @layer skin {
2
2
  /* Diff — skin. The scroll container, sticky header, split grid, rows grid, line
3
- * flex + gutter sizing live in @refrakt-md/skeleton (styles/runes/diff.css). */
3
+ * flex + gutter sizing live in @refrakt-md/skeleton (styles/runes/diff.css).
4
+ *
5
+ * Like codegroup, a diff is a code container: the header, the panel divider,
6
+ * and the gutter belong to the code surface, so they derive from
7
+ * `--rf-color-code-bg` / `--rf-color-code-text` (the tokens a syntax preset
8
+ * owns) via color-mix. This keeps the chrome coherent with the code body even
9
+ * when the active preset gives the code surface a palette that diverges from
10
+ * the page (e.g. Nord on a neutral site). Only the outer frame (border) stays
11
+ * in the page world. */
4
12
  .rf-diff {
13
+ /* Code-surface-derived chrome — legible against any --rf-color-code-bg. */
14
+ --rf-diff-chrome: color-mix(in srgb, var(--rf-color-code-text) 5%, var(--rf-color-code-bg));
15
+ --rf-diff-line: color-mix(in srgb, var(--rf-color-code-text) 14%, var(--rf-color-code-bg));
16
+ --rf-diff-muted: color-mix(in srgb, var(--rf-color-code-text) 55%, var(--rf-color-code-bg));
17
+
5
18
  border: 1px solid var(--rf-color-border);
6
19
  border-radius: var(--rf-radius-lg);
7
20
  font-size: var(--rf-text-sm);
@@ -12,12 +25,12 @@
12
25
  font-family: var(--rf-font-sans);
13
26
  font-size: var(--rf-text-xs);
14
27
  font-weight: var(--rf-weight-semibold);
15
- color: var(--rf-color-muted);
16
- background: var(--rf-color-surface);
17
- border-bottom: 1px solid var(--rf-color-border);
28
+ color: var(--rf-diff-muted);
29
+ background: var(--rf-diff-chrome);
30
+ border-bottom: 1px solid var(--rf-diff-line);
18
31
  }
19
32
  .rf-diff__split-container .rf-diff__panel:first-child {
20
- border-right: 1px solid var(--rf-color-border);
33
+ border-right: 1px solid var(--rf-diff-line);
21
34
  }
22
35
  .rf-diff__code {
23
36
  margin: 0;
@@ -52,7 +65,7 @@
52
65
  font-size: var(--rf-text-xs);
53
66
  font-variant-numeric: tabular-nums;
54
67
  user-select: none;
55
- color: var(--rf-color-muted);
68
+ color: var(--rf-diff-muted);
56
69
  }
57
70
  .rf-diff__line[data-line-status="remove"] .rf-diff__gutter-num[data-side="before"] {
58
71
  color: var(--rf-color-danger);
@@ -149,6 +149,9 @@
149
149
  margin-top: 3rem;
150
150
  border-radius: var(--rf-radius-lg);
151
151
  }
152
+ /* Rune-guest chrome handling (don't round a sandbox / codegroup / juxtapose) is
153
+ * the shared `data-guest-fit="bleed"` behaviour — see layouts/split.css. The
154
+ * hero only sets the image radius tier here. */
152
155
  .rf-hero[data-media-position="top"] > .rf-hero__media {
153
156
  margin-top: 0;
154
157
  margin-bottom: 3rem;
@@ -1,8 +1,27 @@
1
1
  @layer skin {
2
2
  /* Sandbox — skin. The iframe clip/fill + banner/poster/activate layout live in
3
3
  * @refrakt-md/skeleton (styles/runes/sandbox.css). */
4
+
5
+ /* The iframe canvas is opaque (the behaviour writes `color-scheme` onto the
6
+ * srcdoc `<html>`, so the UA paints a solid backdrop — `background: transparent`
7
+ * can't make it see-through). A rounded shape therefore can't come from inside
8
+ * the sandbox; the embedding element has to clip it. The sandbox owns its
9
+ * radius and skeleton's `overflow: hidden` does the clip; the iframe inherits
10
+ * the radius so the clip holds across browsers (the rounded-iframe corner case).
11
+ *
12
+ * Radius mirrors codegroup: `radius-container` standalone — and in a bleed host
13
+ * (hero/feature) where the guest keeps its own chrome — while a clip-host well
14
+ * rounds it to the smaller media tier via the shared `[data-section="media"]
15
+ * > *` rule. A full-bleed cover/backdrop sandbox sits flush. */
16
+ .rf-sandbox {
17
+ border-radius: var(--rf-radius-container);
18
+ }
19
+ [data-media-position="cover"] .rf-sandbox {
20
+ border-radius: 0;
21
+ }
4
22
  .rf-sandbox iframe {
5
23
  border: none;
24
+ border-radius: inherit;
6
25
  }
7
26
  /* Static fallback (pre/code shown before hydration) */
8
27
  .rf-sandbox pre {