Skip to content

armgit / kokon

Public Imported from GitHub
0

Edit photos by describing the change, on your own GPU. A free, open-source alternative to Nano Banana and ChatGPT image editing: photos stay on your computer, no daily limit. One installer for Windows, Mac and Linux sets up the best open model (Qwen-Image 2.1). MCP server for AI agents.

mac: no traffic-light gap in full screen; a lighter dark palette on macOS

Gabriele Lozuponeb05d72a0f0cf
diff --git a/index.html b/index.html
index 86ce850..cc6f389 100644
--- a/index.html
+++ b/index.html
@@ -11,6 +11,7 @@
<style>
html, body { margin: 0; height: 100%; background: #f4f4f4; color: #0d0d0d; }
html[data-theme="dark"], html[data-theme="dark"] body { background: #0a0a0a; color: #f2f2f2; }
+ html[data-theme="dark"][data-platform="mac"], html[data-theme="dark"][data-platform="mac"] body { background: #161616; }
.boot-splash { height: 100vh; display: grid; place-items: center; }
.boot-splash svg { width: 56px; height: 56px; opacity: 0.9; animation: boot-breathe 1.6s ease-in-out infinite; }
@keyframes boot-breathe { 50% { opacity: 0.35; } }
diff --git a/public/theme.js b/public/theme.js
index dc8521e..7238a2a 100644
--- a/public/theme.js
+++ b/public/theme.js
@@ -3,6 +3,8 @@
// localStorage (src/lib/theme.ts); without one it follows the OS and updates when that changes.
// (A classic script file, not inline, because the CSP only allows scripts from the app itself.)
(function () {
+ // macOS gets a lighter dark palette (styles.css); set it here too so the splash matches.
+ if (/Mac/i.test(navigator.platform || navigator.userAgent)) document.documentElement.dataset.platform = "mac";
var dark = window.matchMedia("(prefers-color-scheme: dark)");
function apply() {
var t = null;
diff --git a/src/components/TitleBar.tsx b/src/components/TitleBar.tsx
index df483c9..34acaee 100644
--- a/src/components/TitleBar.tsx
+++ b/src/components/TitleBar.tsx
@@ -8,8 +8,19 @@ import { useEffect, useState } from "react";
import { native } from "../lib/native";
import { isLinux, isMac } from "../lib/platform";
-// macOS: room for the traffic lights on the left of the top bar (styles.css).
-if (isMac && typeof document !== "undefined") document.documentElement.dataset.platform = "mac";
+// macOS: room for the traffic lights on the left of the top bar (styles.css). In full screen
+// macOS hides them, so the room goes too.
+if (isMac && typeof document !== "undefined") {
+ const root = document.documentElement;
+ root.dataset.platform = "mac";
+ const sync = () =>
+ native.isFullscreen().then(
+ (on) => (on ? (root.dataset.fullscreen = "") : delete root.dataset.fullscreen),
+ () => {},
+ );
+ sync();
+ native.onResized(sync).catch(() => {});
+}
export function WindowControls() {
const [maximized, setMaximized] = useState(false);
diff --git a/src/styles.css b/src/styles.css
index 4e4cf8c..c2ccd34 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -68,6 +68,17 @@
color-scheme: dark;
}
+/* Mac screens show these greys close to black; a step lighter matches macOS's own dark apps. */
+:root[data-theme="dark"][data-platform="mac"] {
+ --ground: #161616;
+ --bg: #1f1f1f;
+ --surface: #262626;
+ --surface-2: #2f2f2f;
+ --surface-3: #3a3a3a;
+ --checker: #222222;
+ --scrim: rgba(22, 22, 22, 0.85);
+}
+
* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
@@ -902,8 +913,8 @@ kbd { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; display
/* the drag regions take the click, not the text inside them */
.wordmark *, .brand > span.project-title { pointer-events: none; }
/* macOS keeps its traffic lights over the top-left corner */
-:root[data-platform="mac"] .side-head { padding-left: 86px; }
-:root[data-platform="mac"] .app:not(:has(.sidebar)) .topbar { padding-left: 86px; }
+:root[data-platform="mac"]:not([data-fullscreen]) .side-head { padding-left: 86px; }
+:root[data-platform="mac"]:not([data-fullscreen]) .app:not(:has(.sidebar)) .topbar { padding-left: 86px; }
/* ---------- scrollbars: a thin rounded thumb, no arrows, shown while the pointer is over the
list (WebView2, WebKit); the track stays invisible ---------- */