Skip to content

Commit

Permalink
ColorPicker: Replace hardcoded "blue" with theme color (#36153)
Browse files Browse the repository at this point in the history
* ColorPicker: Replace hardcoded "blue" with theme color

* Update changelog
  • Loading branch information
mirka committed Nov 19, 2021
1 parent d69d172 commit 070c722
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions packages/components/CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Bug Fix

- Replaced hardcoded blue in `ColorPicker` with UI theme color ([#36153](https://github.com/WordPress/gutenberg/pull/36153)).

### Experimental

- Reinstated the ability to pass additional props to the `ToolsPanel` ([36428](https://github.com/WordPress/gutenberg/pull/36428)).
Expand Down
5 changes: 3 additions & 2 deletions packages/components/src/color-picker/color-display.tsx
Expand Up @@ -18,6 +18,7 @@ import { Flex, FlexItem } from '../flex';
import { Tooltip } from '../ui/tooltip';
import type { ColorType } from './types';
import { space } from '../ui/utils/space';
import { COLORS } from '../utils/colors-values';

interface ColorDisplayProps {
color: Colord;
Expand All @@ -41,7 +42,7 @@ const ValueDisplay = ( { values }: ValueDisplayProps ) => (
{ values.map( ( [ value, abbreviation ] ) => {
return (
<FlexItem key={ abbreviation } isBlock display="flex">
<Text color="blue">{ abbreviation }</Text>
<Text color={ COLORS.ui.theme }>{ abbreviation }</Text>
<Text>{ value }</Text>
</FlexItem>
);
Expand Down Expand Up @@ -84,7 +85,7 @@ const HexDisplay = ( { color }: DisplayProps ) => {
const colorWithoutHash = color.toHex().slice( 1 ).toUpperCase();
return (
<FlexItem>
<Text color="blue">#</Text>
<Text color={ COLORS.ui.theme }>#</Text>
<Text>{ colorWithoutHash }</Text>
</FlexItem>
);
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/color-picker/hex-input.tsx
Expand Up @@ -15,6 +15,7 @@ import { Text } from '../text';
import { Spacer } from '../spacer';
import { space } from '../ui/utils/space';
import { ColorHexInputControl } from './styles';
import { COLORS } from '../utils/colors-values';

interface HexInputProps {
color: Colord;
Expand All @@ -35,7 +36,7 @@ export const HexInput = ( { color, onChange, enableAlpha }: HexInputProps ) => {
<Spacer
as={ Text }
marginLeft={ space( 3.5 ) }
color="blue"
color={ COLORS.ui.theme }
lineHeight={ 1 }
>
#
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/color-picker/input-with-slider.tsx
Expand Up @@ -6,6 +6,7 @@ import { Text } from '../text';
import { Spacer } from '../spacer';
import { space } from '../ui/utils/space';
import { RangeControl, NumberControlWrapper } from './styles';
import { COLORS } from '../utils/colors-values';

interface InputWithSliderProps {
min: number;
Expand Down Expand Up @@ -37,7 +38,7 @@ export const InputWithSlider = ( {
<Spacer
as={ Text }
paddingLeft={ space( 3.5 ) }
color="blue"
color={ COLORS.ui.theme }
lineHeight={ 1 }
>
{ abbreviation }
Expand Down

0 comments on commit 070c722

Please sign in to comment.