Skip to content

fix: paint an opaque canvas so Firefox on Android has no white bars - #384

Open
lamiskin wants to merge 2 commits into
Git-Romer:mainfrom
lamiskin:fix/firefox-android-white-canvas-v2
Open

fix: paint an opaque canvas so Firefox on Android has no white bars#384
lamiskin wants to merge 2 commits into
Git-Romer:mainfrom
lamiskin:fix/firefox-android-white-canvas-v2

Conversation

@lamiskin

@lamiskin lamiskin commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What and why

The app had no opaque background-color on html or body — the dark appearance depended entirely on a gradient image. body's winning background rule uses the unlayered background shorthand, which resets background-color to transparent, so the canvas behind that gradient was the browser's default white. Chromium extends the gradient across overscroll/safe-area regions; Firefox on Android doesn't, showing white bars.

Sets background-color: var(--color-bg) on html (whose background always paints the whole canvas, themed per [data-theme]) and restores an opaque fallback colour to body's own shorthand.

Also found on-device: a persistent white strip on the right edge, at rest rather than only during a bounce gesture — a different bug, since nothing at the page root should ever scroll horizontally. Painting over it would have hidden a real overflow bug rather than fixed it, so this adds overflow-x: hidden to html, body to remove that scroll surface entirely.

Before — white strip visible on the right edge:
After

After — fixed:
Before

Validation

  • Confirmed on-device (Firefox on Android) before and after
  • Documentation was updated when behavior changed (no user-facing docs affected)

Card UI (when applicable)

  • Not applicable — global canvas background fix, no new visual pattern

Cherry-picked from the old fork main (ce68d7d) as its own independent
branch off the current main — it was merged into the fork before main
was reset to exactly match upstream/main, so it silently dropped out.

The app had no opaque background colour on either html or body, so the
entire dark appearance depended on a single animated gradient image.
body's winning background rule is unlayered and uses the background
shorthand, which resets background-color to transparent — leaving body
with a gradient image and no colour, propagated to the canvas over the
browser's default white. Chromium extends the propagated image across
overscroll/safe-area regions; Firefox on Android does not, hence the
white bars.

Sets background-color on html (whose background always paints the
whole canvas) and restores an opaque colour to body's shorthand as a
fallback. Both use var(--color-bg) since main.jsx sets data-theme on
documentElement and each [data-theme] block redefines it.
The vertical opaque-canvas fix targets legitimate top/bottom overscroll
bounce, which the app wants. Horizontal scroll at the page root is not
wanted anywhere, so if the document is ever a pixel wider than the
viewport (e.g. an edge-bleed carousel row miscalculating its own
negative margin), the page becomes horizontally pannable/bounceable at
the root and the same white-canvas symptom reappears on the right edge.
overflow-x: hidden on html/body removes that scroll surface entirely
instead of relying on background colour to hide what it reveals.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant