-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
feat: horizontal scroll for long equations #545
feat: horizontal scroll for long equations #545
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, but it might be better to change it as follows:
mjx-container {
overflow: auto;
padding: 0.5rem 0;
}
Hi, thank you for the comment.
The suggested edits can create both horizontal and vertical scrolls for large equations. When using the Safari desktop browser, if the equation is wide a horizontal scroll appears and if the set of equations is lengthy a vertical appears (ofc if it's both, both scrolls are created). Test Configuration: To test this, I tried the following configurations using the Safari browser [vertical scroll]: I used the following set of small-width equations
O/P: only vertical scroll on desktop [horizontal scroll] As specified in the PR description [Both] Included all equations from the previous two tests in one Edit: Behaviour observed on the safari desktop browser only. When using Chrome or Firefox, no vertical scrolls are created. |
Hi @cotes2020, It absolutely does :) It fixes #543 by introducing horizontal scroll bars wherever necessary. But, on the Safari browser, it also does slightly more. Your suggested changes create vertical scrolls in some contexts as shown below. double-scroll.movMy comment above just details which scrollbars appear in which contexts just to document the behaviour. I've temporarily included a large equation here so you can check through the behaviour. The old code snippet did not create vertical scrollbars. Personally, I think vertical scrollbars are unnecessary for your beautiful theme. For instance, below as I vertically scroll through the long set of equations, I personally do not like the vertical scroll because of how messy it makes my post look when a part of the equation disappears. vertical-scroll.movI observed this behaviour only when using the Safari browser but not on Chrome or the Firefox browser. I'm not sure why this is the case. |
Sorry, I didn't notice you were using Safari for macOS. The vertical scrollbar doesn't show up in Chrome/Firefox, but it does on Safari desktop, I'm not sure why this happens. As you said, vertical scrolling is unnecessary, the following changes can hide the vertical scrollbar on safari: mjx-container {
- overflow: auto;
- padding: 0.5rem 0;
+ overflow-x: auto;
+ overflow-y: hidden;
} Of course, if you have a better way, welcome to correct me. |
Hi @cotes2020, No, it is completely my fault, I should have mentioned I was using Safari. I initially didn't think it would make a difference. I apologize for the confusion. Should I update the commit as specified?
|
Yes, just change it to the following: mjx-container {
overflow-x: auto;
overflow-y: hidden;
} It removes two unnecessary styles ( |
…hub.com/Jayitha/jekyll-theme-chirpy into feature/horizontal-scroll-for-equations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your time :)
Hi @cotes2020, My last comment, I swear. This was my first PR. It felt really good :) |
(cherry picked from commit 30787fc)
Description
Currently, long equations rendered by MathJax tend to overflow the post content onto the right side navigational toc and on phones, they get completely cut off. PR introduces a horizontal scroll for along equations.
Fixes #543
Type of change
How has this been tested
I specified a long equation detailed below
This equation currently runs over the navigation toc in the browser and gets completely cut off on the phone as described in the feature request: #543
Post making the changes in this PR, a disappearing horizontal scroll appears for long equation.
bash ./tools/deploy.sh --dry-run
(at the root of the project) locally and passedTest Configuration
Checklist