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

Components: Retire LIGHT_GRAY color object #43994

Merged
merged 5 commits into from
Sep 12, 2022
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
3 changes: 3 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
- `SearchControl`: Add `__nextHasNoMargin` prop for opting into the new margin-free styles ([#43871](https://github.com/WordPress/gutenberg/pull/43871)).
- `CardHeader`, `CardBody`, `CardFooter`: Tweak `isShady` background colors to be consistent with the grays in `@wordpress/base-styles` ([#43719](https://github.com/WordPress/gutenberg/pull/43719)).
- `InputControl`, `SelectControl`: Tweak `disabled` colors to be consistent with the grays in `@wordpress/base-styles` ([#43719](https://github.com/WordPress/gutenberg/pull/43719)).
- `FocalPointPicker`: Tweak media placeholder background color to be consistent with the grays in `@wordpress/base-styles` ([#43994](https://github.com/WordPress/gutenberg/pull/43994)).
- `RangeControl`: Tweak rail, track, and mark colors to be consistent with the grays in `@wordpress/base-styles` ([#43994](https://github.com/WordPress/gutenberg/pull/43994)).
- `UnitControl`: Tweak unit dropdown hover color to be consistent with the grays in `@wordpress/base-styles` ([#43994](https://github.com/WordPress/gutenberg/pull/43994)).
- `Popover`: stabilize `__unstableShift` to `shift` ([#43845](https://github.com/WordPress/gutenberg/pull/43845)).

### Internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const Row = styled.div`

const pointActive = ( { isActive } ) => {
const boxShadow = isActive ? `0 0 0 2px ${ COLORS.gray[ 900 ] }` : null;
const pointColor = isActive ? COLORS.gray[ 900 ] : COLORS.lightGray[ 800 ];
const pointColor = isActive ? COLORS.gray[ 900 ] : COLORS.gray[ 400 ];
const pointColorHover = isActive ? COLORS.gray[ 900 ] : COLORS.ui.theme;

return css`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const MediaContainer = styled.div`
`;

export const MediaPlaceholder = styled.div`
background: ${ COLORS.lightGray[ 300 ] };
background: ${ COLORS.gray[ 100 ] };
box-sizing: border-box;
height: ${ INITIAL_BOUNDS.height }px;
max-width: 280px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ const railBackgroundColor = ( { disabled, railColor }: RailProps ) => {
let background = railColor || '';

if ( disabled ) {
background = COLORS.lightGray[ 400 ];
background = COLORS.ui.backgroundDisabled;
}

return css( { background } );
};

export const Rail = styled.span`
background-color: ${ COLORS.lightGray[ 600 ] };
background-color: ${ COLORS.gray[ 300 ] };
left: 0;
pointer-events: none;
right: 0;
Expand All @@ -101,7 +101,7 @@ const trackBackgroundColor = ( { disabled, trackColor }: TrackProps ) => {
let background = trackColor || 'currentColor';

if ( disabled ) {
background = COLORS.lightGray[ 800 ];
background = COLORS.gray[ 400 ];
}

return css( { background } );
Expand Down Expand Up @@ -129,10 +129,10 @@ export const MarksWrapper = styled.span`
`;

const markFill = ( { disabled, isFilled }: RangeMarkProps ) => {
let backgroundColor = isFilled ? 'currentColor' : COLORS.lightGray[ 600 ];
let backgroundColor = isFilled ? 'currentColor' : COLORS.gray[ 300 ];

if ( disabled ) {
backgroundColor = COLORS.lightGray[ 800 ];
backgroundColor = COLORS.gray[ 400 ];
}

return css( {
Expand All @@ -152,12 +152,12 @@ export const Mark = styled.span`

const markLabelFill = ( { isFilled }: RangeMarkProps ) => {
return css( {
color: isFilled ? COLORS.gray[ 700 ] : COLORS.lightGray[ 600 ],
color: isFilled ? COLORS.gray[ 700 ] : COLORS.gray[ 300 ],
} );
};

export const MarkLabel = styled.span`
color: ${ COLORS.lightGray[ 600 ] };
color: ${ COLORS.gray[ 300 ] };
left: 0;
font-size: 11px;
position: absolute;
Expand All @@ -171,7 +171,7 @@ export const MarkLabel = styled.span`
const thumbColor = ( { disabled }: ThumbProps ) =>
disabled
? css`
background-color: ${ COLORS.lightGray[ 800 ] };
background-color: ${ COLORS.gray[ 400 ] };
`
: css`
background-color: var( --wp-admin-theme-color );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const unitSelectSizes = ( { selectSize = 'default' }: SelectProps ) => {
${ rtl( { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 } )() }

&:not(:disabled):hover {
background-color: ${ COLORS.lightGray[ 300 ] };
background-color: ${ COLORS.gray[ 100 ] };
}

&:focus {
Expand Down
12 changes: 0 additions & 12 deletions packages/components/src/utils/colors-values.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ const GRAY = {
100: '#f0f0f0',
};

// TODO: Replace usages of these with the equivalents in `GRAY`
const LIGHT_GRAY = {
800: '#b5bcc2',
600: '#d7dade',
400: '#e8eaeb', // Good for "readonly" input fields and special text selection.
300: '#edeff0',
};

// Matches @wordpress/base-styles
const ALERT = {
yellow: '#f0b849',
Expand Down Expand Up @@ -64,10 +56,6 @@ export const COLORS = Object.freeze( {
* The main gray color object.
*/
gray: GRAY,
/**
* @deprecated Try to use `gray` instead.
*/
lightGray: LIGHT_GRAY,
white,
alert: ALERT,
ui: UI,
Expand Down