@@ -904,14 +904,17 @@ export function styleControl<T extends readonly SingleColorConfig[]>(
904
904
const appTheme = isPreviewTheme || isDefaultTheme || ( ! preventStyleOverwriting && ! preventAppStylesOverwriting )
905
905
? theme ?. theme
906
906
: defaultTheme ;
907
- const compTheme = isPreviewTheme || isDefaultTheme || ( compType && ! preventStyleOverwriting && ! preventAppStylesOverwriting )
908
- ? {
909
- ...( omit ( defaultTheme , 'components' , 'chart' ) ) ,
910
- ...defaultTheme . components ?. [ compType ] ?. [ styleKey ] as unknown as Record < string , string > ,
911
- ...( omit ( theme ?. theme , 'components' , 'chart' ) ) ,
912
- ...theme ?. theme ?. components ?. [ compType ] ?. [ styleKey ] as unknown as Record < string , string > ,
913
- }
914
- : defaultTheme . components ?. [ compType ] ?. [ styleKey ] ;
907
+ let compTheme : JSONValue | undefined = { } ;
908
+ if ( appliedThemeId !== themeId ) {
909
+ compTheme = isPreviewTheme || isDefaultTheme || ( compType && ! preventStyleOverwriting && ! preventAppStylesOverwriting )
910
+ ? {
911
+ ...( omit ( defaultTheme , 'components' , 'chart' ) ) ,
912
+ ...defaultTheme . components ?. [ compType ] ?. [ styleKey ] as unknown as Record < string , string > ,
913
+ ...( omit ( theme ?. theme , 'components' , 'chart' ) ) ,
914
+ ...theme ?. theme ?. components ?. [ compType ] ?. [ styleKey ] as unknown as Record < string , string > ,
915
+ }
916
+ : defaultTheme . components ?. [ compType ] ?. [ styleKey ] ;
917
+ }
915
918
const styleProps = ( ! comp && ! compType ) || preventStyleOverwriting || preventAppStylesOverwriting || appliedThemeId === themeId
916
919
? props as ColorMap
917
920
: { } as ColorMap ;
0 commit comments