Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(quill): add a primary-on-foreground token for brand text on tooltips (#112181)

Adam Leithb73bdaf4c0f7
diff --git a/frontend/src/design.md b/frontend/src/design.md
index b41f34fb0aa4..2b4bbe8a1a54 100644
--- a/frontend/src/design.md
+++ b/frontend/src/design.md
@@ -150,6 +150,7 @@ Use via Tailwind utilities (`bg-primary text-primary-foreground`, `border-border
- `chrome`: toolbars, menubars, nav
- Text:
- `subtle-foreground`: tertiary meta text, one step quieter than `muted-foreground`
+ - `primary-on-foreground`: brand text, such as a link, on an inverted surface that uses `foreground` as its background (tooltips). It swaps to the other mode's brand: yellow on a dark tooltip in light mode, orange on a light tooltip in dark mode. Plain `primary` fades on those surfaces.
- Interactive fills (overlay on any surface):
- `fill-hover`, `fill-selected`, `fill-expanded`
- Lines:
diff --git a/frontend/src/styles/quill-bridge.scss b/frontend/src/styles/quill-bridge.scss
index 2928b535b91e..298a9361f16e 100644
--- a/frontend/src/styles/quill-bridge.scss
+++ b/frontend/src/styles/quill-bridge.scss
@@ -195,6 +195,10 @@
color: var(--primary-foreground);
}
+[data-quill] .text-primary-on-foreground {
+ color: var(--primary-on-foreground);
+}
+
[data-quill] .text-destructive-foreground {
color: var(--destructive-foreground);
}
diff --git a/packages/quill/packages/tokens/src/colors.ts b/packages/quill/packages/tokens/src/colors.ts
index fa0708222c3d..329ea9e72a31 100644
--- a/packages/quill/packages/tokens/src/colors.ts
+++ b/packages/quill/packages/tokens/src/colors.ts
@@ -116,6 +116,9 @@ export function buildSemanticColors(): Record<string, ColorTuple> {
// ── Brand (driven by --primary-light / --primary-dark) ─
primary: ['var(--primary-light)', 'var(--primary-dark)', 'bg-primary'],
+ // Brand text on an inverted surface, such as a tooltip on `--foreground`. It takes the other mode's brand,
+ // so a dark tooltip in light mode gets the yellow, and a light tooltip in dark mode gets the orange.
+ 'primary-on-foreground': ['var(--primary-dark)', 'var(--primary-light)', 'text-primary-on-foreground'],
'primary-foreground': [oklch(1, 0, 0), oklch(0.13, 0.028, 262), 'text-primary-foreground'],
// ── Status (independent of theme hue) ─────────
@@ -224,6 +227,7 @@ const THEME_DERIVED_TOKENS: ReadonlySet<string> = new Set([
'muted',
'chrome',
'primary',
+ 'primary-on-foreground',
'border',
'input',
// Transitive: reference var(--foreground) / var(--muted) — must also live