Skip to content

Commit

Permalink
block-colors-selector: add contrast checker
Browse files Browse the repository at this point in the history
  • Loading branch information
retrofox committed Oct 14, 2019
1 parent fa89cff commit 9e00d5b
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import classnames from 'classnames';
import { IconButton, Dropdown, Toolbar } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { DOWN } from '@wordpress/keycodes';
import { ColorPaletteControl } from '@wordpress/block-editor';
import { ColorPaletteControl, ContrastChecker } from '@wordpress/block-editor';

/**
* Color Selector Icon component.
Expand Down Expand Up @@ -73,6 +73,14 @@ const renderContent = ( { backgroundColor, textColor, setBackgroundColor, setTex
label={ __( 'Text Color' ) }
/>
</div>

<ContrastChecker
{ ...{
textColor: textColor.color,
backgroundColor: backgroundColor.color,
} }
isLargeText={ false }
/>
</>
)
} );
Expand Down

0 comments on commit 9e00d5b

Please sign in to comment.