docusaurus
docusaurus copied to clipboard
fix(theme-classic): restore right padding on sidebar (DocSidebar) in Firefox
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
- Run locally:
- Clone the repository and run
yarn install. - Start the development server:
yarn workspace website start. - Open
http://localhost:3000in Firefox 137, Librewolf 137, Zen, Chromium, and Epiphany. - Inspect the sidebar buttons (
.menu) using Developer Tools to confirmpadding-right: 0.5remin Firefox-based browsers. - Verify that Chromium, Edge, and Epiphany retain correct padding (no regressions).
- Clone the repository and run
- Run tests:
- Execute
yarn testto run unit tests and confirm no failures.
- Execute
- Screenshots:
- Before: Sidebar buttons in Firefox 137 lack right padding.
- After: Sidebar buttons in Firefox 137 have
padding-right: 0.5rem.
- 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
[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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
⚡️ 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 |
See https://github.com/facebook/docusaurus/issues/11130#issuecomment-3139676727