-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Fix horizontal .list-group-flush
borders.
#39513
base: main
Are you sure you want to change the base?
Conversation
239da0e
to
2095f21
Compare
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.
I really like the implementation.
Just a quick fix to do and a proposal for the documentation.
Thanks for your suggestions. I've updated the PR, could, you, take a look, please? |
scss/_list-group.scss
Outdated
// Horizontal flush list items | ||
// | ||
// Remove borders and border-radius to keep horizontal list group items edge-to-edge. Most | ||
// useful within other components (e.g., cards). | ||
@each $breakpoint in map-keys($grid-breakpoints) { | ||
@include media-breakpoint-up($breakpoint) { | ||
$infix: breakpoint-infix($breakpoint, $grid-breakpoints); | ||
|
||
.list-group-flush.list-group-horizontal#{$infix} { | ||
|
||
> .list-group-item { | ||
border-width: 0 var(--#{$prefix}list-group-border-width) 0 0; | ||
|
||
&:last-child { | ||
border-right-width: 0; | ||
} | ||
} | ||
} | ||
} | ||
} |
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.
Could this all be handled in the same grid map-keys function as .list-group-horizontal
?
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.
Could this all be handled in the same grid map-keys function as
.list-group-horizontal
?
Sure.
I didn't want to mix them on purpose, but if you think it would be preferable, no problem. I've updated the PR. Take a look, please.
@mdo |
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.
Thanks for this PR @WOLFRIEND!
I might have found an edge case with the following code:
<div class="list-group list-group-flush list-group-horizontal">
<a href="#" class="list-group-item list-group-item-action">
The current link item
</a>
<a href="#" class="list-group-item list-group-item-action">A second link item</a>
<a href="#" class="list-group-item list-group-item-action">A third link item</a>
<a href="#" class="list-group-item list-group-item-action">A fourth link item</a>
<a class="list-group-item list-group-item-action disabled" aria-disabled="true">A disabled link item</a>
</div>
The basic rendering works perfectly, but the top-left border radius should be rounded when the list group item is focused and hovered. Here is an animation showing the issue:
@WOLFRIEND do you think this could be handled in this PR?
Thanks. I'll take a look and let you know asap, am I able to fix it. |
Hi. |
Description
According to the documentation:
So, when using
.list-group-flush
and.list-group-horizontal
on the same list group, we got redundant borders.Detailed description and reduced test cases could be found at #39150.
Fixes #39150.
Type of changes
Checklist
npm run lint
)Live previews
Related issues
#39150