-
Notifications
You must be signed in to change notification settings - Fork 1.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
[BulkActions] Add theming to BulkAction and remove custom ButtonGroup from ResourceList #2467
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,23 +6,6 @@ $bulk-actions-button-stacking-order: ( | |
); | ||
$bulk-actions-offset-slide-in-start: rem(-40px); | ||
|
||
.Button { | ||
@include text-style-button; | ||
@include button-base; | ||
|
||
&:not(:first-child) { | ||
margin-left: -1px; | ||
} | ||
|
||
.Group-measuring & { | ||
font-size: font-size(button); | ||
} | ||
|
||
.disabled & { | ||
@include base-button-disabled; | ||
} | ||
} | ||
|
||
.Group { | ||
@include text-style-input; | ||
width: 100%; | ||
|
@@ -79,14 +62,17 @@ $bulk-actions-offset-slide-in-start: rem(-40px); | |
} | ||
} | ||
|
||
.ButtonGroup { | ||
display: flex; | ||
align-items: center; | ||
.ButtonGroupWrapper { | ||
width: 100%; | ||
flex-wrap: nowrap; | ||
justify-content: flex-end; | ||
box-shadow: inset 0 0 0 1px color('sky', 'dark'); | ||
border-radius: border-radius(); | ||
max-width: 100%; | ||
|
||
// We need the first item of button group on small screen to fill the space | ||
@include breakpoint-before(resource-list(breakpoint-small)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Our We toyed with the idea of adding a prop to ButtonGroup which was confusing and this being the only use case where we have seen this we decided to move forward with this approach. We added a test to ensure that if ever there's mark-up change, this will be flagged. This is the trade-off of being able the use |
||
// stylelint-disable-next-line selector-max-specificity, selector-max-class, selector-max-combinators, selector-max-type | ||
> div > div:first-child { | ||
flex: 1 1 auto; | ||
} | ||
} | ||
|
||
@include breakpoint-after(resource-list(breakpoint-small)) { | ||
width: auto; | ||
|
@@ -98,71 +84,16 @@ $bulk-actions-offset-slide-in-start: rem(-40px); | |
position: absolute; | ||
width: auto; | ||
} | ||
} | ||
|
||
.Button { | ||
border-radius: 0; | ||
white-space: nowrap; | ||
|
||
&:focus { | ||
z-index: z-index(focused, $bulk-actions-button-stacking-order); | ||
} | ||
|
||
// stylelint-disable-next-line selector-max-specificity | ||
&:last-child:not(:first-child) { | ||
border-radius: 0 border-radius() border-radius() 0; | ||
} | ||
} | ||
|
||
.Button-cancel { | ||
z-index: 0; | ||
flex: 0 0 auto; | ||
margin-left: -1px; | ||
border-radius: 0 border-radius() border-radius() 0; | ||
|
||
&:focus { | ||
z-index: 1; | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔥 |
||
.BulkActionButton { | ||
white-space: nowrap; | ||
} | ||
|
||
.CheckableContainer { | ||
flex: 1 1 0; | ||
} | ||
|
||
.Popover { | ||
max-height: resource-list(button-min-height); | ||
margin-left: -1px; | ||
|
||
&:last-child * { | ||
border-radius: 0 border-radius() border-radius() 0; | ||
} | ||
} | ||
|
||
.ActionContent { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.ActionIcon { | ||
@include recolor-icon(color('ink', 'lighter')); | ||
display: inline-block; | ||
|
||
&:first-child { | ||
margin-right: spacing(extra-tight); | ||
} | ||
|
||
&:last-child { | ||
// This compensates for the disclosure icon, which is substantially | ||
// inset within the viewbox (and makes it look like there is too much | ||
// spacing on the right of the button) | ||
margin-right: -1 * spacing(tight); | ||
} | ||
|
||
&.disabled { | ||
@include recolor-icon(color('ink', 'lightest')); | ||
} | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❤️ |
||
.disabled { | ||
@include base-button-disabled; | ||
cursor: default; | ||
|
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.
❤️