Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

Improve theme contrast tokens and shared foregrounds

[._.]/ Adam Eivyddaeba62da15
diff --git a/client/src/components/cos/tabs/AgentCard.jsx b/client/src/components/cos/tabs/AgentCard.jsx
index a0fcc196b8..0b8a2396c0 100644
--- a/client/src/components/cos/tabs/AgentCard.jsx
+++ b/client/src/components/cos/tabs/AgentCard.jsx
@@ -603,7 +603,7 @@ export default function AgentCard({ agent, onPause, onKill, onDelete, onResume,
>
<Terminal size={14} aria-hidden="true" className="shrink-0" />
<span>Open Shell</span>
- <span className="font-mono text-[10px] text-black/60">{agent.metadata.tuiSessionId.slice(0, 6)}</span>
+ <span className="font-mono text-[10px] text-port-on-success">{agent.metadata.tuiSessionId.slice(0, 6)}</span>
</Link>
)}
{!remote && (
diff --git a/client/src/components/games/GameBindings.jsx b/client/src/components/games/GameBindings.jsx
index 3ec451db8b..982e6632bb 100644
--- a/client/src/components/games/GameBindings.jsx
+++ b/client/src/components/games/GameBindings.jsx
@@ -254,7 +254,7 @@ function MusicBindingRow({
type="button"
disabled={busy}
onClick={() => onPublish(binding.id, true)}
- className="inline-flex min-h-[36px] items-center rounded-lg bg-amber-500/80 px-3 text-xs font-semibold text-black disabled:opacity-40"
+ className="inline-flex min-h-[36px] items-center rounded-lg bg-port-warning px-3 text-xs font-semibold text-port-on-warning disabled:opacity-40"
>
Overwrite
</button>
diff --git a/client/src/components/media/MediaLightbox.jsx b/client/src/components/media/MediaLightbox.jsx
index af3facb919..9026909aa7 100644
--- a/client/src/components/media/MediaLightbox.jsx
+++ b/client/src/components/media/MediaLightbox.jsx
@@ -737,7 +737,7 @@ function SettingsPane({
<button
type="button"
onClick={() => closeThenRun(onSendTo3d)}
- className="flex-1 flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs bg-purple-600/80 text-white hover:opacity-90 rounded"
+ className="flex-1 flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs bg-port-accent-2 text-port-on-accent-2 hover:opacity-90 rounded"
>
<Box className="w-3.5 h-3.5" /> Send to 3D
</button>
diff --git a/client/src/components/openworld/openWorldTheme.test.js b/client/src/components/openworld/openWorldTheme.test.js
index 44f3e2c72b..6cad6e0f92 100644
--- a/client/src/components/openworld/openWorldTheme.test.js
+++ b/client/src/components/openworld/openWorldTheme.test.js
@@ -16,27 +16,27 @@ describe('deriveOpenWorldPalette', () => {
it('derives the accent hex from a theme --port-accent triplet', () => {
const phosphor = getTheme('black-ice-terminal-day');
const p = deriveOpenWorldPalette(phosphor);
- expect(p.accent).toBe('#0a7a4a'); // 10 122 74
+ expect(p.accent).toBe('#086c43'); // 8 108 67
expect(p.themeId).toBe('black-ice-terminal-day');
expect(p.isDay).toBe(true);
});
it('exposes a dark night void and a bright day sky, both accent-tinted', () => {
- const phosphor = getTheme('black-ice-terminal-day'); // accent #0a7a4a
+ const phosphor = getTheme('black-ice-terminal-day'); // accent #086c43
const p = deriveOpenWorldPalette(phosphor, 'cyber');
- expect(p.nightBackground).toBe('#010c07'); // #0a7a4a * 0.1
- expect(p.dayBackground).toBe('#badacc'); // #0a7a4a lightened 0.72 toward white
+ expect(p.nightBackground).toBe('#010b07'); // #086c43 * 0.1
+ expect(p.dayBackground).toBe('#bad6ca'); // #086c43 lightened 0.72 toward white
// A day theme's default surround (loading screen) is the bright day sky.
expect(p.isDay).toBe(true);
- expect(p.background).toBe('#badacc');
+ expect(p.background).toBe('#bad6ca');
});
it('defaults a night theme surround to the dark void', () => {
- const midnight = getTheme('classic-midnight'); // accent #3b82f6
+ const midnight = getTheme('classic-midnight'); // accent #2563eb
const p = deriveOpenWorldPalette(midnight, 'cyber');
expect(p.isDay).toBe(false);
- expect(p.background).toBe('#060d19'); // nightBackground = #3b82f6 * 0.1
- expect(p.dayBackground).toBe('#c8dcfc');
+ expect(p.background).toBe('#040a18'); // nightBackground = #2563eb * 0.1
+ expect(p.dayBackground).toBe('#c2d3f9');
});
it('falls back to defaults for a missing/invalid theme', () => {
@@ -234,12 +234,12 @@ describe('deriveOpenWorldPalette — world style', () => {
describe('deriveOpenWorldPalette brand surfaces', () => {
it('carries themed brand surfaces derived from the accent', () => {
const p = deriveOpenWorldPalette(getTheme('black-ice-terminal-day'));
- expect(p.ground).toBe('#0a7a4a');
- expect(p.particles).toBe('#0a7a4a');
- expect(p.building.online).toBe('#0a7a4a');
- expect(p.neonAccents[0]).toBe('#0a7a4a');
+ expect(p.ground).toBe('#086c43');
+ expect(p.particles).toBe('#086c43');
+ expect(p.building.online).toBe('#086c43');
+ expect(p.neonAccents[0]).toBe('#086c43');
// online buildings follow the recolor through the palette-bound helper
- expect(p.getBuildingColor('online')).toBe('#0a7a4a');
+ expect(p.getBuildingColor('online')).toBe('#086c43');
});
it('leaves status colors untouched', () => {
@@ -272,8 +272,8 @@ describe('deriveOpenWorldPalette brand surfaces', () => {
const green = deriveOpenWorldPalette(getTheme('black-ice-terminal-day'));
deriveOpenWorldPalette(getTheme('classic-midnight'));
const greenAgain = deriveOpenWorldPalette(getTheme('black-ice-terminal-day'));
- // classic-midnight accent is 59 130 246 -> #3b82f6, never a blend of green+blue.
- expect(deriveOpenWorldPalette(getTheme('classic-midnight')).ground).toBe('#3b82f6');
+ // classic-midnight accent is 37 99 235 -> #2563eb, never a blend of green+blue.
+ expect(deriveOpenWorldPalette(getTheme('classic-midnight')).ground).toBe('#2563eb');
// Re-deriving the green theme yields an identical body — proof it's recomputed
// from ORIGINAL_BUILDING_BODY, not from a previously-tinted value.
expect(greenAgain.buildingBody).toBe(green.buildingBody);
@@ -282,7 +282,7 @@ describe('deriveOpenWorldPalette brand surfaces', () => {
it('binds getAccentColor to the themed neon list', () => {
const p = deriveOpenWorldPalette(getTheme('black-ice-terminal-day'));
// The lead neon accent tracks the theme, so an app hashing to index 0 gets it.
- expect(p.neonAccents[0]).toBe('#0a7a4a');
+ expect(p.neonAccents[0]).toBe('#086c43');
// Bound helper picks from the palette's list; the bare helper picks from the
// static list. Both are deterministic for a given app and stay in their list.
const app = { name: 'anything' };
diff --git a/client/src/index.css b/client/src/index.css
index 9f8afdd563..493ae51210 100644
--- a/client/src/index.css
+++ b/client/src/index.css
@@ -23,6 +23,12 @@
--color-port-error: rgb(var(--port-error));
--color-port-text: rgb(var(--port-text));
--color-port-text-muted: rgb(var(--port-text-muted));
+ --color-port-text-subtle: rgb(var(--port-text-subtle));
+ --color-port-accent-text: rgb(var(--port-accent-text));
+ --color-port-accent-2-text: rgb(var(--port-accent-2-text));
+ --color-port-success-text: rgb(var(--port-success-text));
+ --color-port-warning-text: rgb(var(--port-warning-text));
+ --color-port-error-text: rgb(var(--port-error-text));
--color-port-on-accent: rgb(var(--port-on-accent));
--color-port-on-accent-2: rgb(var(--port-on-accent-2));
--color-port-on-success: rgb(var(--port-on-success));
@@ -37,20 +43,26 @@
--port-bg: 15 15 15;
--port-card: 26 26 26;
--port-border: 42 42 42;
- --port-accent: 59 130 246;
+ --port-accent: 37 99 235;
--port-accent-2: 168 85 247;
+ --port-accent-text: 96 165 250;
+ --port-accent-2-text: 216 180 254;
--port-success: 34 197 94;
--port-warning: 245 158 11;
--port-error: 239 68 68;
+ --port-success-text: 134 239 172;
+ --port-warning-text: 252 211 77;
+ --port-error-text: 253 164 175;
--port-on-accent: 255 255 255;
- --port-on-accent-2: 255 255 255;
+ --port-on-accent-2: 37 7 56;
--port-on-success: 5 46 22;
--port-on-warning: 17 24 39;
- --port-on-error: 255 255 255;
- --port-text: 229 229 229;
- --port-text-muted: 163 163 163;
+ --port-on-error: 48 8 8;
+ --port-text: 212 212 216;
+ --port-text-muted: 161 161 170;
+ --port-text-subtle: 140 140 149;
--port-control-text: 212 212 216;
- --port-focus-ring: 59 130 246;
+ --port-focus-ring: 37 99 235;
/* Writers Room "light reading" theme — sepia paper tone used by the prose
textarea, the AI panel's Evaluate/Format/Adapt result containers, and
the per-scene cards. Centralized so the shade can be tweaked once. */
@@ -104,8 +116,8 @@
--port-active-bg: rgb(var(--port-accent) / 0.1);
--port-hover-bg: rgb(var(--port-border) / 0.5);
--port-terminal-bg: rgb(7 7 7);
- --port-terminal-text: rgb(229 229 229);
- --port-chart-1: 59 130 246;
+ --port-terminal-text: rgb(212 212 216);
+ --port-chart-1: 37 99 235;
--port-chart-2: 34 197 94;
--port-chart-3: 245 158 11;
--port-chart-4: 236 72 153;
@@ -443,6 +455,276 @@ html[data-port-theme] [role="button"] {
opacity var(--port-motion-fast) ease;
}
+/* === Shared foreground color contract ===
+ Components still contain a large amount of legacy Tailwind color utility
+ text. These selectors make those utilities aliases of the theme contract at
+ runtime, so the eight themes share the same readable roles:
+
+ - primary text: normal labels and controls
+ - muted text: supporting copy and metadata
+ - subtle text: tertiary labels, unavailable states, and tiny annotations
+ - semantic text: accent, secondary accent, success, warning, and error
+
+ Filled controls use the matching `--port-on-*` token below instead. Keeping
+ fill ink and surface ink separate is what prevents a color that is readable
+ as a status label from becoming unreadable inside a bright badge. Opacity
+ variants are intentionally promoted to the role's full readable value: a
+ small text label cannot rely on a decorative alpha to remain legible.
+ */
+html[data-port-theme] :is(
+ [class*="text-white"], [class*="text-zinc-50"], [class*="text-zinc-100"],
+ [class*="text-neutral-50"], [class*="text-neutral-100"],
+ [class*="text-gray-50"], [class*="text-gray-100"],
+ [class*="text-slate-50"], [class*="text-slate-100"]
+) {
+ color: rgb(var(--port-text)) !important;
+}
+
+html[data-port-theme] :is(
+ [class*="text-zinc-200"], [class*="text-zinc-300"],
+ [class*="text-neutral-200"], [class*="text-neutral-300"],
+ [class*="text-gray-200"], [class*="text-gray-300"],
+ [class*="text-slate-200"], [class*="text-slate-300"]
+) {
+ color: rgb(var(--port-text) / 0.85) !important;
+}
+
+html[data-port-theme] :is(
+ [class*="text-zinc-400"], [class*="text-zinc-500"],
+ [class*="text-neutral-400"], [class*="text-neutral-500"],
+ [class*="text-gray-400"], [class*="text-gray-500"],
+ [class*="text-slate-400"], [class*="text-slate-500"]
+) {
+ color: rgb(var(--port-text-muted)) !important;
+}
+
+html[data-port-theme] :is(
+ [class*="text-zinc-600"], [class*="text-zinc-700"],
+ [class*="text-neutral-600"], [class*="text-neutral-700"],
+ [class*="text-gray-600"], [class*="text-gray-700"],
+ [class*="text-slate-600"], [class*="text-slate-700"]
+) {
+ color: rgb(var(--port-text-subtle)) !important;
+}
+
+html[data-port-theme] :is(
+ [class*="text-zinc-800"], [class*="text-zinc-900"],
+ [class*="text-neutral-800"], [class*="text-neutral-900"],
+ [class*="text-gray-800"], [class*="text-gray-900"],
+ [class*="text-slate-800"], [class*="text-slate-900"]
+) {
+ color: rgb(var(--port-text)) !important;
+}
+
+/* Hue families are semantic aliases. This keeps legacy utility names useful
+ while making their actual foreground color follow the active theme. */
+html[data-port-theme] :is(
+ [class*="text-cyan-"], [class*="text-sky-"], [class*="text-blue-"],
+ [class*="text-indigo-"], .text-port-accent
+) {
+ color: rgb(var(--port-accent-text)) !important;
+}
+
+html[data-port-theme] :is(
+ [class*="text-violet-"], [class*="text-purple-"],
+ [class*="text-fuchsia-"], [class*="text-pink-"], .text-port-accent-2
+) {
+ color: rgb(var(--port-accent-2-text)) !important;
+}
+
+html[data-port-theme] :is(
+ [class*="text-red-"], [class*="text-rose-"], .text-port-error
+) {
+ color: rgb(var(--port-error-text)) !important;
+}
+
+html[data-port-theme] :is(
+ [class*="text-orange-"], [class*="text-amber-"], [class*="text-yellow-"],
+ .text-port-warning
+) {
+ color: rgb(var(--port-warning-text)) !important;
+}
+
+html[data-port-theme] :is(
+ [class*="text-lime-"], [class*="text-green-"], [class*="text-emerald-"],
+ [class*="text-teal-"], .text-port-success
+) {
+ color: rgb(var(--port-success-text)) !important;
+}
+
+html[data-port-theme] .text-port-text { color: rgb(var(--port-text)) !important; }
+html[data-port-theme] .text-port-text-muted { color: rgb(var(--port-text-muted)) !important; }
+html[data-port-theme] .text-port-text-subtle { color: rgb(var(--port-text-subtle)) !important; }
+/* Opacity-bearing semantic text utilities still need the semantic foreground
+ role, not the raw fill color. The hue-family aliases above already cover
+ legacy Tailwind variants; these selectors close the same gap for PortOS
+ utility names such as `text-port-warning/90`. */
+html[data-port-theme] :is([class^="text-port-text-muted/"], [class*=" text-port-text-muted/"]) {
+ color: rgb(var(--port-text-muted)) !important;
+}
+html[data-port-theme] :is([class^="text-port-text-subtle/"], [class*=" text-port-text-subtle/"]) {
+ color: rgb(var(--port-text-subtle)) !important;
+}
+html[data-port-theme] :is([class^="text-port-accent/"], [class*=" text-port-accent/"]) {
+ color: rgb(var(--port-accent-text)) !important;
+}
+html[data-port-theme] :is([class^="text-port-accent-2/"], [class*=" text-port-accent-2/"]) {
+ color: rgb(var(--port-accent-2-text)) !important;
+}
+html[data-port-theme] :is([class^="text-port-success/"], [class*=" text-port-success/"]) {
+ color: rgb(var(--port-success-text)) !important;
+}
+html[data-port-theme] :is([class^="text-port-warning/"], [class*=" text-port-warning/"]) {
+ color: rgb(var(--port-warning-text)) !important;
+}
+html[data-port-theme] :is([class^="text-port-error/"], [class*=" text-port-error/"]) {
+ color: rgb(var(--port-error-text)) !important;
+}
+
+/* Filled semantic controls use their own ink token. */
+html[data-port-theme] :is(
+ .bg-port-accent,
+ [class~="bg-port-accent/40"], [class~="bg-port-accent/50"], [class~="bg-port-accent/60"],
+ [class~="bg-port-accent/70"], [class~="bg-port-accent/75"], [class~="bg-port-accent/80"],
+ [class~="bg-port-accent/90"], [class~="bg-port-accent/95"], [class~="bg-port-accent/100"]
+):is([class~="text-white"], [class~="text-black"]) {
+ background-color: rgb(var(--port-accent)) !important;
+ color: rgb(var(--port-on-accent)) !important;
+}
+html[data-port-theme] :is(
+ .bg-port-accent-2,
+ [class~="bg-port-accent-2/40"], [class~="bg-port-accent-2/50"], [class~="bg-port-accent-2/60"],
+ [class~="bg-port-accent-2/70"], [class~="bg-port-accent-2/75"], [class~="bg-port-accent-2/80"],
+ [class~="bg-port-accent-2/90"], [class~="bg-port-accent-2/95"], [class~="bg-port-accent-2/100"]
+):is([class~="text-white"], [class~="text-black"]) {
+ background-color: rgb(var(--port-accent-2)) !important;
+ color: rgb(var(--port-on-accent-2)) !important;
+}
+html[data-port-theme] :is(
+ .bg-port-success,
+ [class~="bg-port-success/40"], [class~="bg-port-success/50"], [class~="bg-port-success/60"],
+ [class~="bg-port-success/70"], [class~="bg-port-success/75"], [class~="bg-port-success/80"],
+ [class~="bg-port-success/90"], [class~="bg-port-success/95"], [class~="bg-port-success/100"]
+):is([class~="text-white"], [class~="text-black"]) {
+ background-color: rgb(var(--port-success)) !important;
+ color: rgb(var(--port-on-success)) !important;
+}
+html[data-port-theme] :is(
+ .bg-port-warning,
+ [class~="bg-port-warning/40"], [class~="bg-port-warning/50"], [class~="bg-port-warning/60"],
+ [class~="bg-port-warning/70"], [class~="bg-port-warning/75"], [class~="bg-port-warning/80"],
+ [class~="bg-port-warning/90"], [class~="bg-port-warning/95"], [class~="bg-port-warning/100"]
+):is([class~="text-white"], [class~="text-black"]) {
+ background-color: rgb(var(--port-warning)) !important;
+ color: rgb(var(--port-on-warning)) !important;
+}
+html[data-port-theme] :is(
+ .bg-port-error,
+ [class~="bg-port-error/40"], [class~="bg-port-error/50"], [class~="bg-port-error/60"],
+ [class~="bg-port-error/70"], [class~="bg-port-error/75"], [class~="bg-port-error/80"],
+ [class~="bg-port-error/90"], [class~="bg-port-error/95"], [class~="bg-port-error/100"]
+):is([class~="text-white"], [class~="text-black"]) {
+ background-color: rgb(var(--port-error)) !important;
+ color: rgb(var(--port-on-error)) !important;
+}
+
+/* Solid legacy semantic fills are aliases too. This covers provider/status
+ buttons whose class names still come from a data-driven palette (for example
+ `bg-purple-500 text-white`) while leaving low-opacity decorative tints alone.
+ The paired ink token is applied to both historical white and black text. */
+html[data-port-theme] :is(
+ .bg-blue-500, .bg-blue-600, .bg-blue-700,
+ .bg-cyan-400, .bg-cyan-500, .bg-sky-500, .bg-sky-600,
+ .bg-indigo-500, .bg-indigo-600
+):is([class~="text-white"], [class~="text-black"]) {
+ background-color: rgb(var(--port-accent)) !important;
+ color: rgb(var(--port-on-accent)) !important;
+}
+
+html[data-port-theme] :is(
+ .bg-purple-500, .bg-purple-600, .bg-violet-500, .bg-violet-600,
+ .bg-fuchsia-500, .bg-pink-500
+):is([class~="text-white"], [class~="text-black"]) {
+ background-color: rgb(var(--port-accent-2)) !important;
+ color: rgb(var(--port-on-accent-2)) !important;
+}
+
+html[data-port-theme] :is(
+ .bg-green-400, .bg-green-500, .bg-green-600,
+ .bg-emerald-400, .bg-emerald-500, .bg-emerald-600,
+ .bg-lime-400, .bg-lime-500, .bg-teal-500, .bg-teal-600
+):is([class~="text-white"], [class~="text-black"]) {
+ background-color: rgb(var(--port-success)) !important;
+ color: rgb(var(--port-on-success)) !important;
+}
+
+html[data-port-theme] :is(
+ .bg-yellow-400, .bg-yellow-500, .bg-yellow-600,
+ .bg-amber-400, .bg-amber-500, .bg-amber-600,
+ .bg-orange-400, .bg-orange-500, .bg-orange-600
+):is([class~="text-white"], [class~="text-black"]) {
+ background-color: rgb(var(--port-warning)) !important;
+ color: rgb(var(--port-on-warning)) !important;
+}
+
+html[data-port-theme] :is(
+ .bg-red-400, .bg-red-500, .bg-red-600, .bg-red-700,
+ .bg-rose-400, .bg-rose-500, .bg-rose-600
+):is([class~="text-white"], [class~="text-black"]) {
+ background-color: rgb(var(--port-error)) !important;
+ color: rgb(var(--port-on-error)) !important;
+}
+
+html[data-port-theme] :is(
+ [class~="hover:bg-blue-400"], [class~="hover:bg-blue-500"], [class~="hover:bg-blue-600"],
+ [class~="hover:bg-cyan-400"], [class~="hover:bg-cyan-500"], [class~="hover:bg-sky-500"],
+ [class~="hover:bg-sky-600"], [class~="hover:bg-indigo-500"], [class~="hover:bg-indigo-600"]
+):hover { background-color: rgb(var(--port-accent)) !important; }
+
+html[data-port-theme] :is(
+ [class~="hover:bg-purple-400"], [class~="hover:bg-purple-500"], [class~="hover:bg-purple-600"],
+ [class~="hover:bg-violet-400"], [class~="hover:bg-violet-500"], [class~="hover:bg-violet-600"],
+ [class~="hover:bg-fuchsia-500"], [class~="hover:bg-pink-500"]
+):hover { background-color: rgb(var(--port-accent-2)) !important; }
+
+html[data-port-theme] :is(
+ [class~="hover:bg-green-400"], [class~="hover:bg-green-500"], [class~="hover:bg-green-600"],
+ [class~="hover:bg-emerald-400"], [class~="hover:bg-emerald-500"], [class~="hover:bg-emerald-600"],
+ [class~="hover:bg-lime-400"], [class~="hover:bg-lime-500"], [class~="hover:bg-teal-500"], [class~="hover:bg-teal-600"]
+):hover { background-color: rgb(var(--port-success)) !important; }
+
+html[data-port-theme] :is(
+ [class~="hover:bg-yellow-400"], [class~="hover:bg-yellow-500"], [class~="hover:bg-yellow-600"],
+ [class~="hover:bg-amber-400"], [class~="hover:bg-amber-500"], [class~="hover:bg-amber-600"],
+ [class~="hover:bg-orange-400"], [class~="hover:bg-orange-500"], [class~="hover:bg-orange-600"]
+):hover { background-color: rgb(var(--port-warning)) !important; }
+
+html[data-port-theme] :is(
+ [class~="hover:bg-red-400"], [class~="hover:bg-red-500"], [class~="hover:bg-red-600"], [class~="hover:bg-red-700"],
+ [class~="hover:bg-rose-400"], [class~="hover:bg-rose-500"], [class~="hover:bg-rose-600"]
+):hover { background-color: rgb(var(--port-error)) !important; }
+
+/* Shared neutral surface contract. Legacy dark gray utilities are common in
+ settings, diagnostics, and imported provider panels; treating them as
+ theme aliases keeps their text/background pairing readable in both modes.
+ White/black utilities are intentionally excluded because they are also used
+ for fixed media, scrims, and canvas chrome with their own contracts below. */
+html[data-port-theme] :is(.bg-gray-800, .bg-zinc-800, .bg-neutral-800, .bg-slate-800) {
+ background-color: rgb(var(--port-card) / var(--port-card-alpha)) !important;
+}
+
+html[data-port-theme] :is(.bg-gray-900, .bg-zinc-900, .bg-neutral-900, .bg-slate-900) {
+ background-color: rgb(var(--port-bg) / var(--port-bg-alpha)) !important;
+}
+
+html[data-port-theme] :is(.bg-gray-700, .bg-zinc-700, .bg-neutral-700, .bg-slate-700, .bg-gray-600, .bg-zinc-600, .bg-neutral-600, .bg-slate-600) {
+ background-color: var(--port-control-bg) !important;
+}
+
+html[data-port-theme] :is(.bg-gray-500, .bg-zinc-500, .bg-neutral-500, .bg-slate-500) {
+ background-color: var(--port-control-bg-hover) !important;
+}
+
/* Every rounded/bordered CONTENT CARD gets the theme's card elevation, at any
fill opacity. Listing only `/50` meant a card written `bg-port-card/40` — the
other common spelling — silently lost both its shadow and its glass blur, so
@@ -495,6 +777,61 @@ html[data-port-theme] aside nav [aria-current="page"] {
background: var(--port-active-bg) !important;
}
+/* Tonal semantic surfaces keep their alpha/background treatment, but legacy
+ literal white/black ink must follow the semantic foreground role. This is
+ the safe pairing for /5 through /30 chips; higher-opacity fills use the
+ matching `--port-on-*` token above. */
+html[data-port-theme] :is(
+ [class~="bg-port-accent/5"], [class~="bg-port-accent/8"], [class~="bg-port-accent/10"],
+ [class~="bg-port-accent/15"], [class~="bg-port-accent/20"], [class~="bg-port-accent/25"], [class~="bg-port-accent/30"]
+):is(
+ [class~="text-white"], [class~="text-black"],
+ [class^="text-white/"], [class*=" text-white/"],
+ [class^="text-black/"], [class*=" text-black/"]
+) {
+ color: rgb(var(--port-accent-text)) !important;
+}
+html[data-port-theme] :is(
+ [class~="bg-port-accent-2/5"], [class~="bg-port-accent-2/10"], [class~="bg-port-accent-2/15"],
+ [class~="bg-port-accent-2/20"], [class~="bg-port-accent-2/25"], [class~="bg-port-accent-2/30"]
+):is(
+ [class~="text-white"], [class~="text-black"],
+ [class^="text-white/"], [class*=" text-white/"],
+ [class^="text-black/"], [class*=" text-black/"]
+) {
+ color: rgb(var(--port-accent-2-text)) !important;
+}
+html[data-port-theme] :is(
+ [class~="bg-port-success/5"], [class~="bg-port-success/10"], [class~="bg-port-success/15"],
+ [class~="bg-port-success/20"], [class~="bg-port-success/25"], [class~="bg-port-success/30"]
+):is(
+ [class~="text-white"], [class~="text-black"],
+ [class^="text-white/"], [class*=" text-white/"],
+ [class^="text-black/"], [class*=" text-black/"]
+) {
+ color: rgb(var(--port-success-text)) !important;
+}
+html[data-port-theme] :is(
+ [class~="bg-port-warning/5"], [class~="bg-port-warning/10"], [class~="bg-port-warning/15"],
+ [class~="bg-port-warning/20"], [class~="bg-port-warning/25"], [class~="bg-port-warning/30"]
+):is(
+ [class~="text-white"], [class~="text-black"],
+ [class^="text-white/"], [class*=" text-white/"],
+ [class^="text-black/"], [class*=" text-black/"]
+) {
+ color: rgb(var(--port-warning-text)) !important;
+}
+html[data-port-theme] :is(
+ [class~="bg-port-error/5"], [class~="bg-port-error/10"], [class~="bg-port-error/15"],
+ [class~="bg-port-error/20"], [class~="bg-port-error/25"], [class~="bg-port-error/30"]
+):is(
+ [class~="text-white"], [class~="text-black"],
+ [class^="text-white/"], [class*=" text-white/"],
+ [class^="text-black/"], [class*=" text-black/"]
+) {
+ color: rgb(var(--port-error-text)) !important;
+}
+
html[data-port-theme] .bg-port-border {
background: var(--port-control-bg) !important;
}
@@ -526,11 +863,11 @@ html[data-port-theme] .bg-port-accent {
box-shadow: var(--port-shadow-interactive);
}
-html[data-port-theme] [class~="bg-port-accent"][class~="text-white"] {
+html[data-port-theme] [class~="bg-port-accent"]:is([class~="text-white"], [class~="text-black"]) {
color: rgb(var(--port-on-accent)) !important;
}
-html[data-port-theme] [class~="bg-port-success"][class~="text-white"] {
+html[data-port-theme] [class~="bg-port-success"]:is([class~="text-white"], [class~="text-black"]) {
color: rgb(var(--port-on-success)) !important;
}
@@ -542,15 +879,15 @@ html[data-port-theme] :is(
.bg-green-400, .bg-green-500, .bg-green-600,
.bg-emerald-400, .bg-emerald-500, .bg-emerald-600,
.bg-lime-400, .bg-lime-500
-)[class~="text-white"] {
+):is([class~="text-white"], [class~="text-black"]) {
color: rgb(var(--port-on-success)) !important;
}
-html[data-port-theme] [class~="bg-port-warning"][class~="text-white"] {
+html[data-port-theme] [class~="bg-port-warning"]:is([class~="text-white"], [class~="text-black"]) {
color: rgb(var(--port-on-warning)) !important;
}
-html[data-port-theme] [class~="bg-port-error"][class~="text-white"] {
+html[data-port-theme] [class~="bg-port-error"]:is([class~="text-white"], [class~="text-black"]) {
color: rgb(var(--port-on-error)) !important;
}
@@ -685,21 +1022,8 @@ html[data-port-theme-mode="day"] [class~="border-slate-700/50"] {
border-color: rgb(var(--port-border) / calc(var(--port-border-alpha) * 1.4)) !important;
}
-/* Solid dark gray backgrounds (cards, modals, panels) — without these, pages
- like DataDog/Jira/GitHub render dark cards under day-mode dark text. */
-html[data-port-theme-mode="day"] :is(.bg-gray-800, .bg-zinc-800, .bg-neutral-800, .bg-slate-800) {
- background-color: rgb(var(--port-card) / var(--port-card-alpha)) !important;
-}
-
-html[data-port-theme-mode="day"] :is(.bg-gray-900, .bg-zinc-900, .bg-neutral-900, .bg-slate-900) {
- background-color: rgb(var(--port-bg) / var(--port-bg-alpha)) !important;
-}
-
-/* Mid-gray surfaces — input wells, badges, secondary buttons, sub-sections.
- Map to control-bg so they stay visually distinct from cards. */
-html[data-port-theme-mode="day"] :is(.bg-gray-700, .bg-zinc-700, .bg-neutral-700, .bg-slate-700, .bg-gray-600, .bg-zinc-600, .bg-neutral-600, .bg-slate-600) {
- background-color: var(--port-control-bg) !important;
-}
+/* Day-mode alpha variants and interaction states need separate compositing
+ values; the solid neutral aliases live in the shared contract above. */
/* Toggle off-state track. The global bg-gray-600 → --port-control-bg remap
above turns ToggleSwitch's inactive track into the same cream as the page,
@@ -713,10 +1037,6 @@ html[data-port-theme-mode="day"] .port-toggle-track-off {
background-color: rgb(var(--port-text-muted) / 0.7) !important;
}
-html[data-port-theme-mode="day"] :is(.bg-gray-500, .bg-zinc-500, .bg-neutral-500, .bg-slate-500) {
- background-color: var(--port-control-bg-hover) !important;
-}
-
html[data-port-theme-mode="day"] [class~="bg-gray-800/30"],
html[data-port-theme-mode="day"] [class~="bg-gray-800/40"],
html[data-port-theme-mode="day"] [class~="bg-gray-800/50"],
@@ -786,110 +1106,9 @@ html[data-port-theme-mode="day"] [class~="bg-indigo-500/20"] {
background-color: rgb(var(--port-accent) / 0.18) !important;
}
-html[data-port-theme-mode="day"] [class~="text-indigo-400"],
-html[data-port-theme-mode="day"] [class~="text-indigo-400/70"] {
- color: rgb(var(--port-accent)) !important;
-}
-
-/* Day-mode chip + action-button text colors. The 100–500 Tailwind tones are
- designed for dark-mode surfaces (e.g. `bg-cyan-500/20 text-cyan-400`, or
- `bg-purple-600/30 text-purple-200`) — on the cream / white day backgrounds
- they wash out to near-invisible and make enabled action buttons look
- disabled. Remap to the 700 (or 800 for yellow, which stays warm at 700)
- tone in the same hue family so each chip / button keeps its semantic color
- but reads clearly. The 100/200 tints are remapped to the same dark target
- as 300/400/500 so the only visible difference between an enabled and a
- disabled button is the explicit `disabled:opacity-50` (or similar). */
-html[data-port-theme-mode="day"] [class~="text-cyan-100"],
-html[data-port-theme-mode="day"] [class~="text-cyan-200"],
-html[data-port-theme-mode="day"] [class~="text-cyan-300"],
-html[data-port-theme-mode="day"] [class~="text-cyan-400"],
-html[data-port-theme-mode="day"] [class~="text-cyan-500"] { color: rgb(14 116 144) !important; }
-html[data-port-theme-mode="day"] [class~="text-sky-100"],
-html[data-port-theme-mode="day"] [class~="text-sky-200"],
-html[data-port-theme-mode="day"] [class~="text-sky-300"],
-html[data-port-theme-mode="day"] [class~="text-sky-400"] { color: rgb(3 105 161) !important; }
-html[data-port-theme-mode="day"] [class~="text-blue-100"],
-html[data-port-theme-mode="day"] [class~="text-blue-200"],
-html[data-port-theme-mode="day"] [class~="text-blue-300"],
-html[data-port-theme-mode="day"] [class~="text-blue-400"] { color: rgb(29 78 216) !important; }
-html[data-port-theme-mode="day"] [class~="text-indigo-100"],
-html[data-port-theme-mode="day"] [class~="text-indigo-200"],
-html[data-port-theme-mode="day"] [class~="text-indigo-300"] { color: rgb(55 48 163) !important; }
-html[data-port-theme-mode="day"] [class~="text-purple-100"],
-html[data-port-theme-mode="day"] [class~="text-purple-200"],
-html[data-port-theme-mode="day"] [class~="text-purple-300"],
-html[data-port-theme-mode="day"] [class~="text-purple-400"],
-html[data-port-theme-mode="day"] [class~="text-purple-500"] { color: rgb(126 34 206) !important; }
-html[data-port-theme-mode="day"] [class~="text-violet-100"],
-html[data-port-theme-mode="day"] [class~="text-violet-200"],
-html[data-port-theme-mode="day"] [class~="text-violet-300"],
-html[data-port-theme-mode="day"] [class~="text-violet-400"] { color: rgb(109 40 217) !important; }
-html[data-port-theme-mode="day"] [class~="text-fuchsia-200"],
-html[data-port-theme-mode="day"] [class~="text-fuchsia-300"],
-html[data-port-theme-mode="day"] [class~="text-fuchsia-400"] { color: rgb(162 28 175) !important; }
-html[data-port-theme-mode="day"] [class~="text-pink-100"],
-html[data-port-theme-mode="day"] [class~="text-pink-200"],
-html[data-port-theme-mode="day"] [class~="text-pink-300"],
-html[data-port-theme-mode="day"] [class~="text-pink-400"],
-html[data-port-theme-mode="day"] [class~="text-pink-500"] { color: rgb(190 24 93) !important; }
-html[data-port-theme-mode="day"] [class~="text-rose-200"],
-html[data-port-theme-mode="day"] [class~="text-rose-300"],
-html[data-port-theme-mode="day"] [class~="text-rose-400"] { color: rgb(190 18 60) !important; }
-html[data-port-theme-mode="day"] [class~="text-red-100"],
-html[data-port-theme-mode="day"] [class~="text-red-200"],
-html[data-port-theme-mode="day"] [class~="text-red-300"],
-html[data-port-theme-mode="day"] [class~="text-red-400"],
-html[data-port-theme-mode="day"] [class~="text-red-500"] { color: rgb(185 28 28) !important; }
-html[data-port-theme-mode="day"] [class~="text-orange-100"],
-html[data-port-theme-mode="day"] [class~="text-orange-200"],
-html[data-port-theme-mode="day"] [class~="text-orange-300"],
-html[data-port-theme-mode="day"] [class~="text-orange-400"] { color: rgb(194 65 12) !important; }
-html[data-port-theme-mode="day"] [class~="text-amber-100"],
-html[data-port-theme-mode="day"] [class~="text-amber-200"],
-html[data-port-theme-mode="day"] [class~="text-amber-300"],
-html[data-port-theme-mode="day"] [class~="text-amber-400"],
-html[data-port-theme-mode="day"] [class~="text-amber-500"] { color: rgb(180 83 9) !important; }
-html[data-port-theme-mode="day"] [class~="text-yellow-100"],
-html[data-port-theme-mode="day"] [class~="text-yellow-200"],
-html[data-port-theme-mode="day"] [class~="text-yellow-300"],
-html[data-port-theme-mode="day"] [class~="text-yellow-400"],
-html[data-port-theme-mode="day"] [class~="text-yellow-500"] { color: rgb(133 77 14) !important; }
-html[data-port-theme-mode="day"] [class~="text-lime-200"],
-html[data-port-theme-mode="day"] [class~="text-lime-300"],
-html[data-port-theme-mode="day"] [class~="text-lime-400"] { color: rgb(77 124 15) !important; }
-html[data-port-theme-mode="day"] [class~="text-green-100"],
-html[data-port-theme-mode="day"] [class~="text-green-200"],
-html[data-port-theme-mode="day"] [class~="text-green-300"],
-html[data-port-theme-mode="day"] [class~="text-green-400"],
-html[data-port-theme-mode="day"] [class~="text-green-500"] { color: rgb(21 128 61) !important; }
-html[data-port-theme-mode="day"] [class~="text-emerald-100"],
-html[data-port-theme-mode="day"] [class~="text-emerald-200"],
-html[data-port-theme-mode="day"] [class~="text-emerald-300"],
-html[data-port-theme-mode="day"] [class~="text-emerald-400"],
-html[data-port-theme-mode="day"] [class~="text-emerald-500"] { color: rgb(4 120 87) !important; }
-html[data-port-theme-mode="day"] [class~="text-teal-200"],
-html[data-port-theme-mode="day"] [class~="text-teal-300"],
-html[data-port-theme-mode="day"] [class~="text-teal-400"] { color: rgb(15 118 110) !important; }
-
-/* hover: variants used on chips and buttons */
-html[data-port-theme-mode="day"] [class~="hover:text-cyan-300"]:hover,
-html[data-port-theme-mode="day"] [class~="hover:text-cyan-400"]:hover { color: rgb(14 116 144) !important; }
-html[data-port-theme-mode="day"] [class~="hover:text-blue-300"]:hover,
-html[data-port-theme-mode="day"] [class~="hover:text-blue-400"]:hover { color: rgb(29 78 216) !important; }
-html[data-port-theme-mode="day"] [class~="hover:text-purple-300"]:hover,
-html[data-port-theme-mode="day"] [class~="hover:text-purple-400"]:hover { color: rgb(126 34 206) !important; }
-html[data-port-theme-mode="day"] [class~="hover:text-pink-400"]:hover { color: rgb(190 24 93) !important; }
-html[data-port-theme-mode="day"] [class~="hover:text-red-300"]:hover,
-html[data-port-theme-mode="day"] [class~="hover:text-red-400"]:hover { color: rgb(185 28 28) !important; }
-html[data-port-theme-mode="day"] [class~="hover:text-orange-400"]:hover { color: rgb(194 65 12) !important; }
-html[data-port-theme-mode="day"] [class~="hover:text-amber-400"]:hover { color: rgb(180 83 9) !important; }
-html[data-port-theme-mode="day"] [class~="hover:text-yellow-300"]:hover,
-html[data-port-theme-mode="day"] [class~="hover:text-yellow-400"]:hover,
-html[data-port-theme-mode="day"] [class~="hover:text-yellow-500"]:hover { color: rgb(133 77 14) !important; }
-html[data-port-theme-mode="day"] [class~="hover:text-green-400"]:hover { color: rgb(21 128 61) !important; }
-html[data-port-theme-mode="day"] [class~="hover:text-emerald-400"]:hover { color: rgb(4 120 87) !important; }
-html[data-port-theme-mode="day"] [class~="hover:text-teal-400"]:hover { color: rgb(15 118 110) !important; }
+/* Legacy hue utilities are normalized by the shared foreground contract
+ above for both day and night. Keeping one rule set prevents a day-only
+ literal palette from drifting away from the eight theme tokens. */
/* hover variants of near-white utilities — without these, hover:text-white on a
* gray-on-light element flashes pure white-on-light and becomes unreadable
@@ -906,6 +1125,43 @@ html[data-port-theme-mode="day"] [class~="hover:text-slate-100"]:hover {
color: rgb(var(--port-text)) !important;
}
+/* Fixed black overlays are intentionally outside the theme surface palette
+ * (media scrims, lightbox controls, and timeline labels). Keep their light
+ * utility ink light in day mode instead of applying the page-text remap. */
+html[data-port-theme-mode="day"] :is(.bg-black, [class^="bg-black/"], [class*=" bg-black/"]):is(
+ [class~="text-white"], [class^="text-white/"], [class*=" text-white/"],
+ [class~="text-zinc-50"], [class~="text-zinc-100"], [class^="text-zinc-50/"], [class^="text-zinc-100/"], [class*=" text-zinc-50/"], [class*=" text-zinc-100/"],
+ [class~="text-neutral-50"], [class~="text-neutral-100"], [class^="text-neutral-50/"], [class^="text-neutral-100/"], [class*=" text-neutral-50/"], [class*=" text-neutral-100/"],
+ [class~="text-gray-50"], [class~="text-gray-100"], [class^="text-gray-50/"], [class^="text-gray-100/"], [class*=" text-gray-50/"], [class*=" text-gray-100/"],
+ [class~="text-slate-50"], [class~="text-slate-100"], [class^="text-slate-50/"], [class^="text-slate-100/"], [class*=" text-slate-50/"], [class*=" text-slate-100/"]
+) {
+ color: rgb(255 255 255) !important;
+}
+html[data-port-theme-mode="day"] :is(.bg-black, [class^="bg-black/"], [class*=" bg-black/"]):is(
+ [class~="text-zinc-200"], [class~="text-zinc-300"], [class^="text-zinc-200/"], [class^="text-zinc-300/"], [class*=" text-zinc-200/"], [class*=" text-zinc-300/"],
+ [class~="text-neutral-200"], [class~="text-neutral-300"], [class^="text-neutral-200/"], [class^="text-neutral-300/"], [class*=" text-neutral-200/"], [class*=" text-neutral-300/"],
+ [class~="text-gray-200"], [class~="text-gray-300"], [class^="text-gray-200/"], [class^="text-gray-300/"], [class*=" text-gray-200/"], [class*=" text-gray-300/"],
+ [class~="text-slate-200"], [class~="text-slate-300"], [class^="text-slate-200/"], [class^="text-slate-300/"], [class*=" text-slate-200/"], [class*=" text-slate-300/"]
+) {
+ color: rgb(212 212 216) !important;
+}
+html[data-port-theme-mode="day"] :is(.bg-black, [class^="bg-black/"], [class*=" bg-black/"]):is(
+ [class~="text-zinc-400"], [class~="text-zinc-500"], [class^="text-zinc-400/"], [class^="text-zinc-500/"], [class*=" text-zinc-400/"], [class*=" text-zinc-500/"],
+ [class~="text-neutral-400"], [class~="text-neutral-500"], [class^="text-neutral-400/"], [class^="text-neutral-500/"], [class*=" text-neutral-400/"], [class*=" text-neutral-500/"],
+ [class~="text-gray-400"], [class~="text-gray-500"], [class^="text-gray-400/"], [class^="text-gray-500/"], [class*=" text-gray-400/"], [class*=" text-gray-500/"],
+ [class~="text-slate-400"], [class~="text-slate-500"], [class^="text-slate-400/"], [class^="text-slate-500/"], [class*=" text-slate-400/"], [class*=" text-slate-500/"]
+) {
+ color: rgb(161 161 170) !important;
+}
+html[data-port-theme-mode="day"] :is(.bg-black, [class^="bg-black/"], [class*=" bg-black/"]):is(
+ [class*="hover:text-white"], [class*="hover:text-zinc-50"], [class*="hover:text-zinc-100"],
+ [class*="hover:text-neutral-50"], [class*="hover:text-neutral-100"],
+ [class*="hover:text-gray-50"], [class*="hover:text-gray-100"],
+ [class*="hover:text-slate-50"], [class*="hover:text-slate-100"]
+):hover {
+ color: rgb(255 255 255) !important;
+}
+
/* Keep text contrast on always-dark panels (e.g. video overlays, 3D canvas control panels, HUDs) in day mode */
html[data-port-theme-mode="day"] .always-dark :is(.text-white, .text-zinc-50, .text-zinc-100, .text-neutral-50, .text-neutral-100, .text-gray-50, .text-gray-100, .text-slate-50, .text-slate-100) {
color: rgb(255 255 255) !important;
diff --git a/client/src/themes/portosThemes.js b/client/src/themes/portosThemes.js
index 6fc5f373a9..9492438bc4 100644
--- a/client/src/themes/portosThemes.js
+++ b/client/src/themes/portosThemes.js
@@ -4,12 +4,17 @@ const baseStatusColors = {
'--port-success': '34 197 94',
'--port-warning': '245 158 11',
'--port-error': '239 68 68',
- // White on #22c55e / #16a34a fails WCAG AA (~2.0 / ~3.0). Dark forest green
- // hits ~9.5 / ~6.0 — safe for both Classic Midnight (bright green) and the
- // light themes that inherit this default.
+ // `on-*` tokens are for text inside filled controls. The `*-text` tokens are
+ // for semantic text on page/card surfaces; the two contexts need different
+ // colors in several day themes.
'--port-on-success': '5 46 22',
'--port-on-warning': '17 24 39',
- '--port-on-error': '255 255 255',
+ '--port-on-error': '48 8 8',
+ '--port-success-text': '134 239 172',
+ '--port-warning-text': '252 211 77',
+ '--port-error-text': '253 164 175',
+ '--port-accent-text': '96 165 250',
+ '--port-text-subtle': '140 140 149',
};
// Secondary accent — a semantic home for the "purple/violet" highlight used
@@ -19,7 +24,8 @@ const baseStatusColors = {
// any future theme that forgets to set one explicitly.
const DEFAULT_ACCENT2 = {
'--port-accent-2': '168 85 247',
- '--port-on-accent-2': '255 255 255',
+ '--port-on-accent-2': '37 7 56',
+ '--port-accent-2-text': '216 180 254',
};
const baseMotionTokens = {
@@ -44,20 +50,22 @@ export const THEMES = {
concept: 'The existing PortOS interface, kept as the stable baseline.',
family: 'classic',
mode: 'night',
- accent: '#3b82f6',
+ accent: '#2563eb',
doc: '/docs/themes/classic-midnight.md',
colorScheme: 'dark',
density: 'comfortable',
- swatches: ['#0f0f0f', '#1e1e1e', '#3b82f6', '#22c55e'],
+ swatches: ['#0f0f0f', '#1e1e1e', '#2563eb', '#22c55e'],
colors: {
'--port-bg': '15 15 15',
'--port-card': '30 30 30',
'--port-border': '42 42 42',
- '--port-accent': '59 130 246',
- '--port-text': '229 229 229',
- '--port-text-muted': '163 163 163',
+ '--port-accent': '37 99 235',
+ '--port-text': '212 212 216',
+ '--port-text-muted': '161 161 170',
+ '--port-text-subtle': '140 140 149',
+ '--port-accent-text': '96 165 250',
'--port-control-text': '212 212 216',
- '--port-focus-ring': '59 130 246',
+ '--port-focus-ring': '37 99 235',
'--port-on-accent': '255 255 255',
...baseStatusColors,
...DEFAULT_ACCENT2,
@@ -93,8 +101,8 @@ export const THEMES = {
'--port-active-bg': 'rgb(var(--port-accent) / 0.1)',
'--port-hover-bg': 'rgb(var(--port-border) / 0.5)',
'--port-terminal-bg': 'rgb(7 7 7)',
- '--port-terminal-text': 'rgb(229 229 229)',
- '--port-chart-1': '59 130 246',
+ '--port-terminal-text': 'rgb(212 212 216)',
+ '--port-chart-1': '37 99 235',
'--port-chart-2': '34 197 94',
'--port-chart-3': '245 158 11',
'--port-chart-4': '236 72 153',
@@ -109,33 +117,43 @@ export const THEMES = {
concept: 'Classic Midnight reflected to a clean white workspace — same blue accent, daylight legibility.',
family: 'classic',
mode: 'day',
- accent: '#3b82f6',
+ accent: '#2563eb',
doc: '/docs/themes/classic-midnight.md',
colorScheme: 'light',
density: 'comfortable',
- swatches: ['#f0f0f0', '#ffffff', '#3b82f6', '#16a34a'],
+ swatches: ['#f0f0f0', '#ffffff', '#2563eb', '#166534'],
colors: {
'--port-bg': '240 240 240',
'--port-card': '255 255 255',
'--port-border': '212 212 216',
'--port-accent': '37 99 235',
- '--port-text': '23 23 23',
+ '--port-text': '39 39 42',
'--port-text-muted': '82 82 91',
'--port-control-text': '38 38 38',
'--port-focus-ring': '37 99 235',
'--port-on-accent': '255 255 255',
...baseStatusColors,
- '--port-success': '22 163 74',
+ // Keep tertiary labels and semantic foregrounds readable on the light
+ // page instead of inheriting the brighter night-theme defaults.
+ '--port-text-subtle': '90 90 100',
+ '--port-accent-text': '26 70 193',
+ '--port-success': '22 101 52',
+ '--port-success-text': '19 88 45',
+ '--port-on-success': '255 255 255',
// Darken warning to amber-700 (+ white on-warning) like the other day themes —
// the base bright amber (#f59e0b) washes out as foreground on the light bg,
// most visibly as ANSI yellow in the shell terminal, which tracks --port-warning.
- '--port-warning': '180 83 9',
+ '--port-warning': '161 98 7',
+ '--port-warning-text': '120 69 13',
'--port-on-warning': '255 255 255',
- '--port-error': '220 38 38',
+ '--port-error': '185 28 28',
+ '--port-error-text': '146 22 22',
+ '--port-on-error': '255 255 255',
// violet-700 — darkened from the night theme's violet-500 for AA contrast
// on the white card background.
'--port-accent-2': '109 40 217',
'--port-on-accent-2': '255 255 255',
+ '--port-accent-2-text': '95 34 191',
},
tokens: {
...classicShapeTokens,
@@ -168,7 +186,7 @@ export const THEMES = {
'--port-active-bg': 'rgb(var(--port-accent) / 0.1)',
'--port-hover-bg': 'rgb(0 0 0 / 0.04)',
'--port-terminal-bg': 'rgb(247 247 248)',
- '--port-terminal-text': 'rgb(23 23 23)',
+ '--port-terminal-text': 'rgb(39 39 42)',
'--port-chart-1': '37 99 235',
'--port-chart-2': '22 163 74',
'--port-chart-3': '202 138 4',
@@ -195,8 +213,11 @@ export const THEMES = {
'--port-border': '129 229 255',
'--port-accent': '103 232 249',
'--port-success': '74 222 128',
+ '--port-success-text': '134 239 172',
'--port-warning': '251 191 36',
+ '--port-warning-text': '252 211 77',
'--port-error': '251 113 133',
+ '--port-error-text': '253 164 175',
'--port-on-accent': '4 35 44',
'--port-on-success': '6 43 24',
'--port-on-warning': '55 37 5',
@@ -205,8 +226,11 @@ export const THEMES = {
// the cyan accent and rose error.
'--port-accent-2': '192 132 252',
'--port-on-accent-2': '37 7 56',
- '--port-text': '236 253 255',
- '--port-text-muted': '160 190 202',
+ '--port-accent-2-text': '216 180 254',
+ '--port-text': '213 232 237',
+ '--port-text-muted': '154 182 192',
+ '--port-text-subtle': '127 154 165',
+ '--port-accent-text': '113 233 249',
'--port-control-text': '220 247 252',
'--port-focus-ring': '103 232 249',
},
@@ -245,7 +269,7 @@ export const THEMES = {
'--port-active-bg': 'linear-gradient(135deg, rgb(var(--port-accent) / 0.18), rgb(251 113 133 / 0.12))',
'--port-hover-bg': 'rgb(255 255 255 / 0.08)',
'--port-terminal-bg': 'rgb(5 12 16 / 0.86)',
- '--port-terminal-text': 'rgb(218 252 255)',
+ '--port-terminal-text': 'rgb(213 232 237)',
'--port-chart-1': '103 232 249',
'--port-chart-2': '74 222 128',
'--port-chart-3': '251 191 36',
@@ -261,31 +285,36 @@ export const THEMES = {
concept: 'Lumen Glass at noon — cream-and-cyan glass panels floating on a sunlit drifting mesh.',
family: 'glass',
mode: 'day',
- accent: '#0891b2',
+ accent: '#155e75',
doc: '/docs/themes/lumen-glass.md',
colorScheme: 'light',
density: 'spacious',
- swatches: ['#eae4db', '#ffffff', '#0891b2', '#fb7185'],
+ swatches: ['#eae4db', '#ffffff', '#155e75', '#fb7185'],
colors: {
'--port-bg': '234 228 219',
'--port-card': '255 255 255',
- '--port-border': '8 145 178',
- '--port-accent': '8 145 178',
- '--port-success': '22 163 74',
- '--port-warning': '202 138 4',
+ '--port-border': '21 94 117',
+ '--port-accent': '21 94 117',
+ '--port-success': '22 101 52',
+ '--port-success-text': '18 84 43',
+ '--port-warning': '161 98 7',
+ '--port-warning-text': '115 67 12',
'--port-error': '225 29 72',
+ '--port-error-text': '144 14 46',
'--port-on-accent': '255 255 255',
- '--port-on-success': '5 46 22',
- // Black on #ca8a04 is ~7.15:1 (AA) vs white's ~2.94:1 (fails). See #2626.
- '--port-on-warning': '0 0 0',
+ '--port-on-success': '255 255 255',
+ '--port-on-warning': '255 255 255',
'--port-on-error': '255 255 255',
// violet-700 — darkened for AA contrast on the cream/white glass panels.
'--port-accent-2': '126 34 206',
'--port-on-accent-2': '255 255 255',
- '--port-text': '12 30 36',
+ '--port-accent-2-text': '99 27 162',
+ '--port-text': '25 52 60',
'--port-text-muted': '78 102 110',
+ '--port-text-subtle': '70 92 101',
+ '--port-accent-text': '18 80 99',
'--port-control-text': '36 60 70',
- '--port-focus-ring': '8 145 178',
+ '--port-focus-ring': '21 94 117',
},
tokens: {
...baseMotionTokens,
@@ -323,11 +352,11 @@ export const THEMES = {
'--port-hover-bg': 'rgb(8 80 110 / 0.06)',
'--port-terminal-bg': 'rgb(255 255 255 / 0.85)',
'--port-terminal-text': 'rgb(36 60 70)',
- '--port-chart-1': '8 145 178',
+ '--port-chart-1': '21 94 117',
'--port-chart-2': '22 163 74',
'--port-chart-3': '202 138 4',
'--port-chart-4': '225 29 72',
- '--port-chart-grid': '8 80 110',
+ '--port-chart-grid': '21 94 117',
},
},
@@ -349,18 +378,24 @@ export const THEMES = {
'--port-border': '0 245 160',
'--port-accent': '0 245 160',
'--port-success': '45 255 136',
+ '--port-success-text': '85 226 137',
'--port-warning': '255 214 10',
+ '--port-warning-text': '236 193 54',
'--port-error': '255 47 117',
+ '--port-error-text': '255 113 145',
'--port-on-accent': '0 22 14',
'--port-on-success': '0 28 12',
'--port-on-warning': '26 20 0',
- '--port-on-error': '255 255 255',
+ '--port-on-error': '48 5 24',
// Neon violet — distinct from the neon-green accent and magenta chart-2,
// matching the cyberpunk palette's saturation.
'--port-accent-2': '178 102 255',
'--port-on-accent-2': '20 0 38',
- '--port-text': '218 255 238',
+ '--port-accent-2-text': '196 138 255',
+ '--port-text': '185 222 201',
'--port-text-muted': '112 166 139',
+ '--port-text-subtle': '96 145 119',
+ '--port-accent-text': '0 224 147',
'--port-control-text': '207 255 230',
'--port-focus-ring': '0 245 160',
},
@@ -401,7 +436,7 @@ export const THEMES = {
'--port-active-bg': 'linear-gradient(90deg, rgb(var(--port-accent) / 0.18), rgb(255 43 214 / 0.08))',
'--port-hover-bg': 'rgb(var(--port-accent) / 0.08)',
'--port-terminal-bg': 'rgb(0 0 0)',
- '--port-terminal-text': 'rgb(0 245 160)',
+ '--port-terminal-text': 'rgb(0 194 127)',
'--port-chart-1': '0 245 160',
'--port-chart-2': '255 43 214',
'--port-chart-3': '255 214 10',
@@ -417,31 +452,36 @@ export const THEMES = {
concept: 'Black ICE Terminal printed on cream paper — green ink, pixel grid, line-printer report aesthetic.',
family: 'terminal',
mode: 'day',
- accent: '#0a7a4a',
+ accent: '#086c43',
doc: '/docs/themes/black-ice-terminal.md',
colorScheme: 'light',
density: 'compact',
- swatches: ['#ece6d5', '#fbf6e8', '#0a7a4a', '#b91d6a'],
+ swatches: ['#ece6d5', '#fbf6e8', '#086c43', '#b91d6a'],
colors: {
'--port-bg': '236 230 213',
'--port-card': '251 246 232',
- '--port-border': '10 122 74',
- '--port-accent': '10 122 74',
- '--port-success': '22 122 60',
- '--port-warning': '170 110 0',
+ '--port-border': '8 108 67',
+ '--port-accent': '8 108 67',
+ '--port-success': '22 101 52',
+ '--port-success-text': '18 84 43',
+ '--port-warning': '133 77 14',
+ '--port-warning-text': '111 64 12',
'--port-error': '185 29 106',
+ '--port-error-text': '137 21 78',
'--port-on-accent': '255 255 255',
'--port-on-success': '255 255 255',
- // Black on #aa6e00 is ~4.94:1 (AA) vs white's ~4.25:1 (fails small text). See #2626.
- '--port-on-warning': '0 0 0',
+ '--port-on-warning': '255 255 255',
'--port-on-error': '255 255 255',
// Plum ink — readable on cream paper, distinct from the rose error ink.
'--port-accent-2': '106 27 154',
'--port-on-accent-2': '255 255 255',
- '--port-text': '14 56 36',
- '--port-text-muted': '76 110 86',
+ '--port-accent-2-text': '102 26 148',
+ '--port-text': '22 75 50',
+ '--port-text-muted': '65 99 76',
+ '--port-text-subtle': '76 110 86',
+ '--port-accent-text': '6 85 53',
'--port-control-text': '20 70 46',
- '--port-focus-ring': '10 122 74',
+ '--port-focus-ring': '8 108 67',
},
tokens: {
'--port-motion-fast': '80ms',
@@ -480,12 +520,12 @@ export const THEMES = {
'--port-active-bg': 'linear-gradient(90deg, rgb(var(--port-accent) / 0.16), rgb(185 29 106 / 0.08))',
'--port-hover-bg': 'rgb(var(--port-accent) / 0.08)',
'--port-terminal-bg': 'rgb(248 242 226)',
- '--port-terminal-text': 'rgb(10 122 74)',
- '--port-chart-1': '10 122 74',
+ '--port-terminal-text': 'rgb(8 108 67)',
+ '--port-chart-1': '8 108 67',
'--port-chart-2': '185 29 106',
'--port-chart-3': '170 110 0',
'--port-chart-4': '8 100 134',
- '--port-chart-grid': '10 122 74',
+ '--port-chart-grid': '8 108 67',
},
},
@@ -516,8 +556,14 @@ export const THEMES = {
// Indigo — fits the schematic blueprint palette alongside the blue accent.
'--port-accent-2': '129 140 248',
'--port-on-accent-2': '17 19 46',
- '--port-text': '239 246 255',
+ '--port-accent-2-text': '168 176 250',
+ '--port-success-text': '71 215 162',
+ '--port-warning-text': '246 171 44',
+ '--port-error-text': '250 148 148',
+ '--port-text': '190 207 231',
'--port-text-muted': '156 178 204',
+ '--port-text-subtle': '126 150 179',
+ '--port-accent-text': '136 188 251',
'--port-control-text': '224 236 251',
'--port-focus-ring': '96 165 250',
},
@@ -582,8 +628,10 @@ export const THEMES = {
'--port-card': '255 255 255',
'--port-border': '37 99 235',
'--port-accent': '29 78 216',
- '--port-success': '21 128 61',
- '--port-warning': '180 83 9',
+ '--port-success': '22 101 52',
+ '--port-success-text': '19 88 45',
+ '--port-warning': '161 98 7',
+ '--port-warning-text': '120 69 13',
'--port-error': '185 28 28',
'--port-on-accent': '255 255 255',
'--port-on-success': '255 255 255',
@@ -592,8 +640,12 @@ export const THEMES = {
// Indigo-700 — darkened for AA contrast on white drafting paper.
'--port-accent-2': '67 56 202',
'--port-on-accent-2': '255 255 255',
- '--port-text': '11 23 50',
+ '--port-accent-2-text': '61 50 189',
+ '--port-error-text': '146 22 22',
+ '--port-text': '30 42 68',
'--port-text-muted': '71 85 105',
+ '--port-text-subtle': '84 100 122',
+ '--port-accent-text': '24 65 180',
'--port-control-text': '23 37 84',
'--port-focus-ring': '29 78 216',
},
diff --git a/client/src/themes/portosThemes.test.js b/client/src/themes/portosThemes.test.js
index 2d1fcd4a18..236049cb21 100644
--- a/client/src/themes/portosThemes.test.js
+++ b/client/src/themes/portosThemes.test.js
@@ -21,6 +21,67 @@ const contrastRatio = (a, b) => {
};
const AA_SMALL_TEXT = 4.5;
+const MAX_COMFORTABLE_TEXT_CONTRAST = 15.5;
+
+const REQUIRED_COLOR_TOKENS = [
+ '--port-bg',
+ '--port-card',
+ '--port-border',
+ '--port-accent',
+ '--port-accent-text',
+ '--port-accent-2',
+ '--port-accent-2-text',
+ '--port-success',
+ '--port-success-text',
+ '--port-warning',
+ '--port-warning-text',
+ '--port-error',
+ '--port-error-text',
+ '--port-text',
+ '--port-text-muted',
+ '--port-text-subtle',
+ '--port-on-accent',
+ '--port-on-accent-2',
+ '--port-on-success',
+ '--port-on-warning',
+ '--port-on-error',
+];
+
+const SURFACE_TEXT_TOKENS = [
+ '--port-text',
+ '--port-text-muted',
+ '--port-text-subtle',
+ '--port-accent-text',
+ '--port-accent-2-text',
+ '--port-success-text',
+ '--port-warning-text',
+ '--port-error-text',
+];
+
+const FILLED_CONTROL_PAIRS = [
+ ['--port-accent', '--port-on-accent'],
+ ['--port-accent-2', '--port-on-accent-2'],
+ ['--port-success', '--port-on-success'],
+ ['--port-warning', '--port-on-warning'],
+ ['--port-error', '--port-on-error'],
+];
+
+const TONAL_TEXT_PAIRS = [
+ ['--port-accent', '--port-accent-text'],
+ ['--port-accent-2', '--port-accent-2-text'],
+ ['--port-success', '--port-success-text'],
+ ['--port-warning', '--port-warning-text'],
+ ['--port-error', '--port-error-text'],
+];
+
+const TONAL_ALPHA_STEPS = [0.05, 0.08, 0.1, 0.15, 0.2, 0.25, 0.3];
+
+const minimumCardSurface = (theme) => {
+ const bg = parseRgb(theme.colors['--port-bg']);
+ const card = parseRgb(theme.colors['--port-card']);
+ const floor = Number(theme.tokens['--port-card-min-alpha']);
+ return card.map((channel, index) => floor * channel + (1 - floor) * bg[index]);
+};
describe('portosThemes warning token contrast', () => {
const entries = Object.values(THEMES);
@@ -40,6 +101,85 @@ describe('portosThemes warning token contrast', () => {
);
});
+describe('shared eight-theme color contract', () => {
+ const entries = Object.values(THEMES);
+
+ it('keeps four day/night variants on the same token surface', () => {
+ expect(entries).toHaveLength(8);
+ expect(entries.filter((theme) => theme.mode === 'day')).toHaveLength(4);
+ expect(entries.filter((theme) => theme.mode === 'night')).toHaveLength(4);
+ expect(new Set(entries.map((theme) => theme.family))).toEqual(new Set(['classic', 'glass', 'terminal', 'blueprint']));
+ });
+
+ it.each(entries.map((theme) => [theme.id, theme]))(
+ '%s: defines valid RGB values for every shared color token',
+ (_id, theme) => {
+ for (const token of REQUIRED_COLOR_TOKENS) {
+ const value = parseRgb(theme.colors[token]);
+ expect(value, token).toHaveLength(3);
+ expect(value.every((channel) => Number.isInteger(channel) && channel >= 0 && channel <= 255), token).toBe(true);
+ }
+ },
+ );
+
+ it.each(entries.map((theme) => [theme.id, theme]))(
+ '%s: keeps surface text readable without extreme contrast',
+ (_id, theme) => {
+ const surfaces = [
+ parseRgb(theme.colors['--port-bg']),
+ parseRgb(theme.colors['--port-card']),
+ minimumCardSurface(theme),
+ ];
+ for (const token of SURFACE_TEXT_TOKENS) {
+ for (const surface of surfaces) {
+ const ratio = contrastRatio(parseRgb(theme.colors[token]), surface);
+ expect(ratio, `${token} on ${surface.join(' ')}`).toBeGreaterThanOrEqual(AA_SMALL_TEXT);
+ expect(ratio, `${token} on ${surface.join(' ')}`).toBeLessThanOrEqual(MAX_COMFORTABLE_TEXT_CONTRAST);
+ }
+ }
+ },
+ );
+
+ it.each(entries.map((theme) => [theme.id, theme]))(
+ '%s: keeps ink readable inside every filled semantic control',
+ (_id, theme) => {
+ for (const [fillToken, inkToken] of FILLED_CONTROL_PAIRS) {
+ const ratio = contrastRatio(
+ parseRgb(theme.colors[fillToken]),
+ parseRgb(theme.colors[inkToken]),
+ );
+ expect(ratio, `${inkToken} on ${fillToken}`).toBeGreaterThanOrEqual(AA_SMALL_TEXT);
+ expect(ratio, `${inkToken} on ${fillToken}`).toBeLessThanOrEqual(MAX_COMFORTABLE_TEXT_CONTRAST);
+ }
+ },
+ );
+
+ it.each(entries.map((theme) => [theme.id, theme]))(
+ '%s: keeps semantic text readable on tonal fills through 30% opacity',
+ (_id, theme) => {
+ const page = parseRgb(theme.colors['--port-bg']);
+ const card = parseRgb(theme.colors['--port-card']);
+ const minimumCard = minimumCardSurface(theme);
+ for (const [fillToken, textToken] of TONAL_TEXT_PAIRS) {
+ const fill = parseRgb(theme.colors[fillToken]);
+ const ink = parseRgb(theme.colors[textToken]);
+ for (const surface of [page, card, minimumCard]) {
+ for (const alpha of TONAL_ALPHA_STEPS) {
+ const tonalSurface = fill.map((channel, index) => (
+ alpha * channel + (1 - alpha) * surface[index]
+ ));
+ const ratio = contrastRatio(ink, tonalSurface);
+ expect(ratio, `${textToken} on ${fillToken}/${alpha} over ${surface.join(' ')}`)
+ .toBeGreaterThanOrEqual(AA_SMALL_TEXT);
+ expect(ratio, `${textToken} on ${fillToken}/${alpha} over ${surface.join(' ')}`)
+ .toBeLessThanOrEqual(MAX_COMFORTABLE_TEXT_CONTRAST);
+ }
+ }
+ }
+ },
+ );
+});
+
describe('content cards read as raised surfaces in every theme', () => {
const entries = Object.values(THEMES);
diff --git a/docs/themes/README.md b/docs/themes/README.md
index 237a08baa0..7ba04302db 100644
--- a/docs/themes/README.md
+++ b/docs/themes/README.md
@@ -12,16 +12,19 @@ The current production UI remains available as `classic-midnight`. The three re-
New UI should use semantic PortOS tokens wherever possible:
-- Colors: `bg-port-bg`, `bg-port-card`, `border-port-border`, `text-port-accent`, `text-port-success`, `text-port-warning`, `text-port-error`.
-- Text: default body text inherits `rgb(var(--port-text))`; secondary text should use `text-gray-400` or `rgb(var(--port-text-muted))` when authoring CSS.
+- Colors: `bg-port-bg`, `bg-port-card`, `border-port-border`, and the semantic foreground tokens `text-port-accent`, `text-port-accent-2`, `text-port-success`, `text-port-warning`, and `text-port-error`.
+- Text: use `text-port-text`, `text-port-text-muted`, and `text-port-text-subtle` for primary, supporting, and tertiary copy. Their CSS variables are `--port-text`, `--port-text-muted`, and `--port-text-subtle`.
+- Filled-control ink: pair each semantic fill with its matching `text-port-on-*` token (`text-port-on-accent`, `text-port-on-accent-2`, `text-port-on-success`, `text-port-on-warning`, or `text-port-on-error`). These are intentionally separate from the surface-text tokens.
- Surfaces: prefer `bg-port-card border border-port-border rounded-lg` for panels and `bg-port-bg border border-port-border rounded-lg` for inset controls.
- Controls: inputs, textareas, and selects should use `bg-port-bg border border-port-border`; theme CSS supplies the material, radius, and focus behavior.
-- Buttons: use `bg-port-accent text-white` for filled primary actions, `bg-port-border text-gray-400 hover:text-white` for neutral actions, and `bg-port-*/20 text-port-*` for tonal status actions. The runtime maps those legacy utility pairs to theme-safe control fills and foreground colors.
+- Buttons: use `bg-port-accent text-port-on-accent` for filled primary actions, `bg-port-border text-port-text-muted hover:text-port-text` for neutral actions, and `bg-port-*/20 text-port-*` for tonal status actions. Legacy `text-white`, `text-gray-*`, and solid semantic Tailwind hue utilities remain supported through the shared compatibility layer, but new code should use the semantic tokens directly.
- Icons: use the existing lucide icon style and let `text-port-accent` carry theme identity.
- Charts: use `rgb(var(--port-chart-1))` through `rgb(var(--port-chart-4))` for series and `rgb(var(--port-chart-grid) / 0.34)` for grid lines.
- Terminal/log output: use `var(--port-terminal-bg)` and `var(--port-terminal-text)` when authoring custom CSS.
-Avoid hard-coded background colors for major containers. Hard-coded state colors are acceptable only when they are data colors and still pass contrast in all themes.
+Avoid hard-coded background colors for major containers. Hard-coded state colors are acceptable only when they are data colors and still pass contrast in all eight theme variants.
+
+The shared CSS contract keeps surface text between **4.5:1 and 15.5:1** against both the page and minimum card surfaces. The lower bound protects readability; the upper bound avoids glare from unnecessary near-white/near-black pairings. Solid legacy neutral backgrounds (`bg-gray-800` through `bg-gray-500` and their zinc/neutral/slate equivalents) are aliases of the theme surface tokens. Fixed media, scrims, terminals, and canvas overlays are the documented exceptions and must keep their own explicit overlay contract.
## Surface Elevation
diff --git a/docs/themes/classic-midnight.md b/docs/themes/classic-midnight.md
index c560a40ea7..1dc0905507 100644
--- a/docs/themes/classic-midnight.md
+++ b/docs/themes/classic-midnight.md
@@ -16,8 +16,8 @@ Classic Midnight preserves the existing PortOS UI: dark utilitarian panels, blue
- Panels: `bg-port-card border border-port-border rounded-lg`.
- Inset regions: `bg-port-bg border border-port-border rounded-lg`.
-- Primary buttons: `bg-port-accent text-white`.
-- Secondary buttons: `bg-port-card border border-port-border text-gray-300`.
+- Primary buttons: `bg-port-accent text-port-on-accent`.
+- Secondary buttons: `bg-port-card border border-port-border text-port-text-muted`.
- Code blocks: `bg-port-bg border border-port-border font-mono`.
## Validation
diff --git a/scripts/check-themes.js b/scripts/check-themes.js
index 09bc66bf42..da33ee141a 100644
--- a/scripts/check-themes.js
+++ b/scripts/check-themes.js
@@ -20,15 +20,23 @@ const REQUIRED_COLOR_VARS = [
'--port-card',
'--port-border',
'--port-accent',
+ '--port-accent-2',
+ '--port-accent-text',
+ '--port-accent-2-text',
'--port-success',
+ '--port-success-text',
'--port-warning',
+ '--port-warning-text',
'--port-error',
+ '--port-error-text',
'--port-on-accent',
+ '--port-on-accent-2',
'--port-on-success',
'--port-on-warning',
'--port-on-error',
'--port-text',
'--port-text-muted',
+ '--port-text-subtle',
'--port-control-text',
'--port-focus-ring',
];