-
Notifications
You must be signed in to change notification settings - Fork 258
fix: improve mobile responsiveness across documentation site (#2998) #734
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
base: main
Are you sure you want to change the base?
Conversation
Enhanced mobile experience by fixing layout issues and adding comprehensive responsive styles for various screen sizes. Changes: - Fixed horizontal scrolling in Product and UtgMethods components by replacing grid-flow-col with responsive grid layouts that stack on mobile - Added comprehensive mobile breakpoints (@768px, @480px) to custom.css - Implemented responsive typography with scaled font sizes for mobile devices - Optimized navbar, pagination, and footer spacing for touch-friendly interaction - Made community icons and spacing responsive (smaller on mobile, larger on desktop) - Fixed table and code block overflow handling on small screens - Added tablet-specific styles (769px-996px) for mid-range devices - Improved button, card, and form layouts for mobile screens All sections now properly align and display consistently across mobile, tablet, and desktop viewports without horizontal scrolling or broken layouts. Signed-off-by: Divyansh Rai <raidivyansh899@gmail.com>
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 and congratulations 🎉 for opening your very first pull request in keploy
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.
Pull request overview
This PR addresses mobile responsiveness issues across the documentation site by fixing horizontal scrolling problems and implementing comprehensive responsive design patterns for various screen sizes.
Key Changes:
- Replaced fixed-width grid layouts with responsive Tailwind grid classes to prevent horizontal scrolling
- Added comprehensive media queries for mobile (≤768px), tablet (769px-996px), and small mobile (≤480px) devices
- Implemented responsive typography, spacing, and icon sizing throughout the site
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/UtgMethods.js | Changed grid layout from grid-flow-col to responsive classes for proper mobile stacking |
| src/components/Product.js | Updated grid layouts to use responsive column classes instead of fixed-width layouts |
| src/components/Community.js | Adjusted icon sizes and spacing to be responsive (smaller on mobile, larger on desktop) |
| src/css/custom.css | Added comprehensive mobile-first responsive styles including typography scaling, spacing adjustments, and component-specific fixes |
| src/pages/styles.module.css | Added mobile-specific styling for hero banner, features, buttons, and other page components with multiple breakpoint support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| fill="currentColor" | ||
| // Hotfix: add viewBox to prevent icon from being cut off after tailwind preflight disabled | ||
| className="h-12 w-12 flex-none text-black " | ||
| className="h-10 w-10 sm:h-12 sm:w-12 flex-none text-black" |
Copilot
AI
Dec 17, 2025
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.
Trailing whitespace should be removed at the end of the className for consistency and cleaner code.
| /* Fix icon sizing on small screens */ | ||
| svg { |
Copilot
AI
Dec 17, 2025
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.
This rule applies to all SVG elements globally on small screens, which could unintentionally affect icons that need specific dimensions to maintain proper aspect ratios or visual alignment. Consider using a more specific selector like '.card svg' or a utility class to target only content images rather than all SVG elements including icons in navigation or UI components.
| /* Fix icon sizing on small screens */ | |
| svg { | |
| /* Fix SVG sizing for content images on small screens */ | |
| .card svg, | |
| div[class*="rounded-lg"] svg { |
| > | ||
| <svg | ||
| class="h-12 w-12 flex-none " | ||
| class="h-10 w-10 sm:h-12 sm:w-12 flex-none" |
Copilot
AI
Dec 17, 2025
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.
The attribute should use "className" instead of "class" in JSX. While this change was made to improve responsive sizing, the original attribute name should be corrected for proper React/JSX syntax.
| class="h-10 w-10 sm:h-12 sm:w-12 flex-none" | |
| className="h-10 w-10 sm:h-12 sm:w-12 flex-none" |
| </p> | ||
|
|
||
| <div className="grid gap-4 sm:grid-cols-3 xl:gap-6"> | ||
| <div className="grid gap-4 grid-cols-1 sm:grid-cols-3 xl:gap-6"> |
Copilot
AI
Dec 17, 2025
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.
There's an extra space between "gap-4" and "grid-cols-1" that should be removed for consistency with other class declarations in the codebase.
| fill="currentColor" | ||
| // Hotfix: add viewBox to prevent icon from being cut off after tailwind preflight disabled | ||
| className="h-12 w-12 flex-none text-red-500 " | ||
| className="h-10 w-10 sm:h-12 sm:w-12 flex-none text-red-500" |
Copilot
AI
Dec 17, 2025
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.
Trailing whitespace should be removed at the end of the className for consistency and cleaner code.
| img { | ||
| max-width: 100%; | ||
| height: auto; |
Copilot
AI
Dec 17, 2025
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.
This rule applies to all img elements globally on mobile, which could cause unintended side effects for images that require fixed dimensions (like logos, icons, or decorative elements). Consider using a more specific selector like '.markdown img' or 'article img' to target only content images rather than all images across the site.
Enhanced mobile experience by fixing layout issues and adding comprehensive responsive styles for various screen sizes. Changes: - Fixed horizontal scrolling in Product and UtgMethods components by replacing grid-flow-col with responsive grid layouts that stack on mobile - Added comprehensive mobile breakpoints (@768px, @480px) to custom.css - Implemented responsive typography with scaled font sizes for mobile devices - Optimized navbar, pagination, and footer spacing for touch-friendly interaction - Made community icons and spacing responsive (smaller on mobile, larger on desktop) - Fixed table and code block overflow handling on small screens - Added tablet-specific styles (769px-996px) for mid-range devices - Improved button, card, and form layouts for mobile screens All sections now properly align and display consistently across mobile, tablet, and desktop viewports without horizontal scrolling or broken layouts. Signed-off-by: Divyansh Rai <140232173+divyansh-cyber@users.noreply.github.com>
|
Hi @Achanandhi-M 👋 This addresses the issues described in #2998. |
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.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| section ul { | ||
| padding-left: 0; | ||
| } | ||
|
|
||
| section li { |
Copilot
AI
Dec 17, 2025
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.
The selector "section ul" is very broad and will affect all unordered lists within any section element on mobile. This could unintentionally override padding for lists that need left padding (like documentation content with nested lists). Consider using a more specific selector or scoping this to the specific component that needs it.
| section ul { | |
| padding-left: 0; | |
| } | |
| section li { | |
| section > ul { | |
| padding-left: 0; | |
| } | |
| section > ul > li { |
|
|
||
| /* Adjust card padding on small screens */ | ||
| .card, | ||
| div[class*="rounded-lg"] { |
Copilot
AI
Dec 17, 2025
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.
The selector div[class*="rounded-lg"] is very broad and will match any div with "rounded-lg" anywhere in its class string, potentially affecting many unintended elements across the site. This could override padding for elements that need different spacing. Consider using a more specific selector or a dedicated class.
| div[class*="rounded-lg"] { | |
| .rounded-lg { |
| // Hotfix: add viewBox to prevent icon from being cut off after tailwind preflight disabled | ||
| className="h-12 w-12 flex-none text-red-500 " | ||
| className="h-10 w-10 sm:h-12 sm:w-12 flex-none text-red-500" | ||
| viewBox="0 0 48 48" |
Copilot
AI
Dec 17, 2025
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.
The viewBox attribute contains extra spaces ("0 0 48 48" should be "0 0 48 48"). While this may not cause issues, it's inconsistent with standard SVG formatting and could be confusing.
| viewBox="0 0 48 48" | |
| viewBox="0 0 48 48" |
| // Hotfix: add viewBox to prevent icon from being cut off after tailwind preflight disabled | ||
| className="h-12 w-12 flex-none text-black " | ||
| className="h-10 w-10 sm:h-12 sm:w-12 flex-none text-black" | ||
| viewBox="0 0 48 48" |
Copilot
AI
Dec 17, 2025
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.
The viewBox attribute contains extra spaces ("0 0 48 48" should be "0 0 48 48"). While this may not cause issues, it's inconsistent with standard SVG formatting and could be confusing.
| viewBox="0 0 48 48" | |
| viewBox="0 0 48 48" |
| </p> | ||
|
|
||
| <div className="grid gap-4 sm:grid-cols-3 xl:gap-6"> | ||
| <div className="grid gap-4 grid-cols-1 sm:grid-cols-3 xl:gap-6"> |
Copilot
AI
Dec 17, 2025
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.
There are two spaces between "gap-4" and "grid-cols-1". While this doesn't affect functionality, it's inconsistent with the single-space separation used elsewhere and could be cleaned up for consistency.
Description:
What has changed?
Fixed mobile layout issues where components were not properly aligned and caused horizontal scrolling on small screens. Added comprehensive responsive styles to ensure the documentation site looks great on all devices.
This PR Resolves #2998
Type of change
Changes Made
grid-flow-colwith responsive grid layouts (grid-cols-1 sm:grid-cols-2 lg:grid-cols-3)How Has This Been Tested?
npm run buildsuccessfullynpm run serveand verified changesScreenshots
Mobile View (iPhone SE - 375px):
Tablet View (iPad Pro - 1024px):
Desktop View (1200px):
Checklist:
Links & References
Closes: #2998
keploy/keploy#2998