Skip to content
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

ColorPicker: Update sizes of format select and copy button #67093

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
- `ToggleGroupControl`: Fix active background for `0` value ([#66855](https://github.com/WordPress/gutenberg/pull/66855)).
- `SlotFill`: Fix a bug where a stale value of `fillProps` could be used ([#67000](https://github.com/WordPress/gutenberg/pull/67000)).

### Enhancements

- `ColorPicker`: Update sizes of color format select and copy button ([#67093](https://github.com/WordPress/gutenberg/pull/67093)).

### Experimental

- `SlotFill`: Remove registration API methods from return value of `__experimentalUseSlot` ([#67070](https://github.com/WordPress/gutenberg/pull/67070)).
Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/color-picker/color-copy-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
*/
import { CopyButton } from './styles';
import { Button } from '../button';
import Tooltip from '../tooltip';

import type { ColorCopyButtonProps } from './types';
Expand Down Expand Up @@ -63,8 +63,8 @@ export const ColorCopyButton = ( props: ColorCopyButtonProps ) => {
copiedColor === color.toHex() ? __( 'Copied!' ) : __( 'Copy' )
}
>
<CopyButton
size="small"
<Button
Copy link
Member Author

Choose a reason for hiding this comment

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

🚨 Unlabeled button alert, fix proposed in #67094.

size="compact"
ref={ copyRef }
icon={ copy }
showTooltip={ false }
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/color-picker/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const UnconnectedColorPicker = (
<AuxiliaryColorArtefactHStackHeader justify="space-between">
<SelectControl
__nextHasNoMarginBottom
size="compact"
options={ options }
value={ colorType }
onChange={ ( nextColorType ) =>
Expand Down
13 changes: 0 additions & 13 deletions packages/components/src/color-picker/styles.ts
Copy link
Member Author

Choose a reason for hiding this comment

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

Removing these button styles since they are no longer needed.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import InnerSelectControl from '../select-control';
import InnerRangeControl from '../range-control';
import { space } from '../utils/space';
import { boxSizingReset } from '../utils';
import Button from '../button';
import { Flex } from '../flex';
import { HStack } from '../h-stack';
import CONFIG from '../utils/config-values';
Expand All @@ -22,7 +21,6 @@ export const NumberControlWrapper = styled( NumberControl )`

export const SelectControl = styled( InnerSelectControl )`
margin-left: ${ space( -2 ) };
width: 5em;
`;

export const RangeControl = styled( InnerRangeControl )`
Expand Down Expand Up @@ -101,14 +99,3 @@ export const ColorfulWrapper = styled.div`

${ interactiveHueStyles }
`;

export const CopyButton = styled( Button )`
&&&&& {
min-width: ${ space( 6 ) };
padding: 0;

> svg {
margin-right: 0;
}
}
`;
Loading