Current collected state Current
Observed since 20 Oct, 17:59 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
100 City 多项目主题配色方案 - Design Token 系统
100 City 多项目主题配色方案。
| 主题 | 风格 | 品牌色 | 适用场景 |
|---|---|---|---|
clarity | Apple 极简,黑白灰高对比 | 蓝色 #0071e3 | 数据产品、监控面板 |
aurora | 紫青渐变,毛玻璃光晕 | 紫色 #7c3aed | 内容平台、创作工具 |
每个主题都包含亮色和暗色两套配色。
# monorepo 内部项目
pnpm add 100city-theme --workspace
# 外部独立项目
pnpm add 100city-theme
/* 引入基础变量(字体、圆角、过渡) */
@import "@100city/theme/shared/base.css";
/* 引入主题配色(二选一) */
@import "@100city/theme/presets/clarity/theme.css";
@import "@100city/theme/presets/aurora/theme.css";
@import "@100city/theme/shared/base.css";
@import "@100city/theme/presets/aurora/theme.css";
// 背景色
<div style={{ backgroundColor: "var(--bg-card)" }}>
// 文字色
<h1 style={{ color: "var(--text-heading)" }}>标题</h1>
<p style={{ color: "var(--text-muted)" }}>描述</p>
// 品牌色
<button style={{ backgroundColor: "var(--brand-primary)" }}>按钮</button>
// 阴影
<div style={{ boxShadow: "var(--shadow-card)" }}>卡片</div>
给 <html> 或任意父元素加 .dark 或 data-theme="dark" 即可切换:
<html class="dark">
--{类别}-{用途}
类别:bg / text / border / brand / icon / status / shadow / interactive
用途:primary / secondary / muted / light / dark / hover / ...
# 修改 tokens.json 后重新生成 CSS
cd packages/theme
node build.js
presets/clarity/ 为新目录tokens.json 中的颜色值node build.jstheme.css 自动生成Download counts and popularity will appear here as the collector receives them.
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 17:59 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:1d25fe7570e3228df71581e765112f9a9d68d1617b621737fa57edc2f4341824