Skip to content

Commit

Permalink
Add ContrastChecker
Browse files Browse the repository at this point in the history
  • Loading branch information
R A Van Epps committed Sep 9, 2020
1 parent 9d029ee commit 5e48cf6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/blocks/accordions/edit.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useEffect } from '@wordpress/element';
import { useEffect, Platform } from '@wordpress/element';
import {
ContrastChecker,
InnerBlocks,
PanelColorSettings,
InspectorControls,
Expand Down Expand Up @@ -103,7 +104,16 @@ function Edit( props ) {
label: __( 'Background Color', 'wdsblocks' ),
},
] }
/>
>
{ 'web' === Platform.OS &&
!! fontColor?.color &&
!! backgroundColor?.color && (
<ContrastChecker
backgroundColor={ backgroundColor.color }
textColor={ fontColor.color }
/>
) }
</PanelColorSettings>
<PanelBody title={ __( 'Settings', 'wdsblocks' ) }>
<BaseControl
label={ __( 'Expand First Accordion', 'wdsblocks' ) }
Expand Down

0 comments on commit 5e48cf6

Please sign in to comment.