Skip to content

Commit d55f40c

Browse files
authored
fix(blocks): preserve agent block color (#4671)
1 parent 974a18d commit d55f40c

5 files changed

Lines changed: 10 additions & 2 deletions

File tree

apps/sim/app/_styles/globals.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ html[data-sidebar-collapsed] .sidebar-container .sidebar-collapse-btn {
217217
--border-success: #e0e0e0;
218218

219219
/* Brand & state */
220+
--brand-agent: #6f3dfa;
220221
--brand-secondary: #33b4ff;
221222
--brand-accent: #33c482;
222223
--brand-accent-hover: #2dac72;
@@ -373,6 +374,7 @@ html[data-sidebar-collapsed] .sidebar-container .sidebar-collapse-btn {
373374
--border-success: #575757;
374375

375376
/* Brand & state */
377+
--brand-agent: #701ffc;
376378
--brand-secondary: #33b4ff;
377379
--brand-accent: #33c482;
378380
--brand-accent-hover: #2dac72;

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ export function Editor() {
397397
/>
398398
) : (
399399
<h2
400-
className='min-w-0 flex-1 cursor-pointer select-none text-ellipsis whitespace-nowrap [overflow:clip] [overflow-clip-margin:3px] pr-2 font-medium text-[var(--text-primary)] text-sm'
400+
className='min-w-0 flex-1 cursor-pointer select-none text-ellipsis whitespace-nowrap pr-2 font-medium text-[var(--text-primary)] text-sm [overflow-clip-margin:3px] [overflow:clip]'
401401
title={title}
402402
onDoubleClick={handleStartRename}
403403
onMouseDown={(e) => {

apps/sim/blocks/blocks/agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export const AgentBlock: BlockConfig<AgentResponse> = {
8181
category: 'blocks',
8282
integrationType: IntegrationType.AI,
8383
tags: ['llm', 'agentic', 'automation'],
84-
bgColor: 'var(--brand)',
84+
bgColor: 'var(--brand-agent)',
8585
icon: AgentIcon,
8686
subBlocks: [
8787
{

apps/sim/ee/whitelabeling/inject-theme.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export function generateThemeCSS(): string {
1919

2020
if (process.env.NEXT_PUBLIC_BRAND_PRIMARY_COLOR) {
2121
cssVars.push(`--brand: ${process.env.NEXT_PUBLIC_BRAND_PRIMARY_COLOR};`)
22+
cssVars.push(`--brand-agent: ${process.env.NEXT_PUBLIC_BRAND_PRIMARY_COLOR};`)
2223
cssVars.push(`--brand-accent: ${process.env.NEXT_PUBLIC_BRAND_PRIMARY_COLOR};`)
2324
cssVars.push(`--auth-primary-btn-bg: ${process.env.NEXT_PUBLIC_BRAND_PRIMARY_COLOR};`)
2425
cssVars.push(`--auth-primary-btn-border: ${process.env.NEXT_PUBLIC_BRAND_PRIMARY_COLOR};`)
@@ -51,6 +52,10 @@ export function generateThemeCSS(): string {
5152
cssVars.push(`--brand-accent-hover: ${process.env.NEXT_PUBLIC_BRAND_ACCENT_HOVER_COLOR};`)
5253
}
5354

55+
if (process.env.NEXT_PUBLIC_CUSTOM_CSS_URL) {
56+
cssVars.push('--brand-agent: var(--brand);')
57+
}
58+
5459
if (process.env.NEXT_PUBLIC_BRAND_BACKGROUND_COLOR) {
5560
const isDark = isDarkBackground(process.env.NEXT_PUBLIC_BRAND_BACKGROUND_COLOR)
5661
if (isDark) {

apps/sim/ee/whitelabeling/org-branding-utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export function generateOrgThemeCSS(settings: OrganizationWhitelabelSettings): s
6666

6767
if (settings.primaryColor) {
6868
vars.push(`--brand: ${settings.primaryColor};`)
69+
vars.push(`--brand-agent: ${settings.primaryColor};`)
6970
vars.push(`--brand-accent: ${settings.primaryColor};`)
7071
vars.push(`--auth-primary-btn-bg: ${settings.primaryColor};`)
7172
vars.push(`--auth-primary-btn-border: ${settings.primaryColor};`)

0 commit comments

Comments
 (0)