From 070c722db18a8a1616566bde8f4a332b91205888 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Sat, 20 Nov 2021 01:47:47 +0900 Subject: [PATCH] ColorPicker: Replace hardcoded "blue" with theme color (#36153) * ColorPicker: Replace hardcoded "blue" with theme color * Update changelog --- packages/components/CHANGELOG.md | 4 ++++ packages/components/src/color-picker/color-display.tsx | 5 +++-- packages/components/src/color-picker/hex-input.tsx | 3 ++- packages/components/src/color-picker/input-with-slider.tsx | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 277a65c575e84..5a49f9e06b41a 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -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)). diff --git a/packages/components/src/color-picker/color-display.tsx b/packages/components/src/color-picker/color-display.tsx index 751858436767c..be78b948b1e89 100644 --- a/packages/components/src/color-picker/color-display.tsx +++ b/packages/components/src/color-picker/color-display.tsx @@ -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; @@ -41,7 +42,7 @@ const ValueDisplay = ( { values }: ValueDisplayProps ) => ( { values.map( ( [ value, abbreviation ] ) => { return ( - { abbreviation } + { abbreviation } { value } ); @@ -84,7 +85,7 @@ const HexDisplay = ( { color }: DisplayProps ) => { const colorWithoutHash = color.toHex().slice( 1 ).toUpperCase(); return ( - # + # { colorWithoutHash } ); diff --git a/packages/components/src/color-picker/hex-input.tsx b/packages/components/src/color-picker/hex-input.tsx index c17d8866fc02f..f79ce4f3f2b31 100644 --- a/packages/components/src/color-picker/hex-input.tsx +++ b/packages/components/src/color-picker/hex-input.tsx @@ -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; @@ -35,7 +36,7 @@ export const HexInput = ( { color, onChange, enableAlpha }: HexInputProps ) => { # diff --git a/packages/components/src/color-picker/input-with-slider.tsx b/packages/components/src/color-picker/input-with-slider.tsx index a38f600a8bf63..fb45238ec5016 100644 --- a/packages/components/src/color-picker/input-with-slider.tsx +++ b/packages/components/src/color-picker/input-with-slider.tsx @@ -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; @@ -37,7 +38,7 @@ export const InputWithSlider = ( { { abbreviation }