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

fix(v2): fit footer in viewport when content area is too small #4311

Merged
merged 3 commits into from
Mar 4, 2021

Conversation

lex111
Copy link
Contributor

@lex111 lex111 commented Feb 27, 2021

Motivation

Remove the minimum doc sidebar height equal to the viewport (i.e. 100vh) to make visible footer in it if there is very small content on any doc page (see screenshots below).

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Before:

The footer is not visible in viewport, although there is very little doc content.

image

After:

The footer is visible on screen with small content area (no need to scroll the page for this).

image

---
id: empty
title: Empty page
---

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@lex111 lex111 added the pr: bug fix This PR fixes a bug in a past release. label Feb 27, 2021
@lex111 lex111 requested a review from slorber as a code owner February 27, 2021 14:01
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Feb 27, 2021
}
<>
<Head>
<style>{`.main-wrapper { display: flex; }`}</style>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we only have one CSS bundle for entire site, all the styles defined in the components become globally available. And therefore, I had to add this rule directly in the component via the style tag (because it should only be applied to docs). I don't like this approach, but are there any better options?

Copy link
Contributor

@Simek Simek Mar 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not add an additional, custom className to the Docs wrapper and just style it via this new selector (for example main-docs-wrapper)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right, I completely forgot about this wonderful prop, thanks for the tip!

@netlify
Copy link

netlify bot commented Feb 27, 2021

[V1] Deploy preview success

Built with commit ee839f5

https://deploy-preview-4311--docusaurus-1.netlify.app

@github-actions
Copy link

github-actions bot commented Feb 27, 2021

Size Change: +9 B (0%)

Total Size: 532 kB

ℹ️ View Unchanged
Filename Size Change
website/build/assets/css/styles.********.css 87.1 kB +9 B (0%)
website/build/assets/js/main.********.js 359 kB 0 B
website/build/blog/2017/12/14/introducing-docusaurus/index.html 60.3 kB 0 B
website/build/docs/introduction/index.html 235 B 0 B
website/build/index.html 25.4 kB 0 B

compressed-size-action

@netlify
Copy link

netlify bot commented Feb 27, 2021

Deploy preview for docusaurus-2 ready!

Built with commit ee839f5

https://deploy-preview-4311--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Mar 2, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 93
🟢 Accessibility 96
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-4311--docusaurus-2.netlify.app/classic/

@slorber
Copy link
Collaborator

slorber commented Mar 4, 2021

LGTM 👍

@slorber slorber merged commit da5175a into master Mar 4, 2021
@lex111 lex111 added this to the v2.0.0-alpha.71 milestone Mar 4, 2021
@slorber slorber deleted the lex111/min-content-footer branch August 17, 2021 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants