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.

fix(quill): refine button, menu, and combobox interaction styling (#64290)

Adam Leith120579e3e077
diff --git a/packages/quill/apps/storybook/.storybook/preview.tsx b/packages/quill/apps/storybook/.storybook/preview.tsx
index 120adcb284d0..54d0882a9376 100644
--- a/packages/quill/apps/storybook/.storybook/preview.tsx
+++ b/packages/quill/apps/storybook/.storybook/preview.tsx
@@ -23,6 +23,21 @@ function ThemedDocsContainer(props: React.ComponentProps<typeof DocsContainer>):
}
const preview: Preview = {
+ globalTypes: {
+ desktop: {
+ name: 'Desktop mode',
+ description: 'Toggle the Electron desktop app surface (adds `is-desktop` to <body>)',
+ defaultValue: 'web',
+ toolbar: {
+ icon: 'browser',
+ items: [
+ { value: 'web', icon: 'browser', title: 'Web (pointer cursor)' },
+ { value: 'desktop', icon: 'box', title: 'Desktop (default cursor)' },
+ ],
+ dynamicTitle: true,
+ },
+ },
+ },
parameters: {
controls: {
matchers: {
@@ -59,6 +74,19 @@ const preview: Preview = {
},
},
decorators: [
+ // Mirrors the `desktop` toolbar global onto `<body class="is-desktop">`,
+ // matching how the Electron app tags its shell — lets the cursor reset
+ // (and any future desktop-only styling) be previewed live.
+ (Story, context) => {
+ const isDesktop = context.globals.desktop === 'desktop'
+
+ useEffect(() => {
+ document.body.classList.toggle('is-desktop', isDesktop)
+ return () => document.body.classList.remove('is-desktop')
+ }, [isDesktop])
+
+ return <Story />
+ },
// Hooks must run at the decorator's top level — Storybook's preview
// hooks context (which `useDarkMode` relies on) is only active here,
// not inside nested components a decorator renders. Syncs the signal to
diff --git a/packages/quill/packages/primitives/src/button.css b/packages/quill/packages/primitives/src/button.css
index a8137f7d8a99..2f869dc1c9a8 100644
--- a/packages/quill/packages/primitives/src/button.css
+++ b/packages/quill/packages/primitives/src/button.css
@@ -161,11 +161,7 @@
.quill-button--variant-outline:not(:disabled):hover {
color: var(--foreground);
- background-color: color-mix(in oklab, var(--muted) 50%, transparent);
- }
-
- :is(.dark, [theme='dark']) .quill-button--variant-outline:not(:disabled):hover {
- color: var(--foreground);
+ background-color: var(--fill-hover);
}
.quill-button--variant-outline[aria-expanded='true'] {
diff --git a/packages/quill/packages/primitives/src/combobox.css b/packages/quill/packages/primitives/src/combobox.css
index e3cdf8c70d7e..c2e30a3b24bc 100644
--- a/packages/quill/packages/primitives/src/combobox.css
+++ b/packages/quill/packages/primitives/src/combobox.css
@@ -116,7 +116,7 @@
}
.quill-combobox__item {
- /* The check indicator is absolutely positioned (end-2) and must anchor
+ /* The check indicator is absolutely positioned (start-2) and must anchor
to the item, not the scrolling popup. */
position: relative;
width: 100%;
@@ -128,6 +128,18 @@
opacity: 0.5;
}
+ /*
+ * No focus ring on options — the `[data-highlighted]` background fill is the
+ * sole active indicator (combobox uses virtual focus: the input keeps focus,
+ * so options never get `:focus-visible`). Suppress every ring Button can
+ * paint on an option. Scoped under `.quill-combobox__content` so the (0,4,0)
+ * specificity outranks Button's base rules regardless of stylesheet order.
+ */
+ .quill-combobox__content .quill-button--variant-default:is([data-highlighted], :focus-visible) {
+ border-color: transparent;
+ box-shadow: none;
+ }
+
.quill-combobox__item:not([data-variant='destructive'])[data-highlighted] * {
color: var(--foreground);
}
diff --git a/packages/quill/packages/primitives/src/combobox.tsx b/packages/quill/packages/primitives/src/combobox.tsx
index d4235c1931ac..c81e581dce64 100644
--- a/packages/quill/packages/primitives/src/combobox.tsx
+++ b/packages/quill/packages/primitives/src/combobox.tsx
@@ -162,19 +162,14 @@ function ComboboxItem({
return (
<ComboboxPrimitive.Item
data-slot="combobox-item"
- className={cn('quill-combobox__item', className)}
+ className={cn('quill-combobox__item quill-menu-item--inset', className)}
title={title ?? (typeof children === 'string' ? children : undefined)}
- render={
- <Button
- left
- className="min-w-0 aria-selected:pe-7 aria-selected:bg-fill-selected data-highlighted:border-ring data-highlighted:ring-2 data-highlighted:ring-ring/30 ring-offset-1"
- />
- }
+ render={<Button left className="min-w-0 aria-selected:bg-fill-selected" />}
{...props}
>
<span className="flex items-center gap-1.5 min-w-0 truncate">{children}</span>
<ComboboxPrimitive.ItemIndicator
- render={<span className="pointer-events-none absolute end-2 flex items-center justify-center" />}
+ render={<span className="pointer-events-none absolute start-2 flex items-center justify-center" />}
>
<CheckIcon className="pointer-events-none" />
</ComboboxPrimitive.ItemIndicator>
diff --git a/packages/quill/packages/primitives/src/menu.css b/packages/quill/packages/primitives/src/menu.css
index 649bb1d2e4d9..2b1964fdef28 100644
--- a/packages/quill/packages/primitives/src/menu.css
+++ b/packages/quill/packages/primitives/src/menu.css
@@ -134,6 +134,20 @@
border-top-right-radius: 0;
}
+ /*
+ * Menu items show no focus ring — the `[data-highlighted]` background fill
+ * is the sole active-item indicator for both mouse and keyboard. Suppress
+ * both the `data-highlighted` ring and the `:focus-visible` ring Button
+ * carries. (Hover never paints a ring, so `:not(:hover)` only serves to
+ * outrank Button's `[data-highlighted]:not(:hover)` rule regardless of
+ * stylesheet order.)
+ */
+ :is(.quill-menu__content, .quill-menu__sub-content)
+ .quill-button--variant-default:is([data-highlighted], :focus-visible):not(:hover) {
+ border-color: transparent;
+ box-shadow: none;
+ }
+
/* Menubar root */
.quill-menubar {
height: 2.25rem;
diff --git a/packages/quill/packages/primitives/src/styles/layers.css b/packages/quill/packages/primitives/src/styles/layers.css
index e0d0f80de336..531650c19581 100644
--- a/packages/quill/packages/primitives/src/styles/layers.css
+++ b/packages/quill/packages/primitives/src/styles/layers.css
@@ -72,6 +72,28 @@
z-index: var(--quill-z-toast, 100);
}
+/*
+ * Desktop-app cursor reset.
+ *
+ * On the web a pointer cursor signals "clickable"; in the Electron desktop app
+ * native chrome uses the default arrow, so the pointer reads as a web tell.
+ * Consumers tag <body class="is-desktop"> to opt every interactive primitive
+ * back to the arrow. Each selector mirrors a `cursor: pointer` rule in the
+ * component CSS. These rules are unlayered, so they beat the component rules
+ * inside `@layer components` by layer precedence (unlayered > layered),
+ * independent of specificity or import order.
+ *
+ * Add a row here whenever a new primitive sets `cursor: pointer`.
+ */
+body.is-desktop .quill-button,
+body.is-desktop .quill-toggle,
+body.is-desktop .quill-accordion__trigger,
+body.is-desktop .quill-checkbox:not(:disabled),
+body.is-desktop .quill-field__label:has(> [data-slot='field']),
+body.is-desktop .group\/field:has(> [role='checkbox']) .quill-label {
+ cursor: default;
+}
+
/*
* Tailwind v4 emits `@keyframes` from `@theme` only when the corresponding
* `animate-*` utility is statically used in JSX. BEM CSS references these