Skip to content

Commit

Permalink
Check default accent color
Browse files Browse the repository at this point in the history
  • Loading branch information
mirka committed Oct 27, 2022
1 parent 895bf02 commit 6ef8d6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/components/src/theme/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ const backgroundColor = ( { accent, background }: ThemeProps ) => {

const foreground = getForegroundForColor( background );

// TODO: Check against default accent color when not provided
if ( ! colord( background ).isReadable( accent ) ) {
// TODO: Add unit test
if ( ! colord( background ).isReadable( accent || COLORS.ui.theme ) ) {
// eslint-disable-next-line no-console
console.warn(
`wp.components.Theme: The background color provided ("${ background }") does not have sufficient contrast against the accent color ("${ accent }").`
Expand Down

0 comments on commit 6ef8d6e

Please sign in to comment.