@workerdeck/ui 0.13.0 → 0.15.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.
@@ -196,6 +196,38 @@
196
196
  --radius: var(--radius-md);
197
197
  }
198
198
 
199
+ /*
200
+ * The agent panel's typeface, from `SessionPanel`'s `transcriptFont` prop.
201
+ *
202
+ * `mono` repoints the **sans** token at the mono stack for that subtree, so the
203
+ * transcript and its composer render monospace and read as part of the terminal
204
+ * rather than as a web app beside one. The mono token itself is left alone: code
205
+ * was already mono, and pointing both at the same stack is what makes the two
206
+ * indistinguishable — which is the point.
207
+ *
208
+ * A subtree rule rather than `:root`, and deliberately: this is the *agent
209
+ * panel's* preference, not the app's. A host's sidebar, dialogs and lists keep
210
+ * their UI font, and nothing outside the panel can pick this up by accident.
211
+ * (VS Code's webview does the same thing one level up, at `html[data-font]`,
212
+ * because there the panel *is* the document.)
213
+ */
214
+ [data-agent-font='mono'] {
215
+ --cw-font-sans: var(--cw-font-mono);
216
+ /* Tailwind's `font-sans` utility reads `--font-sans`, whose `:root` value is
217
+ `var(--cw-font-sans)` — and a `var()` inside a custom property is resolved
218
+ against the element that DECLARED it, not the one that inherits it. So
219
+ repointing `--cw-font-sans` here leaves `--font-sans` still holding the sans
220
+ stack it computed at `:root`. Both have to move. */
221
+ --font-sans: var(--cw-font-mono);
222
+ /* And the actual property, because the ambient typeface is not a token lookup
223
+ at all: `body { font-family: var(--cw-font-sans) }` computed once at `body`,
224
+ and every descendant inherits that *resolved* stack. Nothing under here
225
+ re-reads the token, so the subtree has to be told directly.
226
+ (VS Code's webview gets away with tokens alone only because its override
227
+ sits on `html` — the same element `:root` declares them on.) */
228
+ font-family: var(--cw-font-mono);
229
+ }
230
+
199
231
  /* Drive dark: off the same <html data-theme> the tokens swap on. */
200
232
  @custom-variant dark (&:where([data-theme='dark'], [data-theme='dark'] *));
201
233