-
Notifications
You must be signed in to change notification settings - Fork 934
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
USWDS - Card: Fix header first media overlap #5423
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.
This makes sense to me. Thanks for the fix!
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.
Looks good. Tested header first with media exdent on both regular and flag variants.
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.
Nice!
Summary
Fixed a margin bug on header-first variants that caused exdent card media to overlap headers.
Breaking change
This is not a breaking change.
Related issue
Closes #5401
Related pull requests
Changelog →
Preview link
Preview link:
Demo repo →
Card component →
Problem statement
When header first variants for card components have large borders, the media overlaps the header. This is caused due to exdent styles setting a negative top margin to counteract the border. Because header-first variants will always have the media after the header, we should remove the negative top margin for this variant.
Solution
Specify
0top margin on exdent media within header-first variants.Testing and review
usa-card__media--exdentclasstop-margin: 0.$theme-card-border-widthin settings to various values and confirm header is always visibleTesting checklist
Media on header-first cards should never have negative marginScreenshots
Screenshots
Before
After