Skip to content

Commit d3e6771

Browse files
styling updates
1 parent 203ea02 commit d3e6771

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

client/packages/lowcoder/src/comps/controls/styleControl.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -865,17 +865,21 @@ export function styleControl<T extends readonly SingleColorConfig[]>(
865865
const bgColor = useContext(BackgroundColorContext);
866866
const { themeId } = theme || {};
867867
const isPreviewTheme = themeId === 'preview-theme';
868+
const isDefaultTheme = themeId === 'default-theme-id';
868869

869870

870871
const appSettingsComp = editorState?.getAppSettingsComp();
871872
const preventAppStylesOverwriting = appSettingsComp?.getView()?.preventAppStylesOverwriting;
872873
const { appliedThemeId, preventStyleOverwriting } = comp?.comp?.container || comp?.comp || {};
873-
const appTheme = isPreviewTheme || (!preventStyleOverwriting && !preventAppStylesOverwriting)
874+
const appTheme = isPreviewTheme || isDefaultTheme || (!preventStyleOverwriting && !preventAppStylesOverwriting)
874875
? theme?.theme
875876
: undefined;
876-
const compTheme = isPreviewTheme || (compType && !preventStyleOverwriting && !preventAppStylesOverwriting)
877+
const compTheme = isPreviewTheme || isDefaultTheme || (compType && !preventStyleOverwriting && !preventAppStylesOverwriting)
877878
? {
878-
...(theme?.theme?.components?.[compType]?.[styleKey] || {}) as unknown as Record<string, string>
879+
...(
880+
theme?.theme?.components?.[compType]?.[styleKey]
881+
|| defaultTheme.components?.[compType]?.[styleKey]
882+
) as unknown as Record<string, string>
879883
}
880884
: undefined;
881885
const styleProps = (!comp && !compType) || preventStyleOverwriting || preventAppStylesOverwriting || appliedThemeId === themeId

0 commit comments

Comments
 (0)