fix: 白板页强制浅色,避免被 iframe 嵌入到浅色站点时出现黑色背景

- whiteboard.html 加 <meta name="color-scheme" content="light">
- whiteboard.css 在 :root 钉死 color-scheme: light 与浅色变量,
  覆盖 common.css 的 prefers-color-scheme: dark
This commit is contained in:
2026-07-22 02:44:03 +00:00
parent 09705a8843
commit fa980e74e0
2 changed files with 16 additions and 1 deletions

View File

@@ -1,5 +1,17 @@
/* 记事本页专属样式:全屏 textarea、悬浮工具栏、移动端适配。 */ /* 记事本页专属样式:全屏 textarea、悬浮工具栏、移动端适配。 */
:root { --bar-h: 52px; } /* 强制浅色:本页常被 iframe 嵌入浅色站点,覆盖 common.css 的
color-scheme: light dark 与 prefers-color-scheme: dark避免深色背景。 */
:root {
--bar-h: 52px;
color-scheme: light;
--bg: #f6f7f9;
--surface: #ffffff;
--surface-2: rgba(0, 0, 0, 0.02);
--border: #e0e3e7;
--text: #1a1a1a;
--text-dim: #6b7280;
--shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}
body { overflow: hidden; background: var(--bg); } body { overflow: hidden; background: var(--bg); }
.wb-app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; } .wb-app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.wb-bar { .wb-bar {

View File

@@ -4,6 +4,9 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="theme-color" content="#1565c0"> <meta name="theme-color" content="#1565c0">
<!-- 强制浅色:该页面会被 iframe 嵌入到浅色主题站点mainPage
禁用 common.css 的 prefers-color-scheme: dark保持背景与嵌入站一致 -->
<meta name="color-scheme" content="light">
<title>记事本 - zikai</title> <title>记事本 - zikai</title>
<link rel="stylesheet" href="/static/common.css"> <link rel="stylesheet" href="/static/common.css">
<link rel="stylesheet" href="/static/whiteboard.css"> <link rel="stylesheet" href="/static/whiteboard.css">