Erebos:无障碍深色模式主题引擎 - Openclaw Skills

作者:互联网

2026-03-31

AI教程

什么是 Erebos?

Erebos 为在 Web 应用程序中实现深色模式提供了一个专业级框架。作为 Openclaw Skills 生态系统中的专用工具,它专注于创建符合严格 WCAG 标准的高对比度、无障碍配色方案。

通过自动生成 CSS 变量和设计令牌,Erebos 确保了各种 UI 组件中一致且具有视觉吸引力的深色主题体验。该引擎允许开发人员在输出前计算对比度并验证无障碍性,为无需重新加载页面即可实现的运行时主题切换提供了可靠的工作流。

下载入口:https://github.com/openclaw/skills/tree/main/skills/kleberbaum/erebos

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install erebos

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 erebos。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

Erebos 应用场景

  • 从特定的种子颜色生成无障碍深色模式调色板。
  • 为前端开发管理和导出标准化的 CSS 变量。
  • 验证颜色对比度以确保符合 Web 无障碍标准。
  • 使用集成浏览器预览模式快速原型化 UI 主题。
  • 将设计令牌导出为 JSON 格式,用于多平台设计系统。
Erebos 工作原理
  1. 用户通过命令行界面提供基础种子十六进制代码。
  2. Erebos 计算针对深色环境优化的背景、文本和强调色的全套调色板。
  3. 引擎根据 WCAG 无障碍要求自动检查对比度。
  4. 设计令牌映射到特定的 UI 角色,如主要背景和次要文本。
  5. 该技能将最终主题导出为 CSS 变量或 JSON,或在本地浏览器环境中启动预览。

Erebos 配置指南

要开始在 Openclaw Skills 环境中使用 Erebos,请确保您拥有主题脚本的执行权限。使用以下命令生成并预览您的主题:

# 从自定义种子颜色生成调色板
./scripts/theme-gen.sh --palette "#1a1a2e" "#16213e"

# 在默认浏览器中启动实时预览
./scripts/theme-gen.sh --preview

# 将生成的令牌导出到 CSS 文件
./scripts/theme-gen.sh --export --format css

Erebos 数据架构与分类体系

Erebos 通过一组结构化的令牌和导出的文件来组织主题数据:

组件 描述
CSS 变量 :root 定义的变量,如 --bg-primary 和 --accent
JSON 令牌 用于设计系统集成的机器可读主题定义
调色板元数据 每个颜色对的对比度值和 WCAG 合规状态
预览 HTML 为基于浏览器的测试生成的临时可视化资产
name: erebos
description: Erebos namespace for Netsnek e.U. dark theme and theming engine. Generates accessible dark mode palettes, manages theme tokens, and provides runtime theme switching for web apps.
user-invocable: true
version: 0.1.0
metadata:
  openclaw:
    os: [linux]
    permissions: [exec]

Erebos

Enter the Dark Side

Erebos provides dark theming for web applications. It generates WCAG-compliant palettes, manages CSS variables and design tokens, and enables runtime theme switching without page reload.

Use Erebos when you need dark mode support, accessible color palettes, or a theming system for your web app.

How Erebos Works

Erebos builds theme tokens from a base palette. It computes contrast ratios and validates accessibility before output. The engine supports:

  • Palette generation — Produce dark backgrounds with sufficient contrast
  • Preview mode — Visualize themes in browser or terminal
  • Export — Output CSS variables, JSON tokens, or design-system formats

Theme Commands

Run the theme generator:

# Generate palette from seed colors
./scripts/theme-gen.sh --palette "#1a1a2e" "#16213e"

# Preview in browser (opens local HTML)
./scripts/theme-gen.sh --preview

# Export tokens to stdout or file
./scripts/theme-gen.sh --export --format css

Arguments

Argument Purpose
--palette Base colors for palette generation
--preview Launch preview mode (no file output)
--export Export theme tokens (requires format choice)

Design Example

/* Erebos output */
:root[data-theme="erebos-dark"] {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --text-primary: #eaeaea;
  --text-secondary: #a0a0a0;
  --accent: #0f3460;
}

相关推荐