Skip to content

Commit 5dfd0e6

Browse files
Fix: Double border on palette editor. (#38035)
1 parent fdf4433 commit 5dfd0e6

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

packages/components/src/palette-edit/index.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import {
3939
import { NavigableMenu } from '../navigable-container';
4040
import { DEFAULT_GRADIENT } from '../custom-gradient-picker/constants';
4141
import CustomGradientPicker from '../custom-gradient-picker';
42-
import { COLORS } from '../utils';
4342

4443
const DEFAULT_COLOR = '#000';
4544

@@ -78,16 +77,16 @@ function Option( {
7877

7978
return (
8079
<PaletteItem
80+
className={ isEditing ? 'is-selected' : undefined }
8181
as="div"
8282
onClick={ onStartEditing }
8383
{ ...( isEditing
84-
? {
85-
...focusOutsideProps,
84+
? { ...focusOutsideProps }
85+
: {
8686
style: {
87-
border: `1px solid ${ COLORS.blue.wordpress[ 700 ] }`,
87+
cursor: 'pointer',
8888
},
89-
}
90-
: { style: { cursor: 'pointer' } } ) }
89+
} ) }
9190
>
9291
<HStack justify="flex-start">
9392
<FlexItem>
@@ -200,7 +199,7 @@ function PaletteEditListView( {
200199
}, [] );
201200
return (
202201
<VStack spacing={ 3 }>
203-
<ItemGroup isBordered isSeparated>
202+
<ItemGroup isRounded>
204203
{ elements.map( ( element, index ) => (
205204
<Option
206205
isGradient={ isGradient }

packages/components/src/palette-edit/styles.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { space } from '../ui/utils/space';
1313
import { COLORS, CONFIG } from '../utils';
1414
import { View } from '../view';
1515
import InputControl from '../input-control';
16-
import Item from '../item-group/item';
1716
import {
1817
Container as InputControlContainer,
1918
Input,
@@ -41,9 +40,26 @@ export const NameInputControl = styled( InputControl )`
4140
}
4241
`;
4342

44-
export const PaletteItem = styled( Item )`
43+
export const PaletteItem = styled( View )`
4544
padding: 3px 0 3px ${ space( 3 ) };
4645
height: calc( 40px - ${ CONFIG.borderWidth } );
46+
border: 1px solid ${ CONFIG.surfaceBorderColor };
47+
border-bottom-color: transparent;
48+
&:first-of-type {
49+
border-top-left-radius: ${ CONFIG.controlBorderRadius };
50+
border-top-right-radius: ${ CONFIG.controlBorderRadius };
51+
}
52+
&:last-of-type {
53+
border-bottom-left-radius: ${ CONFIG.controlBorderRadius };
54+
border-bottom-right-radius: ${ CONFIG.controlBorderRadius };
55+
border-bottom-color: ${ CONFIG.surfaceBorderColor };
56+
}
57+
&.is-selected + & {
58+
border-top-color: transparent;
59+
}
60+
&.is-selected {
61+
border-color: ${ COLORS.blue.wordpress[ 700 ] };
62+
}
4763
`;
4864

4965
export const NameContainer = styled.div`

0 commit comments

Comments
 (0)