Repository navigation
fix: resolve card overflow and layout issues in Learn page sections - #7813
Conversation
|
Preview deployment for PR #7813 removed. This PR preview was automatically pruned because we keep only the 3 most recently updated previews on GitHub Pages to stay within deployment size limits. If needed, push a new commit to this PR to generate a fresh preview. |
|
Hi @Sbragul26 I took a closer look at the mobile card sizing issue. The desktop layout is now working as expected, but the second card still appears a bit smaller on mobile. From what I found, the issue doesn't seem to be coming from the CSS. The three thumbnail images have different aspect ratios, which makes the cards look visually uneven. I don't think we can completely solve this with CSS alone without creating other visual compromises elsewhere.
|
|
@AnkitRewar11, can you please push a new commit to generate a fresh preview. |
done |
|
@AnkitRewar11 Thank you for your contribution! Let's discuss this during the website call tomorrow at 5:30 PM IST | 7 AM CST Add it as an agenda item to the meeting minutes, if you would 🙂 |
|
@Sbragul26, the content cut-off issue on mobile is resolved. The remaining slight height difference between cards is an asset issue. The three thumbnails have different aspect ratios. We can create a separate issue to standardise the thumbnail image dimensions. @AnkitRewar11, it looks good to me. |
|
@AnkitRewar11, can you please push a new commit to generate a fresh preview. |
|
@AnkitRewar11 , I have attached the screenshots of before and after for reference. |
|
@AasthathecoderX Thanks for pointing this out. It wasn’t intentional. I’ve updated the container and card layout so the cards now use the available desktop space more effectively while remaining responsive. Please take another look.
|
|
@banana-three-join, please take a look when you have some time. Thanks! |
banana-three-join
left a comment
There was a problem hiding this comment.
Is there a way to scope the fixes to the components of resusecore/Layout?
My question comes from the fact that the more solo components that we have, the harder that they'll be to maintain so could you look into it? If our reusable components can't be used under this context, then we can go ahead with this fix. Ty!
PARTH-TUSSLE
left a comment
There was a problem hiding this comment.
Hey @AnkitRewar11 One small thing I noticed is the Learning Paths section is using a custom CSS grid with multiple extra wrappers, while we already have the existing Row/Col layout components. Could we simplify this and use the existing layout components here if possible?
Also, learning-path-cards is being used on both the Row and the inner div, so it might be worth cleaning that up to avoid duplicate styling.
I agree with this concern. The original layout already uses the shared Container/Row/Col system, and the original overflow could be addressed by providing the missing responsive column props. The current implementation instead introduces a separate container, grid breakpoints, and wrapper hierarchy just for this section. Could we keep the reusable layout components here and only add the required responsive sizing, unless there is a concrete limitation that prevents them from achieving the intended 3-column desktop layout? |
Signed-off-by: ankitrewar11 <rewarankit18@gmail.com>
a1fbf0e to
c94c5d4
Compare
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
🚥 Pre-merge checks | ✅ 5
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@emphor11 @PARTH-TUSSLE @banana-three-join Thanks for the feedback. The implementation has been simplified to reuse the existing layout components. The custom grid and extra wrappers were removed, and only the required responsive column sizing changes remain. Final result
|
|
Hey @AnkitRewar11 could you add this as an agenda item in the meeting minutes for the websites meet on Monday, we could discuss it there? |
|
@Maanvi212006 @PARTH-TUSSLE Please take a look when you have some time. This PR has been ready for quite a while. Thank you! |









Description
This PR fixes #7807
This PR fixes two layout issues on the layer5.io/learn page where card sections were not displaying properly on desktop screens.
Issue 1: Learning Paths cards overflow
File:
src/sections/Learn/LearnPage-Sections/learning-path.jsThe three cards in this section did not have proper width settings for desktop screens, so they were overflowing the row and getting clipped on the sides.
Fix: Added the missing width settings (
$md,$lg,$xlprops) to theColcomponent so all three cards now fit properly within the row on all desktop screen sizes.Issue 2: Workshops cards collapse to 2 columns
File:
src/sections/Learn/LearnPage-Sections/workshops.jsThe workshop cards were missing width settings for some desktop screen sizes, and an existing CSS rule was forcing them into a 2-column layout. This pushed the third card off-screen.
Fix:
Colcomponent.Bonus fix: Cards were different sizes
While testing, I noticed the cards were also showing up in different sizes instead of being equal.
Fix: Removed a
margin: autorule that was causing uneven spacing, and made sure all card images use the same width and crop style so every card looks consistent.Testing
npm run build— build completed successfully with no errors.gatsby developon both desktop and mobile screen sizes. All cards now show up at equal sizes with even spacing, no overflow, and no unexpected column changes.Notes for Reviewers
Signed commits
Summary by CodeRabbit