Skip to content

Commit

Permalink
ColorPicker: Update sizes of format select and copy button (#67093)
Browse files Browse the repository at this point in the history
* ColorPicker: Update sizes of format select and copy button

* Add changelog

Co-authored-by: mirka <[email protected]>
Co-authored-by: tyxla <[email protected]>
  • Loading branch information
3 people authored Nov 19, 2024
1 parent c43a0c9 commit d478c08
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
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
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
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;
}
}
`;

0 comments on commit d478c08

Please sign in to comment.