-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 border overlap between Buttons in outlined ButtonGroup #6966
Conversation
Generate changelog in
|
7b20efb
to
7066a7f
Compare
Fix overlapping borders between buttons in outlined button groupBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
> .#{$ns}-button { | ||
.#{$ns}-button { |
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.
We likely need to keep the child combinator here, otherwise a button inside an inline overlay within the button group would be affected by these styles. We'll need to be specific for popovers, similar to L100-L112 above.
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.
Hm, good point. I'd neglected to test for inline overlays since it's a bit more involved to set up an example for those. Does this same issue not apply to the &.#{$ns}-minimal, &.#{$ns}-outlined
selector above also?
blueprint/packages/core/src/components/button/_button-group.scss
Lines 121 to 122 in 1038d7f
&.#{$ns}-minimal, &.#{$ns}-outlined { | |
.#{$ns}-button { |
Added back child combinator and selected for popovers here: 84f92db
@include pt-button-outlined(); | ||
} | ||
|
||
&:not(.#{$ns}-vertical) { | ||
> .#{$ns}-popover-target:not(:last-child) .#{$ns}-button, |
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.
same
&:not(.#{$ns}-vertical) { | ||
> .#{$ns}-popover-target:not(:last-child) .#{$ns}-button.#{$ns}-outlined, | ||
> .#{$ns}-button.#{$ns}-outlined:not(:last-child) { | ||
border-right: none; | ||
} | ||
} |
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.
Do we need this for vertical button groups too (with border-bottom)?
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.
Ah, good catch! Added in 79e3441
Handle vertical button groups with outlined button childrenBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Keep child combinator, explicitly select for popover target childrenBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
} | ||
|
||
&:not(.#{$ns}-outlined) { | ||
> .#{$ns}-popover-target:not(:last-child) .#{$ns}-button:not(.#{$ns}-outlined) { |
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.
There seems to be a lot of duplicate (or at least similar) styles for popovers here and in the other file. We should probably consolidate them and also merge the selectors for popover-target and popover-wrapper, since they should likely apply the exact same styles (the latter only existing for back-compat anyway).
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.
Yeah, I noticed this as well, but was hesitant to tackle reorganizing those styles in this PR since it's a more involved change. I'm also not super familiar with the historical use of the popover-wrapper class, so that also made the prospect of that change seem more brittle to me.
Happy to address cleaning these up though. Would you recommend this PR or a FLUP?
Fixes #0000
Checklist
Changes proposed in this pull request:
Fixes an issue where outlined button styles were not rendering properly when wrapped in a Popover inside of ButtonGroup. Also adds an
outlined
variant prop example to the "Usage with popovers" ButtonGroup example to allow for visual testing of this issue in the future.New
outlined
prop toggle on ButtonGroup's "Usage with popovers" example.This change fixes borders on outlined buttons with popovers in two instances:
outlined
prop is applied to theButtonGroup
parent container:In this case, buttons surrounded by popovers weren't being styled as outlined at all. The
.bp5-popover-target
class breaks the selector applying the outlined styling.outlined
prop is applied to the individual buttons within the groupIn this case, the outline styles render, but there is a slight overlap between the intermediate borders of the button group. This overlap is noticeable due to the semi-transparent styling of the borders on outlined buttons.
Reviewers should focus on: