Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: preserve sidebar height when toggling #8195

Closed
wants to merge 1 commit into from

Conversation

0916dhkim
Copy link
Contributor

@0916dhkim 0916dhkim commented Oct 8, 2022

Pre-flight checklist

  • 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.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

This PR makes the heights of the sidebar & the expand button fixed (100vh). This solves the layout shift.

Test Plan

2022-10-09.23-04-42.mp4

Go to a page where the sidebar height is greater than the main content height (an example is linked below). Try hiding/expanding the sidebar to make sure that there is no layout shift.

Test links

Deploy preview: https://deploy-preview-8195--docusaurus-2.netlify.app/tests/docs
Same page on prod: https://docusaurus.io/tests/docs

Related issues/PRs

Solves #4415

@netlify
Copy link

netlify bot commented Oct 8, 2022

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit ae5721d
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/6341e1515842f700081c7391
😎 Deploy Preview https://deploy-preview-8195--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 site settings.

@github-actions
Copy link

github-actions bot commented Oct 8, 2022

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 87 🟢 98 🟢 100 🟢 100 🟠 80 Report
/docs/installation 🟠 75 🟢 100 🟢 100 🟢 100 🟢 90 Report

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Oct 9, 2022
@0916dhkim 0916dhkim marked this pull request as ready for review October 10, 2022 03:11
@slorber
Copy link
Collaborator

slorber commented Oct 12, 2022

This seems to fix the issue indeed but introduce a new one.

If a doc has a small sidebar + small content, it still takes 100vh making it less clear that scrolling will reveal a footer

Before:

CleanShot 2022-10-12 at 20 17 13@2x

After:

CleanShot 2022-10-12 at 20 18 02@2x

That can be particularly confusing for vertical screens with a lot of vh IMHO 🤷‍♂️

CleanShot 2022-10-12 at 20 18 40

@slorber slorber closed this Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants