-
Notifications
You must be signed in to change notification settings - Fork 203
[IRN-6177] [BpkCardList] Fix issue with carousel alignment #4004
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
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 fixes carousel alignment issues in BpkCardList when using row-to-rail mode. The changes address problems with drop shadows being cut off, incorrect card widths, and container edge positioning.
- Simplified the flex-basis calculation for mobile breakpoints
- Added specific styling for row mode with negative margins and proper flex-basis calculations
- Maintained existing rail mode behavior without the alignment fixes
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| ) / | ||
| max(1, (var(--initially-shown-cards, 3) - 0.8)) | ||
| ); | ||
| flex-basis: calc( |
Copilot
AI
Oct 8, 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 flex-basis calculation is incomplete. The original code had flex: 0 0 followed by the calc() expression, but now only flex-basis is specified without the flex-grow and flex-shrink values. This could affect the layout behavior.
| flex-basis: calc( | |
| flex: 0 0 calc( |
| } | ||
|
|
||
| &__row { | ||
| margin-inline: -1 * tokens.bpk-spacing-md(); |
Copilot
AI
Oct 8, 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 multiplication should use proper SCSS syntax. Use calc(-1 * #{tokens.bpk-spacing-md()}) or -#{tokens.bpk-spacing-md()} instead of the current expression.
| margin-inline: -1 * tokens.bpk-spacing-md(); | |
| margin-inline: -#{tokens.bpk-spacing-md()}; |
|
Visit https://backpack.github.io/storybook-prs/4004 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4004 to see this build running in a browser. |
Hey Jimmy cook (@jimmycook) Can you explain this more? I think we can also fix this on mobile and I tested locally it works well, I also raised a commit to change that. Storybook is here https://backpack.github.io/storybook-prs/4004/?path=/story/bpk-component-card-list--row-to-rail Can you have a look if it works? If it works, we can approve and merge it. Otherwise, I'll revert that commit. |
|
Visit https://backpack.github.io/storybook-prs/4004 to see this build running in a browser. |
Good suggestion but I think we have a problem |
|
Visit https://backpack.github.io/storybook-prs/4004 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4004 to see this build running in a browser. |

This change is to address the issues with alignment when using row to rail.
There are a few concerns:
This change fixes is by when we are in the row state, we can have negative margin equal to the padding on the cards, and adjust the flex basis of the cards to fill the space correctly.
Because of the peaking on the cards, we set


margin-inline-endbe 0 and in this way, both right and left spacing are not changed and still keep as 1 rem on mobileRemember to include the following changes:
[Clover-123][BpkButton] Updating the colourREADME.md(If you have created a new component)README.md