docusaurus icon indicating copy to clipboard operation
docusaurus copied to clipboard

fix(theme-classic): restore right padding on sidebar (DocSidebar) in Firefox

Open epifaniofrancisco opened this issue 6 months ago • 2 comments

Pre-flight checklist

  • [x] I have read the Contributing Guidelines on pull requests.
  • [ ] If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • [x] If this is a new API or substantial change: the PR has an accompanying issue (closes #11130) and the maintainers have approved on my working plan.

Motivation

Added @supports (-moz-appearance: none) and (scrollbar-gutter: stable) to set padding-right: 0.5rem for Firefox-based browsers, fixing missing right padding on sidebar while preserving behavior in other browsers. The issue occurs because the existing @supports (scrollbar-gutter: stable) block sets padding: 0.5rem 0 0.5rem 0.5rem, which removes right padding in Firefox-based browsers (e.g., Firefox 137, Librewolf 137, Zen). This fix uses -moz-appearance: none to target Firefox specifically.

Test Plan

  1. Run locally:
    • Clone the repository and run yarn install.
    • Start the development server: yarn workspace website start.
    • Open http://localhost:3000 in Firefox 137, Librewolf 137, Zen, Chromium, and Epiphany.
    • Inspect the sidebar buttons (.menu) using Developer Tools to confirm padding-right: 0.5rem in Firefox-based browsers.
    • Verify that Chromium, Edge, and Epiphany retain correct padding (no regressions).
  2. Run tests:
    • Execute yarn test to run unit tests and confirm no failures.
  3. Screenshots:
    • Before: Sidebar buttons in Firefox 137 lack right padding.

Captura de Ecrã (2)

  • After: Sidebar buttons in Firefox 137 have padding-right: 0.5rem.

Captura de Ecrã (3)

  1. Browsers Tested:
    • Firefox 137, Librewolf 137, Zen (fixed).
    • Chromium, Edge.

Test links

Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/

Related issues/PRs

  • Issue: #11130

epifaniofrancisco avatar May 19 '25 15:05 epifaniofrancisco

[V2]

Built without sensitive environment variables

Name Link
Latest commit 45277f2599d8a44b8c7d051307b861e76a4ee0b9
Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/682b4d28b4776b00088c91c0
Deploy Preview https://deploy-preview-11183--docusaurus-2.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar May 19 '25 15:05 netlify[bot]

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO Report
/ 🔴 46 🟢 98 🟢 100 🟢 100 Report
/docs/installation 🔴 48 🟢 97 🟢 100 🟢 100 Report
/docs/category/getting-started 🟠 70 🟢 100 🟢 100 🟠 86 Report
/blog 🟠 57 🟢 96 🟢 100 🟠 86 Report
/blog/preparing-your-site-for-docusaurus-v3 🔴 45 🟢 92 🟢 100 🟢 100 Report
/blog/tags/release 🟠 61 🟢 96 🟢 100 🟠 86 Report
/blog/tags 🟢 94 🟢 100 🟢 100 🟠 86 Report

github-actions[bot] avatar May 19 '25 15:05 github-actions[bot]

See https://github.com/facebook/docusaurus/issues/11130#issuecomment-3139676727

slorber avatar Jul 31 '25 11:07 slorber