Fix invisible borders on Rem and Ram themes

Both themes set borderColor == baseBackground in their IDE editor-scheme
override (a seamless look for code editors). For the web UI secondary
colour, fall back to secondaryBackground when borderColor would match
the page background exactly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-22 17:42:02 +00:00
parent f2baf869c9
commit bfcc21fb27
+7 -1
View File
@@ -79,8 +79,14 @@ export function buildVariables(theme: ThemeConfig): Record<string, string> {
const isDark = theme.colorScheme === 'dark';
const primary = get(p, 'accentColor');
const secondary = get(p, 'borderColor', get(p, 'secondaryBackground'));
const body = get(p, 'baseBackground');
// Some themes (e.g. Rem, Ram) set borderColor == baseBackground in their IDE
// editor-scheme override, creating an invisible-border effect suited for IDE
// editors but unusable in a web UI. Fall back to secondaryBackground instead.
const rawSecondary = get(p, 'borderColor', get(p, 'secondaryBackground'));
const secondary = rawSecondary === body
? get(p, 'secondaryBackground', scaleLightness(body, isDark ? 0.08 : -0.08))
: rawSecondary;
const fg = get(p, 'foregroundColor');
const headerColor = get(p, 'headerColor');
const contrastColor = get(p, 'contrastColor');