-
Notifications
You must be signed in to change notification settings - Fork 17
style: fix mobile layout overflow and optimize table/TOC display #101
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
Conversation
Summary of ChangesHello @xihale, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the website's responsiveness and mobile user experience. It systematically addresses various layout overflow issues by ensuring text, tables, and embedded media adapt gracefully to different screen sizes. The changes aim to provide a more robust and visually consistent presentation across all devices, particularly on smaller viewports. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces several useful styling changes to improve mobile layout and prevent content overflow. The use of min-width: 0 on flex items and making embedded content like tables and KaTeX blocks scrollable are good enhancements. However, there are a few areas for improvement. I've identified several instances where overflow-wrap: break-word; is applied redundantly, as it's already set on the body and inherited. More critically, the current implementation for responsive tables using display: block will break their layout; I've suggested an alternative that preserves the table structure while enabling horizontal scrolling. Finally, I've pointed out the use of a deprecated CSS property value that should be removed.
| display: block; | ||
| overflow-x: auto; | ||
| -webkit-overflow-scrolling: touch; |
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.
Using display: block; on a <table> element breaks its fundamental tabular layout, causing rows and cells to stack vertically instead of forming a grid. This also renders the border-collapse property ineffective. A more robust approach for creating a scrollable table is to wrap it in a div with overflow-x: auto. However, for a CSS-only solution, a better approach is to use display: inline-block with max-width: 100%. This preserves the table's internal layout while allowing overflow-x: auto to function correctly.
Additionally, -webkit-overflow-scrolling: touch; is a deprecated property. Modern mobile browsers provide momentum-based scrolling by default on scrollable elements, so this line can be removed.
| display: block; | |
| overflow-x: auto; | |
| -webkit-overflow-scrolling: touch; | |
| display: inline-block; | |
| max-width: 100%; | |
| overflow-x: auto; |
| line-height: 1.3; | ||
| color: var(--text-primary); | ||
| letter-spacing: -0.025em; | ||
| overflow-wrap: break-word; |
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.
| text-decoration: none; | ||
| font-weight: 500; | ||
| transition: color 0.2s ease, text-decoration-color 0.2s ease; | ||
| overflow-wrap: break-word; |
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.
| .article-title, .monthly-item-title { | ||
| overflow-wrap: break-word; | ||
| word-break: break-word; | ||
| } |
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.
No description provided.