@@ -4,7 +4,7 @@ import { invokeMainChannel } from '@/lib/utils';
44import type { ColorItem } from '@/routes/editor/LayersPanel/BrandTab/ColorPanel/ColorPalletGroup' ;
55import { DEFAULT_COLOR_NAME , MainChannels } from '@onlook/models/constants' ;
66import { Icons } from '@onlook/ui/icons' ;
7- import { Color , isColorEmpty } from '@onlook/utility' ;
7+ import { Color , isColorEmpty , resolveCssVariables } from '@onlook/utility' ;
88import { observer } from 'mobx-react-lite' ;
99import { memo , useCallback , useEffect , useMemo , useState } from 'react' ;
1010import { BrandPopoverPicker } from './ColorBrandPicker' ;
@@ -98,12 +98,17 @@ const ColorInput = observer(
9898 }
9999 const newValue = elementStyle . getValue ( editorEngine . style . selectedStyle ?. styles ) ;
100100
101+ const resolvedValue = resolveCssVariables (
102+ newValue ,
103+ editorEngine . style . selectedStyle . styles ,
104+ ) ;
105+
101106 const color = editorEngine . theme . getColorByName ( newValue ) ;
102107 if ( color ) {
103108 return Color . from ( color ) ;
104109 }
105110
106- return Color . from ( newValue ) ;
111+ return Color . from ( resolvedValue ) ;
107112 } , [ editorEngine . style . selectedStyle ?. styles , elementStyle , isFocused , editorEngine . theme ] ) ;
108113
109114 // Update color state when getColor changes
0 commit comments