fix(scrollbar): consistent scrollbar styling across Firefox and Chromium browsers (Windows)#514
Open
reniko wants to merge 7 commits into
Open
fix(scrollbar): consistent scrollbar styling across Firefox and Chromium browsers (Windows)#514reniko wants to merge 7 commits into
reniko wants to merge 7 commits into
Conversation
…omium Replace the old webkit-only 8px scrollbar block with a unified approach: - @supports (-moz-appearance: none) guard so Firefox-only scrollbar-width/color rules don't trigger Chrome 121+ standard scrollbar API - Unified 6px webkit pseudo-element rules for .overflow-y-auto, .overflow-x-auto, .overflow-auto and .scrollbar-thin (no arrows, transparent track) - Remove hide-scrollbar from Notes/Checklist overview and Sidebar so scrollbars are visible in both browsers - Add tailwind-scrollbar plugin classes to KanbanCardDetail panes and Kanban board Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…change Upstream added a bare <div> wrapper around Modal children in default size mode, breaking the flex height chain. Target it via [&>div:last-child] to give it flex-1 + flex-col so the inner panes get a defined height and can scroll again. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…efox - Remove tailwind-scrollbar plugin classes from both scroll panes; the plugin sets scrollbar-width:thin unconditionally which triggers Chrome 121+ standard scrollbar API (auto-hide overlay) making scrollbars invisible in Edge - Change lg:overflow-y-auto to overflow-y-auto so globals.css webkit rules (.overflow-y-auto::-webkit-scrollbar) apply, giving a always-visible 6px bar - Add lg:[&>div:last-child]:overflow-hidden to prevent the Modal wrapper div from showing its own scrollbar on desktop, which overlapped in Firefox Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Tailwind arbitrary variants with pseudo-selectors ([&>div:last-child]) do not compile reliably. Replace with a dedicated CSS class: .jotty-modal-content.jotty-kanban-detail-modal > div:last-child targets the bare wrapper div upstream injected, making it flex-1 flex-col so the inner layout and per-pane overflow-y-auto work again. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The upstream Modal wrapper div breaks the flex chain for default size. size=fullscreen gives the children wrapper flex-1 overflow-auto by design. Inner div uses min-h-full + lg:overflow-hidden so panes scroll independently on desktop while the wrapper scrolls as one unit on mobile. Removes the fragile CSS child selector approach. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
scrollbar-thin and related plugin classes set scrollbar-width on Chrome 121+, which causes it to ignore the ::-webkit-scrollbar rules in globals.css and fall back to native auto-hide scrollbars. The global webkit rules already cover .overflow-y-auto and .overflow-auto, so the plugin classes are counterproductive on those elements.
The Firefox-only @supports block listed overflow-y-auto and overflow-auto but missed overflow-x-auto, leaving horizontally scrolling containers with the default OS scrollbar in Firefox. The corresponding webkit rules already include overflow-x-auto.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
That one was a little harder. My detail knowledge about CSS is a little limited so that one is much more done with Claude. Fell free to merge, adjust, send back or recect this PR.
Problem
Scrollbars were visually inconsistent across browsers:
scrollbar-width: auto !importantinglobals.cssoverrodehide-scrollbar'sscrollbar-width: none, causing scrollbars to appear where they were explicitly hidden.Root cause
Chrome 121+ changed behaviour: if
scrollbar-widthis set on an element, Chrome ignores all::-webkit-scrollbarpseudo-element rules and uses the standard API instead, falling back to the native OS scrollbar on Windows.The existing
globals.csssetscrollbar-width: auto !importantwithout a browser guard, which broke the webkit-styled scrollbars in Chromium. The same effect was triggered bytailwind-scrollbarplugin classes (scrollbar-thin,scrollbar-thumb-*etc.) — these also setscrollbar-widthon the element.For
KanbanCardDetail:Modal.tsxwraps children in a bare<div className="">forsize="default", which broke the flex height chain needed by the two-pane layout.Changes
globals.cssscrollbar-width: thin+scrollbar-colorinside@supports (-moz-appearance: none)(Firefox-only guard), so Firefox gets styled scrollbars without triggering Chrome's standard-API path.::-webkit-scrollbarblock to cover.overflow-y-auto,.overflow-x-auto,.overflow-auto, and.scrollbar-thinconsistently — 6 px width,primary/0.3thumb, transparent track, no scrollbar buttons.scrollbar-width: auto !importantrule that was breakinghide-scrollbarin Firefox.KanbanCardDetail.tsxsize="fullscreen"on<Modal>— this wraps children inflex-1 overflow-autoinstead of a bare div, restoring the flex chain.min-h-full(notflex-1) since the fullscreen wrapper is not itself a flex container.overflow-y-autowithout thelg:responsive prefix — theglobals.csswebkit rules target.overflow-y-autoexactly; the responsive variant.lg\:overflow-y-autois a different class name and would not match.ChecklistHome.tsx/NotesHome.tsxhide-scrollbarfrom main containers. With the corrected global scrollbar styling, hidden scrollbars on these containers caused visual inconsistency with the rest of the app where scrollbars are now consistently visible and styled.SidebarWrapper.tsx/Kanban.tsxtailwind-scrollbarplugin classes (scrollbar-thin,scrollbar-thumb-*,scrollbar-track-*,scrollbar-*-rounded-md). These setscrollbar-widthon the element, which triggers Chrome 121+'s standard-API path and causes the webkit rules inglobals.cssto be ignored. The global styles already cover.overflow-y-autoand.overflow-auto, so the plugin classes are redundant.Minor visual change: KanbanCardDetail modal header
Using
size="fullscreen"changes the modal header fromp-6padding +mb-6separator top-3 border-b— a tighter, more compact look. This is a side effect of the existingfullscreenvariant inModal.tsxand is intentional in this PR; happy to address the original header style separately if preferred.Tested
@supportsguard;hide-scrollbarworks again where used.