Skip to content

fix: match native scrollbars to the scroll area style - #669

Merged
Azganoth merged 1 commit into
mainfrom
bug/styled-scrollbars
Oct 10, 2026
Merged

Azganoth merged 1 commit into
mainfrom
bug/styled-scrollbars

Conversation

@Azganoth

Copy link
Copy Markdown
Owner

Summary

Code blocks, tables, display math, and several smaller lists scrolled with the system's default scrollbar. Only the Mermaid diagram panel carried a copy of the ScrollArea thumb, and the rest of the app scrolls through ScrollArea itself.

  • One global ::-webkit-scrollbar rule in the app.css base layer now draws every natively scrolling region with the ScrollArea thumb: a 10px bar, a transparent track and corner, and a rounded border-colored thumb that darkens on hover. Editor blocks that ProseMirror renders outside React cannot be wrapped in ScrollArea, so styling the native bar is how they match it.
  • A global rule rather than an opt-in class gives a new scroll region the style without opting in, and replaces the Mermaid panel's copy. The Diagnostics and Preferences text areas, which Scrollable editor blocks and lists show the default system scrollbar #668 did not list, pick it up as well.
  • ScrollArea is unaffected: Base UI hides its viewport's native bar with scrollbar-width: none and a class-scoped ::-webkit-scrollbar { display: none }, which the base-layer rule does not outrank. The projected image source line and the heading outline keep their hidden bars the same way.
  • Code and math previews recognize a press on their scrollbar by comparing against clientHeight, so the thinner bar does not change that.

Related Issue

Closes #668

Verification

  • pnpm exec vitest run src/features/editor/tests/editorPresentation.test.ts: app.css holds the shared thumb rule, and the editor stylesheet defines no thumb of its own and sets no scrollbar-color or visible scrollbar-width, either of which makes Chromium ignore ::-webkit-scrollbar styling. The test fails against the previous editor stylesheet.
  • A production vite build emits the global rules with the declarations the Mermaid panel's rules previously compiled to.
  • pnpm check:frontend passed.

Not verified: the rendered scrollbars were not inspected in the app in either theme.

@Azganoth Azganoth added the Bug Something isn't working label Oct 10, 2026
@Azganoth Azganoth self-assigned this Oct 10, 2026
@Azganoth
Azganoth enabled auto-merge (squash) October 10, 2026 17:47
@Azganoth
Azganoth merged commit 7cea7b9 into main Oct 10, 2026
3 checks passed
@Azganoth
Azganoth deleted the bug/styled-scrollbars branch October 10, 2026 17:50
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Leafdown Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Scrollable editor blocks and lists show the default system scrollbar

1 participant