@@ -52,6 +52,7 @@ import { dispatch, useSelect } from '@wordpress/data'
5252import { addFilter } from '@wordpress/hooks'
5353import { memo } from '@wordpress/element'
5454import { useBlockLayoutDefaults } from '~stackable/hooks'
55+ import { ToggleControl } from '@wordpress/components'
5556
5657const ALLOWED_INNER_BLOCKS = [ 'stackable/icon-list-item' ]
5758
@@ -143,6 +144,7 @@ const Edit = props => {
143144 listItemBorderColor,
144145 listDisplayStyle,
145146 listFullWidth,
147+ useCustomIconColor,
146148 } = attributes
147149
148150 const wrapList = ! listFullWidth && listDisplayStyle !== 'grid'
@@ -163,7 +165,9 @@ const Edit = props => {
163165 'stk-block-icon-list' ,
164166 blockAlignmentClass ,
165167 textClasses ,
166- ] )
168+ ] , {
169+ 'stk__use-custom-icon-color' : useCustomIconColor ,
170+ } )
167171
168172 const tagNameClassNames = classnames ( [
169173 ordered ? 'stk-block-icon-list__ol' : 'stk-block-icon-list__ul' ,
@@ -209,6 +213,7 @@ const Edit = props => {
209213 listItemBorderStyle = { listItemBorderStyle }
210214 listItemBorderColor = { listItemBorderColor }
211215 resetCustomIcons = { resetCustomIcons }
216+ useCustomIconColor = { useCustomIconColor }
212217 />
213218
214219 { blockCss && < style key = "block-css" > { blockCss } </ style > }
@@ -339,7 +344,7 @@ const InspectorControls = memo( props => {
339344 default = "unordered"
340345 />
341346
342- { ! props . ordered && (
347+ { ! props . ordered && < >
343348 < IconControl
344349 label = { __ ( 'Icon' , i18n ) }
345350 value = { props . icon }
@@ -350,7 +355,13 @@ const InspectorControls = memo( props => {
350355 } }
351356 defaultValue = { DEFAULT_SVG }
352357 />
353- ) }
358+
359+ < ToggleControl
360+ label = { __ ( 'Use Custom Icon Color' , i18n ) }
361+ checked = { props . useCustomIconColor }
362+ onChange = { useCustomIconColor => props . setAttributes ( { useCustomIconColor } ) }
363+ />
364+ </ > }
354365
355366 { props . ordered && (
356367 < AdvancedSelectControl
0 commit comments