Skip to content

Commit b0980b1

Browse files
fix(light): tag dropdown, code highlight (#3799)
* fix(light): tag dropdown, code highlight * remove more hardcoded vals
1 parent 66ce673 commit b0980b1

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

apps/sim/app/_styles/globals.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,14 @@ html[data-sidebar-collapsed] .sidebar-container .sidebar-collapse-btn {
216216
--selection: #1a5cf6;
217217
--warning: #ea580c;
218218

219+
/* Inverted surface (dark chrome on light page, e.g. tag dropdown) */
220+
--surface-inverted: #1b1b1b;
221+
--surface-inverted-hover: #363636;
222+
--border-inverted: #363636;
223+
224+
/* Tooltip (true inversion: always opposite of page) */
225+
--tooltip-bg: #1b1b1b;
226+
219227
/* Utility */
220228
--white: #ffffff;
221229

@@ -362,6 +370,14 @@ html[data-sidebar-collapsed] .sidebar-container .sidebar-collapse-btn {
362370
--selection: #4b83f7;
363371
--warning: #ff6600;
364372

373+
/* Inverted surface (in dark mode, falls back to standard surfaces) */
374+
--surface-inverted: #242424;
375+
--surface-inverted-hover: #363636;
376+
--border-inverted: #3d3d3d;
377+
378+
/* Tooltip (true inversion: always opposite of page) */
379+
--tooltip-bg: #fdfdfd;
380+
365381
/* Utility */
366382
--white: #ffffff;
367383

apps/sim/components/emcn/components/code/code.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ export function getCodeEditorProps(options?: {
452452
'border-none bg-transparent outline-none resize-none',
453453
'focus:outline-none focus:ring-0',
454454
// Selection styling - light and dark modes
455-
'selection:bg-[var(--selection-bg)] selection:text-[var(--bg)]',
455+
'selection:bg-[var(--selection-bg)] selection:text-[var(--text-primary)]',
456456
'dark:selection:bg-[var(--selection-dark)] dark:selection:text-white',
457457
// Caret color - adapts to mode
458458
'caret-[var(--text-primary)] dark:caret-white',

apps/sim/components/emcn/components/popover/popover.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ const STYLES = {
9898
search: 'text-[var(--text-muted-inverse)] dark:text-[var(--text-muted)]',
9999
searchInput:
100100
'text-white placeholder:text-[var(--text-muted-inverse)] dark:text-[var(--text-primary)] dark:placeholder:text-[var(--text-muted)]',
101-
content: 'bg-[var(--bg)] text-white dark:bg-[var(--surface-3)] dark:text-foreground',
102-
divider: 'border-[var(--surface-5)] dark:border-[var(--border-1)]',
101+
content: 'bg-[var(--surface-inverted)] text-white dark:text-foreground',
102+
divider: 'border-[var(--border-inverted)]',
103103
},
104104
} satisfies Record<
105105
PopoverColorScheme,
@@ -126,9 +126,9 @@ const STYLES = {
126126
},
127127
inverted: {
128128
active:
129-
'bg-[var(--surface-5)] text-white [&_svg]:text-white dark:bg-[var(--surface-5)] dark:text-[var(--text-primary)] dark:[&_svg]:text-[var(--text-primary)]',
129+
'bg-[var(--surface-inverted-hover)] text-white [&_svg]:text-white dark:text-[var(--text-primary)] dark:[&_svg]:text-[var(--text-primary)]',
130130
hover:
131-
'hover-hover:bg-[var(--surface-5)] hover-hover:text-white hover-hover:[&_svg]:text-white dark:hover-hover:bg-[var(--surface-5)] dark:hover-hover:text-[var(--text-primary)] dark:hover-hover:[&_svg]:text-[var(--text-primary)]',
131+
'hover-hover:bg-[var(--surface-inverted-hover)] hover-hover:text-white hover-hover:[&_svg]:text-white dark:hover-hover:text-[var(--text-primary)] dark:hover-hover:[&_svg]:text-[var(--text-primary)]',
132132
},
133133
},
134134
} as const
@@ -650,7 +650,7 @@ const PopoverContent = React.forwardRef<
650650
arrowClassName ??
651651
cn(
652652
colorScheme === 'inverted'
653-
? 'fill-[#242424] stroke-[var(--surface-5)] dark:fill-[var(--surface-3)] dark:stroke-[var(--border-1)]'
653+
? 'fill-[var(--surface-inverted)] stroke-[var(--border-inverted)]'
654654
: 'fill-[var(--surface-3)] stroke-[var(--border-1)] dark:fill-[var(--surface-3)]'
655655
)
656656
}

apps/sim/components/emcn/components/tooltip/tooltip.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ const Content = React.forwardRef<
5050
collisionPadding={8}
5151
avoidCollisions={true}
5252
className={cn(
53-
'z-[var(--z-tooltip)] max-w-[260px] rounded-[4px] bg-[#1b1b1b] px-2 py-[3.5px] font-base text-white text-xs shadow-sm dark:bg-[#fdfdfd] dark:text-black',
53+
'z-[var(--z-tooltip)] max-w-[260px] rounded-[4px] bg-[var(--tooltip-bg)] px-2 py-[3.5px] font-base text-white text-xs shadow-sm dark:text-black',
5454
className
5555
)}
5656
{...props}
5757
>
5858
{props.children}
59-
<TooltipPrimitive.Arrow className='fill-[var(--bg)] dark:fill-[#fdfdfd]' />
59+
<TooltipPrimitive.Arrow className='fill-[var(--tooltip-bg)]' />
6060
</TooltipPrimitive.Content>
6161
</TooltipPrimitive.Portal>
6262
))

0 commit comments

Comments
 (0)