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

Global Styles: Fix black inconsistencies in sidebar #40055

Merged
merged 9 commits into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from 6 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
1 change: 1 addition & 0 deletions packages/components/src/item-group/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const item = css`
width: 100%;
display: block;
margin: 0;
color: inherit;
`;

export const bordered = css`
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/surface/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CONFIG, COLORS } from '../utils';

export const Surface = css`
background-color: ${ CONFIG.surfaceColor };
color: ${ COLORS.black };
color: ${ COLORS.darkGray.primary };
position: relative;
`;

Expand Down
9 changes: 2 additions & 7 deletions packages/edit-site/src/components/global-styles/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
__experimentalView as View,
} from '@wordpress/components';
import { isRTL, __ } from '@wordpress/i18n';
import { chevronRight, chevronLeft, Icon } from '@wordpress/icons';
import { chevronRight, chevronLeft } from '@wordpress/icons';

/**
* Internal dependencies
Expand All @@ -22,12 +22,7 @@ function ScreenHeader( { title, description } ) {
<HStack spacing={ 2 }>
<View>
<NavigationBackButton
icon={
<Icon
mirka marked this conversation as resolved.
Show resolved Hide resolved
icon={ isRTL() ? chevronRight : chevronLeft }
variant="muted"
mirka marked this conversation as resolved.
Show resolved Hide resolved
/>
}
icon={ isRTL() ? chevronRight : chevronLeft }
size="small"
aria-label={ __( 'Navigate to the previous view' ) }
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* External dependencies
*/
import classnames from 'classnames';

/**
* WordPress dependencies
*/
import { Icon } from '@wordpress/components';

export function IconWithCurrentColor( { className, ...props } ) {
mirka marked this conversation as resolved.
Show resolved Hide resolved
return (
<Icon
className={ classnames(
className,
'edit-site-global-styles-icon-with-current-color'
) }
{ ...props }
/>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ import {
FlexItem,
__experimentalHStack as HStack,
} from '@wordpress/components';
import { Icon } from '@wordpress/icons';

/**
* Internal dependencies
*/
import { IconWithCurrentColor } from './icon-with-current-color';

function GenericNavigationButton( { icon, children, ...props } ) {
return (
<Item { ...props }>
{ icon && (
<HStack justify="flex-start">
<FlexItem>
<Icon icon={ icon } size={ 24 } />
<IconWithCurrentColor icon={ icon } size={ 24 } />
</FlexItem>
<FlexItem>{ children }</FlexItem>
</HStack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ import {
CardMedia,
} from '@wordpress/components';
import { isRTL, __ } from '@wordpress/i18n';
import { chevronLeft, chevronRight, Icon } from '@wordpress/icons';
import { chevronLeft, chevronRight } from '@wordpress/icons';
import { useSelect } from '@wordpress/data';
import { store as coreStore } from '@wordpress/core-data';

/**
* Internal dependencies
*/
import { IconWithCurrentColor } from './icon-with-current-color';
import { NavigationButton } from './navigation-button';
import ContextMenu from './context-menu';
import StylesPreview from './preview';
Expand Down Expand Up @@ -47,7 +48,7 @@ function ScreenRoot() {
<HStack justify="space-between">
<FlexItem>{ __( 'Browse styles' ) }</FlexItem>
<FlexItem>
<Icon
<IconWithCurrentColor
icon={
isRTL() ? chevronLeft : chevronRight
}
Expand Down Expand Up @@ -76,7 +77,7 @@ function ScreenRoot() {
<HStack justify="space-between">
<FlexItem>{ __( 'Blocks' ) }</FlexItem>
<FlexItem>
<Icon
<IconWithCurrentColor
icon={
isRTL() ? chevronLeft : chevronRight
}
Expand Down
3 changes: 3 additions & 0 deletions packages/edit-site/src/components/global-styles/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,6 @@
}
}

.edit-site-global-styles-icon-with-current-color {
fill: currentColor;
}
2 changes: 1 addition & 1 deletion packages/edit-site/src/components/sidebar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
padding: 0 $grid-unit-10;
height: $grid-unit-30;
border-radius: $radius-block-ui;
background-color: $black;
background-color: $gray-900;
color: $white;
align-items: center;
font-size: $helptext-font-size;
Expand Down