--void — overlay backdrop
Main content area
This demonstrates the sidebar + main content layout pattern. The sidebar is sticky on larger screens and collapses on mobile.
A layered component library built for precision, structure, and performance. Five surface levels, eight hue tracks and a hairline for every boundary — every specimen below is live.
层级不是装饰,是结构。六级表面从最暗的 void 一路走到 surface-3,再外挂一个比页面更暗的 inset 凹槽层 —— 每一级只差一点明度,却足够让边界被读出来。
--void — overlay backdrop
--base — page · band--base
--surface-1 — panels · cards
--surface-2 — headers · controls
--surface-3 — tracks · hover
--inset — wells · code
[*] 面板映射:thin / medium → surface-1,heavy / elevated → surface-2。 边框与阴影从不同时出现在静态表面上 —— 两者同时存在,边界就糊了。
var(--base)
var(--surface-1)
hue 5% + surface-1
hue 4% + base
var(--inset)
64px grid on base
--h-indigo
--h-blue
--h-cyan
--h-teal
--h-emerald
--h-amber
--h-rose
--h-purple
组件按职责分四层:承担表面的、承担结构的、承担交互的、承担反馈的。层的划分决定了它能不能被复用 —— 越靠上的层越少,越靠下的层越通用。
Panel · Card · StatCard · GlassTable · ListGroup · Meter
Band · SectionHeading · SpecList · KeyCap · CodeBlock · Terminal
Button · Modal · Toast · Tooltip · Dropdown · Tabs · CommandPalette
Alert · Progress · Spinner · Skeleton · Empty · Badge · StatusIndicator
[*] 等宽标注层(.micro / .note / .fig)是这套系统的第二种声音: 它承担规格、编号与读数,所有会变动的数字都用 tabular-nums 对齐。
表单控件的第一原则是高度统一、焦点可见。所有控件都是 36px 高、10px 圆角、1px 发丝线边框,聚焦时换成主色边加 3px 柔光环。
[*] 轨道与滑块完全由 CSS 绘制(label 的 ::before / ::after),组件不引入额外 DOM。 轨道 34 × 20,滑块 14px、位移 14px,只有 transform 与 background 参与过渡。
表格、列表与卡片共享同一套发丝线语言:外框 1px,行与行之间只留更淡的 line-faint,不用斑马纹,也不用浮起卡片 —— 数据自己会形成节奏。
| Name | Role | Status | Last Active |
|---|---|---|---|
| Alice Chen | Administrator | Online | Just now |
| Bob Martinez | Editor | Away | 12 min ago |
| Carol Wu | Viewer | Offline | 3 hours ago |
| David Kim | Developer | Online | 5 min ago |
[*] 表头是等宽大写的 micro 字形;点击表头由 StrataRuntime 排序并写入 aria-sort, 排序后箭头旋转 180°。表头本身可 Tab 聚焦,Enter / Space 都能触发。
High-performance rendering core with sub-millisecond latency.
Real-time data synchronization across distributed nodes.
Encrypted storage with zero-knowledge proof authentication.
[*] 轨道 5px、胶囊圆角、底色 surface-3;填充色取所在的区块色相 --hue, 所以同一套 Meter 在不同分区里会自动换色。
原生日期控件保留浏览器自带的弹层,只统一高度、内边距与文字颜色;日历是唯一手写的网格,单元格用 10px 等宽数字对齐。
浮层是全场唯一允许出现投影的地方 —— 静态表面靠边框,真正浮起来的层才用阴影把体积说清楚。全部由 data-strata-* 属性驱动,页面不写一行 JS。
[*] 菜单 208px 起宽、radius 14、surface-2 底加 line-strong 边与 --shadow-pop; 点击空白处或按 Esc 收起,并把焦点还给触发器。
Connect a Postgres instance and Strata will chart it automatically.
侧栏加主内容是最常用的页面骨架:侧栏在宽屏吸附、窄屏落回文档流,折叠按钮由运行时注入,折叠态只留两位等宽序号。
[*] 行高 9px、标题 13px 且宽 42%、圆角 4px,底 surface-3,扫光用 line-faint 渐变。 骨架屏整体 aria-hidden,另配 sr-only 说明,屏幕阅读器不会读出空洞内容。
媒体框是 16:9 容器加一层薄渐变底,播放键是这里唯一的圆形浮起元素。轮播点用 active 状态与 aria-current 同步,键盘可达。
横向滚动容器把内容藏进一个可聚焦的 region:拿到焦点后方向键即可滚动,滚动条本身也属于发丝线语言。
Scroll horizontally →
More content
Keep scrolling
Keep going
Still there
Nearly done
Almost there
Last one!
加载与状态反馈全部走语义色:ok / warn / err / info 四档只出现在 2px 导轨、图标与文字上,绝不整块填充。
[*] 轨道 5px 胶囊;确定态写入 aria-valuenow,不确定态省略该属性, 让 35% 宽的高亮条在轨道内平移。
工具栏是一排等高的 26px 图标按钮,用 active 与 aria-pressed 表示按下态,分隔线只是 1px 发丝线,不使用背景块分组。
[*] 按钮高度 26px、圆角 6px、内边距 0 9px;按下态写回 aria-pressed, 键盘用户与读屏用户看到的是同一个状态。
等宽字形是这套系统的第二种声音:代码块、终端、键帽与规格清单共享同一个 12px 等宽尺度。长文则共用同一套原语,但服从阅读节奏而不是布局网格。
<!-- interactions are declared with data-strata-* attributes --><label class="input-label" for="email">Email</label><input class="input-field input-error" type="email" id="email" name="email" value="invalid-email" aria-invalid="true" aria-describedby="email-error" /><span class="input-error-text" id="email-error"> Please enter a valid email address</span> <button class="btn btn-primary" type="button" data-strata-open="demoModal">Open modal</button> <button class="btn btn-outline" type="button" data-strata-toast="Action completed successfully!"> Show toast</button>
/* surface ramp - structure is carried by value + hairline */html.strata-root { --base: #060b14; --surface-1: #0b111f; --surface-3: #161f33; --inset: #04070f; --line: rgba(255,255,255,.09); --line-strong: rgba(255,255,255,.17); --accent: #3b82f6;} /* hover swaps colour, never tweens it */.strata .btn { transition: transform var(--duration-fast) var(--ease); }.strata .btn-primary:hover { background: var(--accent-hi); }
import type { BandTreatment, BandHue } from '../types/strata'; /** Adjacent bands never share a background - the runtime reuses this table. */const VALID_NEIGHBOURS: Record<BandTreatment, BandTreatment[]> = { hero: ['tinted', 'base', 'well', 'raised'], grid: ['tinted', 'base', 'well', 'raised'], tinted: ['base', 'well', 'raised', 'inset'], base: ['well', 'raised', 'inset', 'tinted'], well: ['raised', 'inset', 'tinted', 'base'], raised: ['inset', 'tinted', 'base', 'well'], inset: ['tinted', 'base', 'well', 'raised'],}; export function assertOrder(order: { hue: BandHue; treatment: BandTreatment }[]) { for (let i = 1; i < order.length; i++) { const prev = order[i - 1]!; const next = order[i]!; if (prev.treatment === next.treatment) { throw new Error(next.treatment + ' touches ' + prev.treatment + ' at band ' + i); } if (!VALID_NEIGHBOURS[prev.treatment]!.includes(next.treatment)) { throw new Error(next.treatment + ' is not a valid neighbour at band ' + i); } } return true;}
[*] 三例都走 code 属性渲染:自动转义、补零行号、右上角复制按钮(复制后回显 1.6s)。 代码块底是全场最暗的 --inset,用边框界定体积,不加投影。
"Design is not just what it looks like and feels like. Design is how it works — especially at the edge of tomorrow."
Every surface is composited from three parts: a
flat background, a hairline border, and the text layer on top.
The stacking order is what keeps text legible —
a single blurred backdrop the surface ramp plus one 1px line
does the heavy lifting.
Start from --base #060b14 and step up through
--surface-1 to --surface-3, then add
--inset for anything that should read as a well.
See Feedback for the status colours,
or press ⌘ + K to search design tokens.
A single 1px border at rgba(255,255,255,0.09) is enough to
separate a panel from the deep background. Underlines stay
reserved for inline annotations, never decoration.
Documents borrow the same primitives as UI but follow reading rhythm instead of layout grids — lists, quotes and figures slot straight into the flow:
Open items can render as checkable tasks:
"A hairline is not a decoration — it is the contract between background and foreground."
导航栏已隐藏,这里可以随时恢复