Skip to content

fix: blog list view card layout and image styling#7734

Merged
Rajesh-Nagarajan-11 merged 3 commits into
layer5io:masterfrom
rishiraj38:fix-blog-list-view
May 20, 2026
Merged

fix: blog list view card layout and image styling#7734
Rajesh-Nagarajan-11 merged 3 commits into
layer5io:masterfrom
rishiraj38:fix-blog-list-view

Conversation

@rishiraj38
Copy link
Copy Markdown
Member

@rishiraj38 rishiraj38 commented May 15, 2026

Description

This PR fixes Blog list view.

Notes for Reviewers

Root cause: The Card component (Card.style.js) has flex-direction: column and min-height: 23rem hardcoded on .post-block. The BlogList wrapper tried to override these from the parent, but it couldn't win because styled-components scopes the Card's styles with a unique class, so the Card's own column layout always takes priority over the parent's overrides.

Signed commits

  • Yes, I signed my commits.

@rishiraj38 rishiraj38 marked this pull request as draft May 15, 2026 04:50
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 15, 2026

PR Preview Action v1.6.3
Preview removed because the pull request was closed.
2026-05-20 15:38 UTC

@rishiraj38 rishiraj38 force-pushed the fix-blog-list-view branch from fb1f811 to 786da99 Compare May 15, 2026 05:25
@rishiraj38 rishiraj38 marked this pull request as ready for review May 15, 2026 06:04
@rishiraj38
Copy link
Copy Markdown
Member Author

rishiraj38 commented May 15, 2026

Before

  • Announcement Page

    Screenshot 2026-05-15 at 9 08 18 PM
  • Blog Page in List View

    Screenshot 2026-05-15 at 9 08 55 PM

After

  • Announcement Page

    Screenshot 2026-05-15 at 9 07 42 PM
  • Blog Page in List View

    Screenshot 2026-05-15 at 9 09 31 PM

@rishiraj38 rishiraj38 force-pushed the fix-blog-list-view branch from 786da99 to 2425534 Compare May 15, 2026 16:08

.gatsby-image-wrapper img,
.old-gatsby-image-wrapper img {
object-fit: contain !important;
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.

@rishiraj38 Please don't use !important, try to find root cause.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The Card component hardcodes flex-direction: column in its own styled-component (CardWrapper). The BlogList wrapper's CSS can't override it because styled-components' scoped class has equal/higher specificity. Fix: pass a listView prop to Card so it conditionally renders flex-direction: row from within its own styles.

Signed-off-by: Rishi Raj <rishiraj438gt@gmail.com>
@rishiraj38 rishiraj38 force-pushed the fix-blog-list-view branch from f708838 to 4e89ee3 Compare May 17, 2026 11:47
@rishiraj38 rishiraj38 marked this pull request as draft May 17, 2026 11:47
@rishiraj38 rishiraj38 marked this pull request as ready for review May 17, 2026 12:16
@Bhumikagarggg
Copy link
Copy Markdown
Contributor

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

@rishiraj38
Copy link
Copy Markdown
Member Author

@Rajesh-Nagarajan-11 I think my voice wasn't clear, so here’s the main Crux:

The Card component hardcodes flex-direction: column inside its own styled-component (CardWrapper). Because of styled-components scoping and specificity, the CSS from the BlogList wrapper cannot reliably override those styles.

The fix is to pass a listView prop to the Card component and conditionally applyflex-direction: rowdirectly inside CardWrapper itself.

Also, the CSS removed from blogList.style.js was mainly added to override the CardWrapper styles for list view rendering. Since list view handling now exists directly inside the Card component, those overrides are no longer needed.

@rishiraj38
Copy link
Copy Markdown
Member Author

@Rajesh-Nagarajan-11, any more changes required?

@Rajesh-Nagarajan-11 Rajesh-Nagarajan-11 merged commit d18e0ea into layer5io:master May 20, 2026
3 of 4 checks passed
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.

4 participants