Skip to content

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

Open
AnkitRewar11 wants to merge 6 commits into
layer5io:masterfrom
AnkitRewar11:fix/learn-page-card-layout
Open

fix: resolve card overflow and layout issues in Learn page sections#7813
AnkitRewar11 wants to merge 6 commits into
layer5io:masterfrom
AnkitRewar11:fix/learn-page-card-layout

Conversation

@AnkitRewar11

@AnkitRewar11 AnkitRewar11 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

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

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

Signed-off-by: ankitrewar11 <ankitrewar11@gmail.com>
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview deployment: https://layer5.io/pr-preview/pr-7813/

Note: Preview may take a moment (GitHub Pages deployment in progress). Please wait and refresh. Track deployment here

@AnkitRewar11

Copy link
Copy Markdown
Contributor Author

@Rajesh-Nagarajan-11

@Sbragul26 Sbragul26 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is not responsive on mobile. Some content is getting cut off. Could you please make it responsive for smaller screens?

Preview

Image

…shop cards

Signed-off-by: ankitrewar11 <ankitrewar11@gmail.com>
@AnkitRewar11

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor Author

@kanishksingh23

Copy link
Copy Markdown
Contributor

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

@AnkitRewar11

AnkitRewar11 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

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

done

ankitrewar11 added 2 commits June 27, 2026 23:01
@AnkitRewar11 AnkitRewar11 requested a review from Sbragul26 June 27, 2026 17:55
@Bhumikagarggg

Copy link
Copy Markdown
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Layout issues in Learning Paths and Workshops card sections on desktop (layer5.io/learn)

5 participants