Files
formbricks/apps/web/lib/utils/styling.ts
T
Dhruwang Jariwala 60f6ca9463 chore: deprecate environments (#7693)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com>
2026-04-10 09:13:47 +04:00

22 lines
691 B
TypeScript

import { TJsWorkspaceStateSurvey, TJsWorkspaceStateWorkspaceSetting } from "@formbricks/types/js";
export const getStyling = (workspace: TJsWorkspaceStateWorkspaceSetting, survey: TJsWorkspaceStateSurvey) => {
// allow style overwrite is disabled from the workspace
if (!workspace.styling.allowStyleOverwrite) {
return workspace.styling;
}
// allow style overwrite is enabled from the workspace
if (workspace.styling.allowStyleOverwrite) {
// survey style overwrite is disabled
if (!survey.styling?.overwriteThemeStyling) {
return workspace.styling;
}
// survey style overwrite is enabled
return survey.styling;
}
return workspace.styling;
};