sai-assets可复用网页资产库

Swiss Inverted(瑞士反色 / 暗色)

swiss-inverted v1.0.0 MIT 主题 · 配色与字体 12 文件 · 44 KB
新窗口 ↗
载入预览…

暖黑纸底 + 暖白墨 + 同一个结构红;纸↔墨互换,红保持不变 —— 同字体两种墨极性;适用:深色底用暖黑 #121212,绝不用纯 #000;纸暖白 #EDEBE6 当墨色(不是纯白 #FFF);层级仍靠明度差(surface 比 bg 亮一档)+ 发丝线,不用投影;红保持 #D8232A(反色时略提亮到 #E5544B 做小字链接以满足对比);深色底禁细体衬线(锯齿糊)

不适用场景

禁用:纯黑 #000 底、纯白 #FFF 字、冷灰;深色底上用 300 细字重;给深底加发光/霓虹/玻璃拟态;换第二个强调色

元数据

类目
主题 · 配色与字体
版本
v1.0.0
许可
MIT
规模
12 文件 · 44 KB
来源
sai-theme-lab · themes/swiss-inverted.json

标签

  • dark
  • theme
  • paper
  • ink
  • red
  • warm
  • swiss

验证证据

2026-11-03 · python packs/swiss-inverted/scripts/assert_tokens.py

PASS assert_tokens swiss-inverted | variants=1 keys=19 hex=18 rgba=0 effects=1 contrast=ink/bg=15.72 onAccent/accent=5.01 | not_in_palette=['green']

归属与许可

  • Sai Theme Lab · themes/swiss-inverted.json · MIT
    原色板来源(旧库原子,只读取用)

取用

固定版本(CDN)
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/nakamotosai/sai-assets@pack/[email protected]/packs/swiss-inverted/css/default.css">
raw 直取(跟随 main)
curl -O https://raw.githubusercontent.com/nakamotosai/sai-assets/main/packs/swiss-inverted/SKILL.md
仓库内落地
python scripts/apply.py swiss-inverted --to <项目目录>
整包下载
https://assets.ouuut.com/downloads/swiss-inverted.zip

源码与规则

pack.json
{
  "schema": 1,
  "id": "swiss-inverted",
  "title": "Swiss Inverted(瑞士反色 / 暗色)",
  "kind": "theme",
  "category": "themes",
  "version": "1.0.0",
  "license": "MIT",
  "attribution": [
    {
      "name": "Sai Theme Lab · themes/swiss-inverted.json",
      "license": "MIT",
      "what": "原色板来源(旧库原子,只读取用)"
    }
  ],
  "origin": {
    "project": "sai-theme-lab",
    "path": "themes/swiss-inverted.json",
    "derived_from": null
  },
  "entry": "SKILL.md",
  "files": {
    "tokens": [
      "tokens/absolute.json",
      "tokens/index.json",
      "tokens/semantic/swiss-inverted.json"
    ],
    "css": [
      "css/default.css",
      "css/all.css",
      "css/themes.css"
    ],
    "usage": "docs/usage.md",
    "assert": "scripts/assert_tokens.py",
    "preview": "preview/index.html"
  },
  "tags": [
    "dark",
    "theme",
    "paper",
    "ink",
    "red",
    "warm",
    "swiss"
  ],
  "when": "暖黑纸底 + 暖白墨 + 同一个结构红;纸↔墨互换,红保持不变 —— 同字体两种墨极性;适用:深色底用暖黑 #121212,绝不用纯 #000;纸暖白 #EDEBE6 当墨色(不是纯白 #FFF);层级仍靠明度差(surface 比 bg 亮一档)+ 发丝线,不用投影;红保持 #D8232A(反色时略提亮到 #E5544B 做小字链接以满足对比);深色底禁细体衬线(锯齿糊)",
  "not_for": "禁用:纯黑 #000 底、纯白 #FFF 字、冷灰;深色底上用 300 细字重;给深底加发光/霓虹/玻璃拟态;换第二个强调色",
  "default_variant": "swiss-inverted",
  "verified": {
    "date": "2026-11-03",
    "how": "python packs/swiss-inverted/scripts/assert_tokens.py",
    "evidence": "PASS assert_tokens swiss-inverted | variants=1 keys=19 hex=18 rgba=0 effects=1 contrast=ink/bg=15.72 onAccent/accent=5.01 | not_in_palette=['green']"
  },
  "canonical_home": null
}
css/default.css
/* Default = swiss-inverted — 只链接这一份即最快 apply */
/* Swiss Inverted(瑞士反色 / 暗色) — 暖黑纸底 + 暖白墨 + 同一个结构红;纸↔墨互换,红保持不变 —— 同字体两种墨极性 */
/* 语义变量与 --theme-* 别名双发;字体/圆角透传源令牌 */

:root,
[data-theme="swiss-inverted"],
.theme-swiss-inverted {
  color-scheme: dark;
  --bg: #121212;
  --theme-bg: #121212;
  --bg-deep: #0E0E0E;
  --theme-bg-deep: #0E0E0E;
  --surface: #1A1A1A;
  --theme-surface: #1A1A1A;
  --surface-2: #222222;
  --theme-surface-2: #222222;
  --border: #EDEBE6;
  --theme-border: #EDEBE6;
  --ink: #EDEBE6;
  --theme-ink: #EDEBE6;
  --ink-muted: #9A958D;
  --theme-ink-muted: #9A958D;
  --ink-dim: #6B6862;
  --theme-ink-dim: #6B6862;
  --accent: #D8232A;
  --theme-accent: #D8232A;
  --accent-2: #E5544B;
  --theme-accent-2: #E5544B;
  --on-accent: #FFFFFF;
  --theme-on-accent: #FFFFFF;
  --red: #D8232A;
  --theme-red: #D8232A;
  --link: #E5544B;
  --theme-link: #E5544B;
  --code-bg: #1F1F1F;
  --theme-code-bg: #1F1F1F;
  --hairline: #5A5651;
  --theme-hairline: #5A5651;
  --grid-red: #7A4A42;
  --theme-grid-red: #7A4A42;
  --chip-bg: #EDEBE6;
  --theme-chip-bg: #EDEBE6;
  --chip-fg: #121212;
  --theme-chip-fg: #121212;
  --shadow: none;
  --theme-shadow: none;
  --radius-sm: 0px;
  --theme-radius-sm: 0px;
  --radius-md: 4px;
  --theme-radius-md: 4px;
  --radius-lg: 6px;
  --theme-radius-lg: 6px;
  --font-display: "Helvetica Neue","Neue Haas Grotesk Display Pro",Helvetica,Inter,"Noto Sans SC","Source Han Sans SC","PingFang SC","Microsoft YaHei",Arial,sans-serif;
  --theme-font-display: "Helvetica Neue","Neue Haas Grotesk Display Pro",Helvetica,Inter,"Noto Sans SC","Source Han Sans SC","PingFang SC","Microsoft YaHei",Arial,sans-serif;
  --font-body: "Helvetica Neue","Neue Haas Grotesk Display Pro",Inter,"Noto Sans SC","Source Han Sans SC","PingFang SC","Microsoft YaHei",Arial,sans-serif;
  --theme-font-body: "Helvetica Neue","Neue Haas Grotesk Display Pro",Inter,"Noto Sans SC","Source Han Sans SC","PingFang SC","Microsoft YaHei",Arial,sans-serif;
  --font-mono: "JetBrains Mono",ui-monospace,monospace;
  --theme-font-mono: "JetBrains Mono",ui-monospace,monospace;
}
css/all.css
/* Swiss Inverted(瑞士反色 / 暗色) — 全部变体 + 基础 chrome */
/* 暖黑纸底 + 暖白墨 + 同一个结构红;纸↔墨互换,红保持不变 —— 同字体两种墨极性 */
/* 含 :root:单主题整站直接链接本文件 */

:root,
[data-theme="swiss-inverted"],
.theme-swiss-inverted {
  color-scheme: dark;
  --bg: #121212;
  --theme-bg: #121212;
  --bg-deep: #0E0E0E;
  --theme-bg-deep: #0E0E0E;
  --surface: #1A1A1A;
  --theme-surface: #1A1A1A;
  --surface-2: #222222;
  --theme-surface-2: #222222;
  --border: #EDEBE6;
  --theme-border: #EDEBE6;
  --ink: #EDEBE6;
  --theme-ink: #EDEBE6;
  --ink-muted: #9A958D;
  --theme-ink-muted: #9A958D;
  --ink-dim: #6B6862;
  --theme-ink-dim: #6B6862;
  --accent: #D8232A;
  --theme-accent: #D8232A;
  --accent-2: #E5544B;
  --theme-accent-2: #E5544B;
  --on-accent: #FFFFFF;
  --theme-on-accent: #FFFFFF;
  --red: #D8232A;
  --theme-red: #D8232A;
  --link: #E5544B;
  --theme-link: #E5544B;
  --code-bg: #1F1F1F;
  --theme-code-bg: #1F1F1F;
  --hairline: #5A5651;
  --theme-hairline: #5A5651;
  --grid-red: #7A4A42;
  --theme-grid-red: #7A4A42;
  --chip-bg: #EDEBE6;
  --theme-chip-bg: #EDEBE6;
  --chip-fg: #121212;
  --theme-chip-fg: #121212;
  --shadow: none;
  --theme-shadow: none;
  --radius-sm: 0px;
  --theme-radius-sm: 0px;
  --radius-md: 4px;
  --theme-radius-md: 4px;
  --radius-lg: 6px;
  --theme-radius-lg: 6px;
  --font-display: "Helvetica Neue","Neue Haas Grotesk Display Pro",Helvetica,Inter,"Noto Sans SC","Source Han Sans SC","PingFang SC","Microsoft YaHei",Arial,sans-serif;
  --theme-font-display: "Helvetica Neue","Neue Haas Grotesk Display Pro",Helvetica,Inter,"Noto Sans SC","Source Han Sans SC","PingFang SC","Microsoft YaHei",Arial,sans-serif;
  --font-body: "Helvetica Neue","Neue Haas Grotesk Display Pro",Inter,"Noto Sans SC","Source Han Sans SC","PingFang SC","Microsoft YaHei",Arial,sans-serif;
  --theme-font-body: "Helvetica Neue","Neue Haas Grotesk Display Pro",Inter,"Noto Sans SC","Source Han Sans SC","PingFang SC","Microsoft YaHei",Arial,sans-serif;
  --font-mono: "JetBrains Mono",ui-monospace,monospace;
  --theme-font-mono: "JetBrains Mono",ui-monospace,monospace;
}

/* 基础 chrome(opt-in):<body class="theme-apply"> 或 [data-theme-apply] 上底色与基础件 */
.theme-apply,
[data-theme-apply] {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body, system-ui, sans-serif);
  line-height: 1.6;
}

.theme-apply a,
[data-theme-apply] a {
  color: var(--link, var(--accent));
}

.theme-apply code,
.theme-apply pre,
[data-theme-apply] code,
[data-theme-apply] pre {
  font-family: var(--font-mono, ui-monospace, monospace);
  background: var(--code-bg, var(--surface2, var(--surface)));
  border-radius: var(--radius-sm, 4px);
}

.theme-apply .panel,
[data-theme-apply] .panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 6px);
  box-shadow: var(--shadow, none);
}

.theme-apply .btn-primary,
[data-theme-apply] .btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-sm, 4px);
}
css/themes.css
/* Swiss Inverted(瑞士反色 / 暗色) · 共存版:只出 [data-theme] / .theme-<id> 作用域,不含 :root
   多主题应用(站点自带主题切换器)用这一份,避免全局覆盖项目自己的 token;
   单主题直接应用请用 css/default.css。color-scheme 只在 [data-theme] 块里给。 */

[data-theme="swiss-inverted"],
.theme-swiss-inverted {
  color-scheme: dark;
  --bg: #121212;
  --theme-bg: #121212;
  --bg-deep: #0E0E0E;
  --theme-bg-deep: #0E0E0E;
  --surface: #1A1A1A;
  --theme-surface: #1A1A1A;
  --surface-2: #222222;
  --theme-surface-2: #222222;
  --border: #EDEBE6;
  --theme-border: #EDEBE6;
  --ink: #EDEBE6;
  --theme-ink: #EDEBE6;
  --ink-muted: #9A958D;
  --theme-ink-muted: #9A958D;
  --ink-dim: #6B6862;
  --theme-ink-dim: #6B6862;
  --accent: #D8232A;
  --theme-accent: #D8232A;
  --accent-2: #E5544B;
  --theme-accent-2: #E5544B;
  --on-accent: #FFFFFF;
  --theme-on-accent: #FFFFFF;
  --red: #D8232A;
  --theme-red: #D8232A;
  --link: #E5544B;
  --theme-link: #E5544B;
  --code-bg: #1F1F1F;
  --theme-code-bg: #1F1F1F;
  --hairline: #5A5651;
  --theme-hairline: #5A5651;
  --grid-red: #7A4A42;
  --theme-grid-red: #7A4A42;
  --chip-bg: #EDEBE6;
  --theme-chip-bg: #EDEBE6;
  --chip-fg: #121212;
  --theme-chip-fg: #121212;
  --shadow: none;
  --theme-shadow: none;
  --radius-sm: 0px;
  --theme-radius-sm: 0px;
  --radius-md: 4px;
  --theme-radius-md: 4px;
  --radius-lg: 6px;
  --theme-radius-lg: 6px;
  --font-display: "Helvetica Neue","Neue Haas Grotesk Display Pro",Helvetica,Inter,"Noto Sans SC","Source Han Sans SC","PingFang SC","Microsoft YaHei",Arial,sans-serif;
  --theme-font-display: "Helvetica Neue","Neue Haas Grotesk Display Pro",Helvetica,Inter,"Noto Sans SC","Source Han Sans SC","PingFang SC","Microsoft YaHei",Arial,sans-serif;
  --font-body: "Helvetica Neue","Neue Haas Grotesk Display Pro",Inter,"Noto Sans SC","Source Han Sans SC","PingFang SC","Microsoft YaHei",Arial,sans-serif;
  --theme-font-body: "Helvetica Neue","Neue Haas Grotesk Display Pro",Inter,"Noto Sans SC","Source Han Sans SC","PingFang SC","Microsoft YaHei",Arial,sans-serif;
  --font-mono: "JetBrains Mono",ui-monospace,monospace;
  --theme-font-mono: "JetBrains Mono",ui-monospace,monospace;
}

/* 基础 chrome(opt-in):<body class="theme-apply"> 或 [data-theme-apply] 上底色与基础件 */
.theme-apply,
[data-theme-apply] {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body, system-ui, sans-serif);
  line-height: 1.6;
}

.theme-apply a,
[data-theme-apply] a {
  color: var(--link, var(--accent));
}

.theme-apply code,
.theme-apply pre,
[data-theme-apply] code,
[data-theme-apply] pre {
  font-family: var(--font-mono, ui-monospace, monospace);
  background: var(--code-bg, var(--surface2, var(--surface)));
  border-radius: var(--radius-sm, 4px);
}

.theme-apply .panel,
[data-theme-apply] .panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 6px);
  box-shadow: var(--shadow, none);
}

.theme-apply .btn-primary,
[data-theme-apply] .btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-sm, 4px);
}
tokens/absolute.json
{
  "id": "swiss-inverted",
  "name": "Swiss Inverted(瑞士反色 / 暗色)",
  "mode": "dark",
  "signature": "暖黑纸底 + 暖白墨 + 同一个结构红;纸↔墨互换,红保持不变 —— 同字体两种墨极性",
  "source": "themes/swiss-inverted.json",
  "colors": {
    "bg": "#121212",
    "bgDeep": "#0E0E0E",
    "surface": "#1A1A1A",
    "surface2": "#222222",
    "border": "#EDEBE6",
    "hairline": "#5A5651",
    "ink": "#EDEBE6",
    "inkMuted": "#9A958D",
    "inkDim": "#6B6862",
    "accent": "#D8232A",
    "accent2": "#E5544B",
    "onAccent": "#FFFFFF",
    "red": "#D8232A",
    "gridRed": "#7A4A42",
    "chipBg": "#EDEBE6",
    "chipFg": "#121212",
    "link": "#E5544B",
    "codeBg": "#1F1F1F",
    "shadow": "none"
  }
}
tokens/index.json
{
  "default": "swiss-inverted",
  "themes": [
    {
      "id": "swiss-inverted",
      "name": "Swiss Inverted(瑞士反色 / 暗色)",
      "mode": "dark",
      "path": "tokens/semantic/swiss-inverted.json",
      "default": true
    }
  ]
}
tokens/semantic/swiss-inverted.json
{
  "id": "swiss-inverted",
  "name": "Swiss Inverted(瑞士反色 / 暗色)",
  "mode": "dark",
  "signature": "暖黑纸底 + 暖白墨 + 同一个结构红;纸↔墨互换,红保持不变 —— 同字体两种墨极性",
  "colors": {
    "bg": "#121212",
    "bgDeep": "#0E0E0E",
    "surface": "#1A1A1A",
    "surface2": "#222222",
    "border": "#EDEBE6",
    "ink": "#EDEBE6",
    "inkMuted": "#9A958D",
    "inkDim": "#6B6862",
    "accent": "#D8232A",
    "accent2": "#E5544B",
    "onAccent": "#FFFFFF",
    "red": "#D8232A",
    "link": "#E5544B",
    "codeBg": "#1F1F1F",
    "hairline": "#5A5651",
    "gridRed": "#7A4A42",
    "chipBg": "#EDEBE6",
    "chipFg": "#121212",
    "shadow": "none"
  },
  "fonts": {
    "display": "\"Helvetica Neue\",\"Neue Haas Grotesk Display Pro\",Helvetica,Inter,\"Noto Sans SC\",\"Source Han Sans SC\",\"PingFang SC\",\"Microsoft YaHei\",Arial,sans-serif",
    "body": "\"Helvetica Neue\",\"Neue Haas Grotesk Display Pro\",Inter,\"Noto Sans SC\",\"Source Han Sans SC\",\"PingFang SC\",\"Microsoft YaHei\",Arial,sans-serif",
    "mono": "\"JetBrains Mono\",ui-monospace,monospace"
  },
  "radius": {
    "sm": "0px",
    "md": "4px",
    "lg": "6px"
  },
  "derived": {
    "bg": "bg",
    "bgDeep": "bgDeep",
    "surface": "surface",
    "surface2": "surface2",
    "border": "border",
    "ink": "ink",
    "inkMuted": "inkMuted",
    "inkDim": "inkDim",
    "accent": "accent",
    "accent2": "accent2",
    "onAccent": "onAccent",
    "red": "red",
    "link": "link",
    "codeBg": "codeBg"
  },
  "a11y": {
    "contrast_min": 4.5,
    "pairs": {
      "ink/bg": 15.72,
      "onAccent/accent": 5.01
    },
    "adjusted": false,
    "notes": []
  }
}
docs/usage.md
# Swiss Inverted(瑞士反色 / 暗色) · 用法与配对规则

`swiss-inverted` · mode `dark` · 默认变体 `swiss-inverted`

**signature**:暖黑纸底 + 暖白墨 + 同一个结构红;纸↔墨互换,红保持不变 —— 同字体两种墨极性

- 原色表:`tokens/absolute.json`(源盘 `colors` 原样,不改名不近似)。
- 语义映射:`tokens/semantic/swiss-inverted.json`(`derived` 记每个语义键取自哪个源键;`a11y` 记对比度实测)。
- 变量双发:裸语义名(`--bg`)与 `--theme-` 前缀别名(`--theme-bg`)同值,便于接既有项目。
- 你不需要发明 hex:缺哪个角色就用对应变量,不要拿别的色近似。

## 变体表

| id | mode | 何时用 |
|---|---|---|
| `swiss-inverted` | `dark` | **默认**;暖黑纸底 + 暖白墨 + 同一个结构红;纸↔墨互换,红保持不变 —— 同字体两种墨极性 |

## 变量表(语义名 ↔ 前缀别名)

| 语义键 | CSS 变量 | 别名 |
|---|---|---|
| `bg` | `--bg` | `--theme-bg` |
| `bgDeep` | `--bg-deep` | `--theme-bg-deep` |
| `surface` | `--surface` | `--theme-surface` |
| `surface2` | `--surface-2` | `--theme-surface-2` |
| `border` | `--border` | `--theme-border` |
| `ink` | `--ink` | `--theme-ink` |
| `inkMuted` | `--ink-muted` | `--theme-ink-muted` |
| `inkDim` | `--ink-dim` | `--theme-ink-dim` |
| `accent` | `--accent` | `--theme-accent` |
| `accent2` | `--accent-2` | `--theme-accent-2` |
| `onAccent` | `--on-accent` | `--theme-on-accent` |
| `red` | `--red` | `--theme-red` |
| `link` | `--link` | `--theme-link` |
| `codeBg` | `--code-bg` | `--theme-code-bg` |
| `hairline` | `--hairline` | `--theme-hairline` |
| `gridRed` | `--grid-red` | `--theme-grid-red` |
| `chipBg` | `--chip-bg` | `--theme-chip-bg` |
| `chipFg` | `--chip-fg` | `--theme-chip-fg` |
| `shadow` | `--shadow` | `--theme-shadow` |

## 配对规则(谁配谁)

| 用途 | 变量 | 口径 |
|---|---|---|
| 正文 / 段落 | `--ink` | 页面主文字色,始终用于 `--bg` 之上 |
| 次要文字 | `--ink-muted` / `--ink-dim` | 说明、元信息、时间戳;`--ink-muted` 比 `--ink-dim` 更接近正文 |
| 卡面 / 面板 | `--surface` + `--border` | 卡底用 `--surface`,描边用 `--border`;需要抬升时 `--surface-2` |
| 主按钮 | `--accent` + `--on-accent` | 一个视区只放一个主 CTA;文字色必须用 `--on-accent`(实测 5.01:1) |
| 链接 | `--link` | 链接一律用 `--link`;**强调色(`--accent`)不与链接同色** —— 本主题 `--link` = `#E5544B` 与 `--accent` = `#D8232A` 不同值,可直接并置 |
| 危险 / 破坏性 | `--red` | 删除、错误、警报 |
| 成功 | `--green` | 通过、已完成(源色板无 green 角色,本包不发该变量) |
| 页面底 | `--bg` / `--bg-deep` | 大底用 `--bg`,更深的分层用 `--bg-deep` |

一行口径:正文 `--ink`,次要 `--ink-muted`/`--ink-dim`,卡面 `--surface`+`--border`,主按钮 `--accent`+`--on-accent`,链接 `--link`,危险 `--red`,成功 `--green`;强调色不做链接色。

## 字体配方(源 `fonts` 透传)

| 角色 | 变量 | 栈 |
|---|---|---|
| `display` | `--font-display` | "Helvetica Neue","Neue Haas Grotesk Display Pro",Helvetica,Inter,"Noto Sans SC","Source Han Sans SC","PingFang SC","Microsoft YaHei",Arial,sans-serif |
| `body` | `--font-body` | "Helvetica Neue","Neue Haas Grotesk Display Pro",Inter,"Noto Sans SC","Source Han Sans SC","PingFang SC","Microsoft YaHei",Arial,sans-serif |
| `mono` | `--font-mono` | "JetBrains Mono",ui-monospace,monospace |

- 标题用 `var(--font-display)`,正文 `var(--font-body)`,代码/数字 `var(--font-mono)`;字重与字号档位不在本包内,按下方 `do` 的约束落地。

## 圆角(源 `radius` 透传)

| 变量 | 值 |
|---|---|
| `--radius-sm` | 0px |
| `--radius-md` | 4px |
| `--radius-lg` | 6px |

## 推荐做法(源 `do`)

- 深色底用暖黑 #121212,绝不用纯 #000
- 纸暖白 #EDEBE6 当墨色(不是纯白 #FFF)
- 层级仍靠明度差(surface 比 bg 亮一档)+ 发丝线,不用投影
- 红保持 #D8232A(反色时略提亮到 #E5544B 做小字链接以满足对比)
- 深色底禁细体衬线(锯齿糊)

## 反模式(源 `dont`)

- 纯黑 #000 底、纯白 #FFF 字、冷灰
- 深色底上用 300 细字重
- 给深底加发光/霓虹/玻璃拟态
- 换第二个强调色

## 对比度实测(WCAG,自写公式)

| 组合 | 实测 | 门槛 |
|---|---|---|
| `ink` on `bg` | 15.72:1 | ≥ 4.5:1 |
| `onAccent` on `accent` | 5.01:1 | ≥ 4.5:1 |



## 应用片段

```css
/* 单主题:把 css/default.css 全文贴进项目,或在 <head> 里 link 它 */
/* 多主题共存:link css/themes.css,用 <html data-theme="swiss-inverted"> 决定何时生效(无 :root,不覆盖项目 token) */
```

```html
<html data-theme="swiss-inverted" class="theme-swiss-inverted" lang="zh-CN">
  <link rel="stylesheet" href="css/default.css">
```

## 来源 / Provenance

- B站 BV1hWar6SEVP 帧分析:反色卡(同字体两种墨极性)
- sai-frontend §4.0:深色底禁纯 #000、禁冷灰;深色底禁细体衬线
- (研究补充见 notes/research-corpus.md)
SKILL.md
---
name: swiss-inverted
description: "Swiss Inverted(瑞士反色 / 暗色)(dark 暖黑纸底 + 暖白墨 + 同一个结构红;纸↔墨互换,红保持不变 —— 同字体两种墨极性)。触发:Swiss Inverted(瑞士反色 / 暗色) / swiss-inverted / 暖黑纸底 + 暖白墨 + 同一个结构红;纸↔墨互换,红保持不变 —— 同字体两种墨极性。不做整站重构。"

---

# swiss-inverted

让任何网页/面板变成 **Swiss Inverted(瑞士反色 / 暗色)** 的样子,不用 agent 自己编 hex。

暖黑纸底 + 暖白墨 + 同一个结构红;纸↔墨互换,红保持不变 —— 同字体两种墨极性

## When to use

- 用户点名 Swiss Inverted(瑞士反色 / 暗色) / swiss-inverted / 暖黑纸底 + 暖白墨 + 同一个结构红;纸↔墨互换,红保持不变 —— 同字体两种墨极性
- 需要整套配色(bg / bg-deep / surface / ink / accent / 状态色)而不是单个色值
- 需要 深色底用暖黑 #121212,绝不用纯 #000
- 需要 纸暖白 #EDEBE6 当墨色(不是纯白 #FFF)
- 需要 层级仍靠明度差(surface 比 bg 亮一档)+ 发丝线,不用投影
- 需要 红保持 #D8232A(反色时略提亮到 #E5544B 做小字链接以满足对比)
- 需要 深色底禁细体衬线(锯齿糊)

## When not to use

- 整站品牌设计系统(要自定义组件/字体体系)→ 用设计类 skill
- 别的主题族(用户点名其它风格)
- 纯黑 #000 底、纯白 #FFF 字、冷灰
- 深色底上用 300 细字重
- 给深底加发光/霓虹/玻璃拟态
- 换第二个强调色

## Default

**`swiss-inverted`**(mode `dark`)

| role | hex |
|---|---|
| `bg` | `#121212` |
| `bgDeep` | `#0E0E0E` |
| `surface` | `#1A1A1A` |
| `ink` | `#EDEBE6` |
| `accent` | `#D8232A` |
| `link` | `#E5544B` |
| `red` | `#D8232A` |

## Sub-themes (id → when)

| id | mode | contrast | pick when |
|---|---|---|---|
| `swiss-inverted` | `dark` | — | **默认**;暖黑纸底 + 暖白墨 + 同一个结构红;纸↔墨互换,红保持不变 —— 同字体两种墨极性 |

## Files

| path | use |
|---|---|
| `tokens/absolute.json` | 源盘原色表(原样,含未参与语义映射的色) |
| `tokens/index.json` | 变体目录 + default |
| `tokens/semantic/swiss-inverted.json` | 语义映射 + `derived`(取源哪个键)+ `a11y`(对比度实测) |
| `css/default.css` | 默认变体一份,含 `:root`,最快 apply |
| `css/all.css` | 全部变体 + 基础 chrome,含 `:root` |
| `css/themes.css` | 共存版:同 all.css 但**无 `:root`**,只 `[data-theme]` / `.theme-<id>` 作用域 |
| `docs/usage.md` | 配对规则 / 字体配方 / 反模式(中文) |
| `preview/index.html` | 活预览(独立单文件) |

## Agent apply steps

1. **Pick variant** — 用户点名变体就用它;否则 `swiss-inverted`。
2. **Read tokens** — `tokens/semantic/swiss-inverted.json`(`colors` 是语义键,`derived` 说明它取自源盘哪个键)。
3. **写入 CSS 变量** — 项目已有 `--bg/--ink/--accent` 就沿用同名;否则整份贴,或同时写 `--theme-*` 别名。
4. **挂主题作用域** — `<html data-theme="swiss-inverted" class="theme-swiss-inverted">`;多主题站点用 `css/themes.css`。
5. **选文件** — 单主题 `css/default.css`;多主题 `css/all.css`(带 `:root`)或 `css/themes.css`(不带)。
6. **按角色套件**:
   - 页面底 → `--bg` / `--bg-deep`
   - 卡面面板 → `--surface` + `--border`
   - 正文 → `--ink`;次要 → `--ink-muted` / `--ink-dim`
   - 主按钮 → `--accent` + `--on-accent`(一屏一个 CTA)
   - 链接 → `--link`(**不**用 `--accent`,强调色不做链接色)
   - 危险 → `--red`;成功 → `--green`
7. **不要发明 hex** — 颜色只能来自 `tokens/absolute.json`;缺角色就跳过该变量。
8. **自检** — `python scripts/assert_tokens.py` 必须打印 `PASS assert_tokens swiss-inverted`。

### Minimal `:root` snippet (`swiss-inverted`)

```css
:root {
  color-scheme: dark;
  --bg: #121212;
  --bg-deep: #0E0E0E;
  --surface: #1A1A1A;
  --surface-2: #222222;
  --border: #EDEBE6;
  --ink: #EDEBE6;
  --ink-muted: #9A958D;
  --ink-dim: #6B6862;
  --accent: #D8232A;
  --accent-2: #E5544B;
  --on-accent: #FFFFFF;
  --red: #D8232A;
  --link: #E5544B;
  --code-bg: #1F1F1F;
  --hairline: #5A5651;
  --grid-red: #7A4A42;
  --chip-bg: #EDEBE6;
  --chip-fg: #121212;
  --shadow: none;
}
```

### HTML switch

```html
<html data-theme="swiss-inverted" class="theme-swiss-inverted">
  <link rel="stylesheet" href="css/default.css">
```

## Hard rules

- **Never** 纯黑 #000 底、纯白 #FFF 字、冷灰(源 `dont`)
- **Never** 深色底上用 300 细字重(源 `dont`)
- **Never** 给深底加发光/霓虹/玻璃拟态(源 `dont`)
- **Never** 换第二个强调色(源 `dont`)

## Notes

- 预览:`preview/index.html`,单文件可直接打开
- 来源与语义层修正:`docs/usage.md` 末节。

← 回索引