Skip to content

Commit

Permalink
Tweak border control button to proper metrics and simpler action (#53998
Browse files Browse the repository at this point in the history
)

* Fix button styles to updated metrics

* Simplify button text

* Update CHANGELOG.md

* Use proper border top color

* Fix tests
  • Loading branch information
richtabor authored Sep 12, 2023
1 parent 71f75e7 commit d27d9d5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!-- Learn how to maintain this file at https://github.com/WordPress/gutenberg/tree/HEAD/packages#maintaining-changelogs. -->

## Unreleased
- `BorderControl`: Apply proper metrics and simpler text ([#53998](https://github.com/WordPress/gutenberg/pull/53998)).

### Enhancements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ const BorderControlDropdown = (
onClose();
} }
>
{ __( 'Reset to default' ) }
{ __( 'Reset' ) }
</Button>
</DropdownContentWrapper>
) }
Expand Down
12 changes: 6 additions & 6 deletions packages/components/src/border-control/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ export const resetButton = css`
/* Override button component styling */
&& {
border-top: ${ CONFIG.borderWidth } solid ${ COLORS.gray[ 200 ] };
border-top: ${ CONFIG.borderWidth } solid ${ COLORS.gray[ 400 ] };
border-top-left-radius: 0;
border-top-right-radius: 0;
height: 46px;
height: 40px;
}
`;

Expand All @@ -180,10 +180,10 @@ export const borderControlStylePicker = css`

export const borderStyleButton = css`
&&&&& {
min-width: 30px;
width: 30px;
height: 30px;
padding: 3px;
min-width: 32px;
width: 32px;
height: 32px;
padding: 4px;
}
`;

Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/border-control/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ describe( 'BorderControl', () => {
const solidButton = getButton( 'Solid' );
const dashedButton = getButton( 'Dashed' );
const dottedButton = getButton( 'Dotted' );
const resetButton = getButton( 'Reset to default' );
const resetButton = getButton( 'Reset' );

expect( customColorPicker ).toBeInTheDocument();
expect( colorSwatchButtons.length ).toEqual( colors.length );
Expand Down Expand Up @@ -359,7 +359,7 @@ describe( 'BorderControl', () => {
const props = createProps();
render( <BorderControl { ...props } /> );
await openPopover( user );
await user.click( getButton( 'Reset to default' ) );
await user.click( getButton( 'Reset' ) );

expect( props.onChange ).toHaveBeenNthCalledWith( 1, {
color: undefined,
Expand Down

1 comment on commit d27d9d5

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in d27d9d5.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6162325846
📝 Reported issues:

Please sign in to comment.