layer5 icon indicating copy to clipboard operation
layer5 copied to clipboard

fix: resolve card overflow and layout issues in Learn page sections

Open AnkitRewar11 opened this issue 5 months ago • 3 comments

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.js

The 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, $xl props) to the Col component 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.js

The 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:

  • Added the missing width settings to the Col component.
  • Replaced the hardcoded card width value with a CSS variable, so it's easy to update later if the number of cards changes.

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: auto rule that was causing uneven spacing, and made sure all card images use the same width and crop style so every card looks consistent.

Testing

  • Ran npm run build — build completed successfully with no errors.
  • Tested locally with gatsby develop on 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

  • [x] Yes, I signed my commits.
Screenshot (458) Screenshot (457)

AnkitRewar11 avatar Jun 22 '26 01:06 AnkitRewar11

Preview deployment for PR #7813 removed.

This PR preview was automatically pruned because we keep only the 6 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.

github-actions[bot] avatar Jun 22 '26 01:06 github-actions[bot]

@Rajesh-Nagarajan-11

AnkitRewar11 avatar Jun 22 '26 09:06 AnkitRewar11

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.

Screenshot (505)

AnkitRewar11 avatar Jun 23 '26 10:06 AnkitRewar11

@Rajesh-Nagarajan-11 @Sbragul26

AnkitRewar11 avatar Jun 27 '26 10:06 AnkitRewar11

@AnkitRewar11, can you please push a new commit to generate a fresh preview.

kanishksingh23 avatar Jun 27 '26 15:06 kanishksingh23

@AnkitRewar11, can you please push a new commit to generate a fresh preview.

done

AnkitRewar11 avatar Jun 27 '26 17:06 AnkitRewar11

@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 :slightly_smiling_face:

Bhumikagarggg avatar Jun 28 '26 17:06 Bhumikagarggg

@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.

kanishksingh23 avatar Jul 01 '26 07:07 kanishksingh23

@AnkitRewar11, can you please push a new commit to generate a fresh preview. Also an essential check that supports deployment is failing,do look into it.

AasthathecoderX avatar Jul 13 '26 06:07 AasthathecoderX

@AnkitRewar11 , The overflow issue looks fixed. One minor observation: compared to the previous layout, the cards now occupy noticeably less horizontal space on larger desktop screens, leaving more empty space on the sides. Was this intentional? If not, we could consider slightly increasing the card width or adjusting the layout to make better use of the available space.

I have attached the screenshots of before and after for reference. Before: image

After: image

AasthathecoderX avatar Jul 13 '26 08:07 AasthathecoderX

@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.

Screenshot (619)

AnkitRewar11 avatar Jul 15 '26 08:07 AnkitRewar11