From 662bcee7cdad32dbaae50456f04f045d608dc55d Mon Sep 17 00:00:00 2001 From: waleed Date: Tue, 19 May 2026 18:00:46 -0700 Subject: [PATCH] fix(blocks): preserve agent block color --- apps/sim/app/_styles/globals.css | 2 ++ .../components/panel/components/editor/editor.tsx | 2 +- apps/sim/blocks/blocks/agent.ts | 2 +- apps/sim/ee/whitelabeling/inject-theme.ts | 5 +++++ apps/sim/ee/whitelabeling/org-branding-utils.ts | 1 + 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/sim/app/_styles/globals.css b/apps/sim/app/_styles/globals.css index 1555a0cc2ab..a80dc572e4d 100644 --- a/apps/sim/app/_styles/globals.css +++ b/apps/sim/app/_styles/globals.css @@ -217,6 +217,7 @@ html[data-sidebar-collapsed] .sidebar-container .sidebar-collapse-btn { --border-success: #e0e0e0; /* Brand & state */ + --brand-agent: #6f3dfa; --brand-secondary: #33b4ff; --brand-accent: #33c482; --brand-accent-hover: #2dac72; @@ -373,6 +374,7 @@ html[data-sidebar-collapsed] .sidebar-container .sidebar-collapse-btn { --border-success: #575757; /* Brand & state */ + --brand-agent: #701ffc; --brand-secondary: #33b4ff; --brand-accent: #33c482; --brand-accent-hover: #2dac72; diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx index c1c24af6171..8f32c364fe3 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx @@ -397,7 +397,7 @@ export function Editor() { /> ) : (

{ diff --git a/apps/sim/blocks/blocks/agent.ts b/apps/sim/blocks/blocks/agent.ts index 652270de636..b5068dfeece 100644 --- a/apps/sim/blocks/blocks/agent.ts +++ b/apps/sim/blocks/blocks/agent.ts @@ -81,7 +81,7 @@ export const AgentBlock: BlockConfig = { category: 'blocks', integrationType: IntegrationType.AI, tags: ['llm', 'agentic', 'automation'], - bgColor: 'var(--brand)', + bgColor: 'var(--brand-agent)', icon: AgentIcon, subBlocks: [ { diff --git a/apps/sim/ee/whitelabeling/inject-theme.ts b/apps/sim/ee/whitelabeling/inject-theme.ts index 0b2316a7038..07e3d64bdcd 100644 --- a/apps/sim/ee/whitelabeling/inject-theme.ts +++ b/apps/sim/ee/whitelabeling/inject-theme.ts @@ -19,6 +19,7 @@ export function generateThemeCSS(): string { if (process.env.NEXT_PUBLIC_BRAND_PRIMARY_COLOR) { cssVars.push(`--brand: ${process.env.NEXT_PUBLIC_BRAND_PRIMARY_COLOR};`) + cssVars.push(`--brand-agent: ${process.env.NEXT_PUBLIC_BRAND_PRIMARY_COLOR};`) cssVars.push(`--brand-accent: ${process.env.NEXT_PUBLIC_BRAND_PRIMARY_COLOR};`) cssVars.push(`--auth-primary-btn-bg: ${process.env.NEXT_PUBLIC_BRAND_PRIMARY_COLOR};`) cssVars.push(`--auth-primary-btn-border: ${process.env.NEXT_PUBLIC_BRAND_PRIMARY_COLOR};`) @@ -51,6 +52,10 @@ export function generateThemeCSS(): string { cssVars.push(`--brand-accent-hover: ${process.env.NEXT_PUBLIC_BRAND_ACCENT_HOVER_COLOR};`) } + if (process.env.NEXT_PUBLIC_CUSTOM_CSS_URL) { + cssVars.push('--brand-agent: var(--brand);') + } + if (process.env.NEXT_PUBLIC_BRAND_BACKGROUND_COLOR) { const isDark = isDarkBackground(process.env.NEXT_PUBLIC_BRAND_BACKGROUND_COLOR) if (isDark) { diff --git a/apps/sim/ee/whitelabeling/org-branding-utils.ts b/apps/sim/ee/whitelabeling/org-branding-utils.ts index 7449dffb74d..f859209f812 100644 --- a/apps/sim/ee/whitelabeling/org-branding-utils.ts +++ b/apps/sim/ee/whitelabeling/org-branding-utils.ts @@ -66,6 +66,7 @@ export function generateOrgThemeCSS(settings: OrganizationWhitelabelSettings): s if (settings.primaryColor) { vars.push(`--brand: ${settings.primaryColor};`) + vars.push(`--brand-agent: ${settings.primaryColor};`) vars.push(`--brand-accent: ${settings.primaryColor};`) vars.push(`--auth-primary-btn-bg: ${settings.primaryColor};`) vars.push(`--auth-primary-btn-border: ${settings.primaryColor};`)