@@ -184,6 +184,8 @@ export const Icon = props => {
184184
185185 const ShapeComp = useMemo ( ( ) => getShapeSVG ( getAttribute ( 'backgroundShape' ) || 'blob1' ) , [ getAttribute ( 'backgroundShape' ) ] )
186186
187+ const iconColorType = getAttribute ( 'iconColorType' )
188+
187189 const _icon = value || getAttribute ( 'icon' )
188190 const currentIconRef = useRef ( _icon )
189191 const processedIconRef = useRef ( null )
@@ -202,6 +204,19 @@ export const Icon = props => {
202204 return
203205 }
204206
207+ // Don't use page icons for multicolor icons
208+ // because we target svg elements with the :nth-of-type() selector to apply the multicolor styles.
209+ if ( iconColorType === 'multicolor' ) {
210+ // Clean up if this icon was previously in the page-icons store
211+ if ( processedIconRef . current === _icon && _icon ) {
212+ dispatch ( 'stackable/page-icons' ) . removePageIcon ( _icon )
213+ processedIconRef . current = null
214+ setIcon ( _icon ) // Use the original icon directly
215+ lastIconValueRef . current = _icon
216+ }
217+ return
218+ }
219+
205220 // Check if icon exists in pageIcons Map
206221 // The Map structure is: [SVG string (key), { id: iconId, count: number } (value)]
207222 if ( _icon ) {
@@ -282,7 +297,7 @@ export const Icon = props => {
282297 lastIconValueRef . current = null
283298 }
284299 }
285- } , [ _icon ] )
300+ } , [ _icon , iconColorType ] )
286301
287302 useEffect ( ( ) => {
288303 return ( ) => {
0 commit comments