Skip to content

Commit 9261b94

Browse files
fix styles not applying
1 parent c34bacd commit 9261b94

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -863,15 +863,17 @@ export function styleControl<T extends readonly SingleColorConfig[]>(
863863
const {comp, compType} = useContext(CompContext);
864864
const theme = useContext(ThemeContext);
865865
const bgColor = useContext(BackgroundColorContext);
866+
const { themeId } = theme || {};
867+
const isPreviewTheme = themeId === 'preview-theme';
868+
866869

867870
const appSettingsComp = editorState?.getAppSettingsComp();
868871
const preventAppStylesOverwriting = appSettingsComp?.getView()?.preventAppStylesOverwriting;
869-
const { themeId } = theme || {};
870872
const { appliedThemeId, preventStyleOverwriting } = comp?.comp?.container || comp?.comp || {};
871-
const appTheme = !preventStyleOverwriting && !preventAppStylesOverwriting
873+
const appTheme = isPreviewTheme || (!preventStyleOverwriting && !preventAppStylesOverwriting)
872874
? theme?.theme
873875
: undefined;
874-
const compTheme = compType && !preventStyleOverwriting && !preventAppStylesOverwriting
876+
const compTheme = isPreviewTheme || (compType && !preventStyleOverwriting && !preventAppStylesOverwriting)
875877
? {
876878
...(theme?.theme?.components?.[compType]?.[styleKey] || {}) as unknown as Record<string, string>
877879
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,8 +1459,8 @@ export const TableHeaderStyle = [
14591459
FONT_FAMILY,
14601460
FONT_STYLE,
14611461
TEXT,
1462-
getStaticBackground(SURFACE_COLOR),
1463-
getBackground("primarySurface"),
1462+
// getStaticBackground(SURFACE_COLOR),
1463+
// getBackground("primarySurface"),
14641464
{
14651465
name: "headerBackground",
14661466
label: trans("style.tableHeaderBackground"),

0 commit comments

Comments
 (0)