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

refactor(theme-classic): blog mobile secondary menu use consistent styles #7068

Merged
merged 3 commits into from
Apr 7, 2022

Conversation

Josh-Cena
Copy link
Collaborator

Motivation

Fix the double-scrolling problem reported.

@lex111 also wants to change the font, but I'm not quite sure if that's beneficial in the long term.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Screen Shot 2022-03-30 at 3 13 01 PM

@Josh-Cena Josh-Cena added the pr: polish This PR adds a very minor behavior improvement that users will enjoy. label Mar 30, 2022
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Mar 30, 2022
@netlify
Copy link

netlify bot commented Mar 30, 2022

[V2]

Name Link
🔨 Latest commit 04daa61
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/62441acaa9a6a000083b51d4
😎 Deploy Preview https://deploy-preview-7068--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 Mar 30, 2022

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 57
🟢 Accessibility 100
🟢 Best practices 92
🟢 SEO 100
🟢 PWA 90

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

@github-actions
Copy link

github-actions bot commented Mar 30, 2022

Size Change: -27 B (0%)

Total Size: 807 kB

ℹ️ View Unchanged
Filename Size Change
website/.docusaurus/globalData.json 49.9 kB 0 B
website/build/assets/css/styles.********.css 105 kB -27 B (0%)
website/build/assets/js/main.********.js 613 kB 0 B
website/build/index.html 38.4 kB 0 B

compressed-size-action

@lex111
Copy link
Contributor

lex111 commented Mar 30, 2022

This was an example of a design inconsistency, but we could theoretically apply the sidebar menu item class to latest post items in secondary menu, right?

@Josh-Cena
Copy link
Collaborator Author

I'm not too sure if that would look good, considering we are mixing sidebar and menu styles together. I think font changes would be sufficient?

@lex111
Copy link
Contributor

lex111 commented Mar 30, 2022

I meant that in some clever way remove or replace the original (i.e. desktop) styling and apply those CSS classes that are intended for sidebar menu.

@Josh-Cena
Copy link
Collaborator Author

I just realized our blog doesn't use any styles from Infima. Do you think we should use more Infima class names on both desktop and mobile, or is your goal simply to make the mobile secondary menu the same as primary menu? I'd still like the desktop and mobile sidebars have similar styling/layout though.

@lex111
Copy link
Contributor

lex111 commented Mar 30, 2022

or is your goal simply to make the mobile secondary menu the same as primary menu?

Yes, that's all I mean. The fact that the blog sidebar is different from the doc sidebar is ok, since they are completely different types of menus. However, on mobile, it makes sense to stick to the same design for both of them. How difficult is it to implement?

@Josh-Cena
Copy link
Collaborator Author

Not difficult at all, if we have a separate BlogSidebar/Mobile component. I started by hoping that we can simply portal BlogSidebarContent on mobile and render it on desktop, so we can reuse the same content twice. But what you said makes some sense. Let's try...

@Josh-Cena Josh-Cena changed the title fix(theme-classic): blog mobile sidebar fixes refactor(theme-classic): blog mobile secondary menu use consistent styles Mar 30, 2022
@Josh-Cena
Copy link
Collaborator Author

@lex111 Is that what you mean?

@lex111
Copy link
Contributor

lex111 commented Mar 30, 2022

Yess, it looks great now, thanks!

@Josh-Cena
Copy link
Collaborator Author

Josh-Cena commented Mar 30, 2022

Asked for opinions on Discord as well, waiting for more feedback. The idea is that if both the community and @slorber think the previous design is better, we can simply revert 04daa61 and merge this as a trivial fix of double scrolling.

Do you have plans about how all this should work if we have more "blog sidebar items" in the future, as discussed in #5461?

@lex111
Copy link
Contributor

lex111 commented Mar 30, 2022

Without the actual design it is difficult to say, but I suppose it will also be presented as a sidebar menu, perhaps collapsible one with a label as a kind of heading.

Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

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

thanks, LGTM 👍

@slorber
Copy link
Collaborator

slorber commented Apr 7, 2022

Do you have plans about how all this should work if we have more "blog sidebar items" in the future, as discussed in #5461?

We'll figure this out but I guess we can have a context/hook so each item would be able to know if it's in a mobile/desktop layout and handle the 2 cases with some tweats 🤷‍♂️ (can also apply to navbar items btw instead of forwarding the mobile={true} prop)

@slorber slorber merged commit ca718cc into main Apr 7, 2022
@slorber slorber deleted the jc/fix-blog-sidebar branch April 7, 2022 13:56
@Josh-Cena
Copy link
Collaborator Author

Over time I start to appreciate this design as well. The only concern I have being extensibility in the future if the blog sidebar becomes richer. But anyways ¯_(ツ)_/¯

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: polish This PR adds a very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants