教育 · 新资源

Decanter 设计系统.

使用 Decanter 的 Tailwind 预设、响应式字号比例和自适应屏幕边缘,构建学术风格的编辑类页面。探索原创活动卡片,体验可用的主题筛选和可展开的摘要。

OpenDesign 指南8 个章节12 条参考条目原始应用指南
01

Decanter 设计系统界面预览

筛选原创活动卡片、打开摘要,并在主题搜索无结果时恢复浏览。

研究活动集合打开完整示例
对 Decanter v7 模块化排版、屏幕边距和色彩角色的原创 HTML/CSS 解读;并非编译后的预设运行时。· 实现参考
02

Decanter 设计系统设计参考

Decanter 7.5.3 软件包及 v7 官方安装方式和约定。将 v8 弃用项作为迁移说明处理。预览明确标注为 HTML/CSS 解读,使用本地字体回退方案,且不含大学品牌标识。

字体配置

来源
名称 / 规则值 / 配置用途
Primary sans / serifSource Sans 3 / Source Serif 4回退字体为 Helvetica/Arial 和 Georgia/Times。
Long-form line height1.4–1.5em建议的阅读字号范围。
Short text / headings1.2–1.3em更紧凑的分组。

选定的模块化设置

来源
名称 / 规则值 / 配置用途
Scale mobile / tablet / desktop1.15 / 1.2 / 1.25type-* 各级之间的比例。
basefont-23 selection18px XS–SM; 21px MD–XL; 23px 2XL此示例使用的显式配置。
Breakpoints SM / MD / LG / XL / 2XL576 / 768 / 992 / 1200 / 1500px响应式断点。
cc maximum1500px at 1700px viewport带流式屏幕边距的内容容器。
Screen edge XS / SM / MD / LG / XL20 / 30 / 50 / 80 / 100px经过精心设计,并非数学比例尺。

品牌色与操作色

来源
名称 / 规则值 / 配置用途
Cardinal red#8c1515 主要品牌色。
Black / cool grey#2e2d29 / #53565a主要中性色板。

网页交互色板

来源
名称 / 规则值 / 配置用途
Digital red / dark#b1040e / #820000交互样式;不可替代字标颜色。
Digital blue / dark#006cb8 / #00548f链接样式。
03

Decanter 设计系统完整指南

实用指南,介绍如何为真实界面选择、应用和评审此系统。

DESIGN-stanford-decanter.md

完整指导、实现起点和源代码链接。

下载指南

Decanter 设计系统:Tailwind 预设,而非 SDK

固定采用文档所述的构建流程

经验证的 Decanter 软件包版本为 7.5.3,并声明使用 Tailwind CSS ^3.4.17。其公开入口是 Tailwind 配置预设。将 require("decanter") 添加到 presets 中,将 content 指向实际源文件,并编译工具类样式表。Decanter 没有可供导入的 React provider。

摘自本 OpenDesign 指南

文档介绍了即将在 v8 中移除的内容,但安装方式仍标注为 v7。本参考固定使用 v7.5.3,并避开已弃用的 foggy、slab 和旧版模块化文本工具类。独立预览明确标注为对布局规则的解读,并未声称这是 Tailwind 编译结果。

阅读配套规范

Decanter 设计系统:响应式模块化排版

比例尺取决于基准字号

Source Sans 3 和 Source Serif 4 分别是主要的无衬线和衬线字体系列,回退字体为 Helvetica/Arial 和 Georgia/Times。type-* 工具类表示成比例的样式角色,而非固定像素值的标题。其比例系数在移动端为 1.15,在平板端为 1.2,在桌面端为 1.25。

此示例采用文档所述的 basefont-23 配置:XS–SM 为 18px,MD–XL 为 21px,2XL 为 23px。它使用相当于 type-3 的标题字号,让嵌入式紧凑示例中的展示效果保持协调。若项目选择不同的基准字号,应重新计算实际字号,而不要照搬此预览中的像素值。

阅读配套规范

Decanter 设计系统:流式容器与网格

屏幕边距也是布局的一部分

cc 容器采用经过精心设计的边距:XS 为 20px,SM 为 30px,MD 为 50px,LG 为 80px,XL 为 100px。容器会随视口增大,直到视口宽度达到 1700px 时,内容宽度上限为 1500px。这是一套带有明确边距规则的流式系统,而不只是固定宽度为 1200px 的容器。

此示例遵循这些边距规则,并在 MD 以下将两张编辑卡片改为单列。卡片内容按常规文档顺序排列,因此布局堆叠后,键盘导航顺序与阅读顺序一致。

阅读配套规范

Decanter 设计系统:自适应间距

有目的地使用响应式工具类

Decanter 提供 rs-m-* 和 rs-p-* 系列工具类,用于设置响应式外边距和内边距。选定的间距级别会在文档规定的范围内变化,并非 Tailwind 固定间距的别名。示例代码使用 rs-p-1 设置卡片内边距,并为其操作项使用常规固定内边距。

为确保参考示例可复现,独立解读会将每项 CSS 调整标明为应用代码。原生构建时,应使用预设生成的工具类,而不是再定义同名规则与之冲突。若构建扫描器无法识别完整类名,应避免使用 "rs-p-" + size 这样的动态片段。

阅读配套规范

Decanter 设计系统:品牌色与交互色

Cardinal 红与 Digital Red 各有不同用途

斯坦福大学的主色 Cardinal 红为 #8c1515。数字红 #b1040e 用作交互/强调色,不会取代大学形象识别中的 Cardinal 红。数字蓝 #006cb8 用于链接,较深的交互状态使用 #00548f。

示例使用数字红作为展开详情的操作色,并搭配克制的中性色界面表面。它不包含斯坦福大学字标、印章或官方形象识别栏。用于机构项目时,必须使用获准的形象识别素材并遵循大学品牌规范;技术参考示例不代表获得认可。

阅读配套规范

Decanter 设计系统:带操作项的编辑风格卡片

组合内容,而不是凭空猜测组件 API

官方卡片示例采用语义化的 HTML,并配有用于间距、排版、界面表面和操作项的工具类。我们的组合将活动类别与标题分开,以文本显示日期和场地,并使用真实按钮在原位展开摘要。它没有虚构 Decanter Card 属性 API。

如果实际结果是页面跳转,标题适合设置为链接。此处的结果是在当前页面展开内容,因此使用带有 aria-expanded 和 aria-controls 的按钮来传达这一行为。预览使用原创活动名称和摘要,而非照搬大学新闻内容。

  • 将活动标题用作卡片标题。
  • 在展开内容之前就显示时间和地点。
  • 展开内容时使用按钮;只有确实会跳转时才使用链接。

阅读配套规范

Decanter 设计系统:筛选与内容展开

确保不同布局下的内容都易于访问

主题选择器会筛选两张原创研究活动卡片,并更新可见的结果数量。无匹配项的选项有意用于展示空状态和重置方式。筛选不会改变标题层级,也不会将卡片转换为可选表单选项。

每篇摘要都有独立的按钮状态。关闭卡片后,焦点仍停留在同一个触发按钮上。更改筛选条件时会关闭被隐藏摘要,因此切换回某个主题后,内容会以一致的概览状态呈现。这些控件是基于工具类设计方法添加的应用行为,并非打包好的 Decanter JavaScript。

阅读配套规范

Decanter 设计系统:构建并验证结果

生成的类需要通过源码扫描纳入构建

提供的配置面向 Tailwind 3 和已验证的 Decanter 7.5.3 预设。它包含输入指令、内容 glob、输出命令以及原创卡片组合。请在文档 head 中链接生成的样式表。获准使用的字体文件需单独加载,也可以有意保留文档中说明的回退字体。

预览并非通过该工具链构建,且在实现标签中对此作了说明。用于生产环境时,应编译完整的类集合并检查生成的输出,尤其是在主版本升级导致弃用工具类发生变化之后。

  1. 固定使用 Decanter 及其兼容的 Tailwind 主版本。
  2. 注册预设,并扫描实际源码目录。
  3. 编译 Tailwind 的三个指令层。
  4. 在文档说明的断点下,检查所选基础字体、屏幕边缘和卡片操作。

阅读配套规范

Decanter 设计系统组件示例

原创编辑风格卡片

使用经验证的工具类系列组合语义化 HTML,并配有由应用自行实现的内容展开按钮。

html
<article class="bg-white border border-solid border-black-20 rs-p-1">
  <p class="font-semibold text-digital-red">Research conversation</p>
  <h2 class="type-2 font-serif leading-display">Reading the changing coast</h2>
  <p class="leading-normal">An original example event about field observations.</p>
  <button type="button" class="bg-digital-red text-white px-26 py-10
    hocus:bg-cardinal-red-dark focus:outline focus:outline-2">
    Show session details
  </button>
</article>

代码参考

预设配置

为固定使用 Tailwind 3 的方案提供完整的最小配置。

javascript
module.exports = {
  presets: [require('decanter')],
  content: ['./src/**/*.{html,js}']
};

代码参考

完整的独立示例

完整文档包含其布局、控件与初始化。解压所链接的示例归档,即可获得完全一致的相对 vendor 资源,然后通过 HTTP 提供服务。

html
<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Decanter editorial composition</title><style>*{box-sizing:border-box}body{margin:0;background:#f6f5f2;color:#2e2d29;font:18px/1.5 'Helvetica Neue',Helvetica,Arial,sans-serif}.cc{margin-inline:20px;max-width:1500px;padding-block:40px}h1{font-family:Georgia,serif;font-size:1.520875em;line-height:1.2;margin:24px 0}h2{font:700 1.3225em/1.25 Georgia,serif;margin:12px 0}p{margin:16px 0}.overline{letter-spacing:.12em;font-size:14px;font-weight:700}.filters{display:flex;gap:16px;align-items:center;flex-wrap:wrap;padding-block:24px;border-block:1px solid #c0c0bf;margin-block:32px}select{font:inherit;background:white;border:1px solid #767674;padding:8px}.cards{display:grid;grid-template-columns:1fr;gap:20px}article{background:white;padding:24px;border-top:4px solid #8c1515}article time{font-size:16px;color:#53565a}.topic{font-size:14px;font-weight:600;letter-spacing:.04em}.abstract{border-top:1px solid #d5d5d4;padding-top:16px}.action{font:600 16px/1.3 Arial,sans-serif;background:#b1040e;color:white;border:0;padding:12px 20px;cursor:pointer}.action:hover{background:#820000;text-decoration:underline}.reset{font:inherit;color:#006cb8;background:none;border:0;text-decoration:underline;padding:8px 0;cursor:pointer}:focus-visible{outline:3px solid #00548f;outline-offset:4px}small{display:block;font-size:14px;color:#53565a;margin-top:32px}[hidden]{display:none!important}@media(min-width:576px){.cc{margin-inline:30px}}@media(min-width:768px){body{font-size:21px}.cc{margin-inline:50px}h1{font-size:1.728em}h2{font-size:1.44em}.cards{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(min-width:992px){.cc{margin-inline:80px}.cards{gap:36px}h1{font-size:1.953125em}h2{font-size:1.5625em}}@media(min-width:1200px){.cc{margin-inline:100px}.cards{gap:40px}}@media(min-width:1500px){body{font-size:23px}.cards{gap:48px}}@media(min-width:1700px){.cc{margin-inline:auto}}
</style><main class="cc"><p class="overline">RESEARCH CONVERSATIONS · ORIGINAL EXAMPLES</p><h1>Ideas take shape in conversation.</h1><p>A compact editorial collection interpreting Decanter’s responsive type and screen-edge rules.</p><div class="filters"><label for="topic">Topic</label><select id="topic"><option value="all">All topics</option><option value="environment">Environment</option><option value="archives">Archives</option><option value="astronomy">Astronomy</option></select><span id="count" role="status">2 example events</span></div><div class="cards"><article data-topic="environment"><p class="topic">ENVIRONMENT</p><h2>Reading the changing coast</h2><time datetime="2026-10-12">12 October · Fictional seminar room</time><p>How field notes reveal changes that a single measurement cannot capture.</p><button class="action" type="button" aria-expanded="false" aria-controls="coast">Show session details</button><div class="abstract" id="coast" hidden><p>This original sample session compares written observations, sketches and repeat measurements. The conversation asks how researchers describe uncertainty when a landscape changes gradually.</p></div></article><article data-topic="archives"><p class="topic">ARCHIVES</p><h2>The stories between records</h2><time datetime="2026-10-19">19 October · Fictional reading room</time><p>Exploring how context connects objects in a community archive.</p><button class="action" type="button" aria-expanded="false" aria-controls="archive">Show session details</button><div class="abstract" id="archive" hidden><p>This original example considers correspondence, oral history and catalogue descriptions together. It examines how a collection can preserve disagreement without erasing individual perspectives.</p></div></article></div><div id="empty" hidden><h2>No events in this example topic</h2><p>Choose another topic or return to the full collection.</p><button type="button" class="reset" id="reset">Show all topics</button></div><small>Independent OpenDesign specimen. Original content, local font fallbacks and interpreted Decanter layout rules. No Stanford identity or real event listing.</small></main><script>const topic=document.querySelector('#topic'),cards=[...document.querySelectorAll('article')];function filter(){let count=0;cards.forEach(c=>{c.hidden=topic.value!=='all'&&topic.value!==c.dataset.topic;if(!c.hidden)count++;const b=c.querySelector('button');b.setAttribute('aria-expanded','false');b.textContent='Show session details';c.querySelector('.abstract').hidden=true});document.querySelector('#count').textContent=count+' example events';document.querySelector('#empty').hidden=count!==0}topic.onchange=filter;document.querySelector('#reset').onclick=()=>{topic.value='all';filter();topic.focus()};document.querySelectorAll('.action').forEach(b=>b.onclick=()=>{let open=b.getAttribute('aria-expanded')!=='true';b.setAttribute('aria-expanded',String(open));b.textContent=open?'Hide session details':'Show session details';document.getElementById(b.getAttribute('aria-controls')).hidden=!open});</script></html>

代码参考

  • 从“来源”一节下载完整示例。其 README 给出了确切的本地启动命令。
  • 保持 vendor 路径相对于本文档;该归档包含此预览所使用的全部资源。
04

Decanter 设计系统 Agent 配置

实现起点

经源码验证的预设构建入口;未用于构建通过解释方式呈现的独立预览。请在文档 head 中链接 dist/styles.css。字体和机构形象识别素材需另行决定。Sources 中提供的完整可运行示例 ZIP 也包含预览所需的确切依赖项和完整文档。将其解压后,在该目录运行 python3 -m http.server 8080,然后打开 http://localhost:8080/stanford-decanter.html。请勿通过 file:// 打开基于模块的示例。

bash
npm install --save-dev [email protected] [email protected]
# tailwind.config.cjs
# module.exports = {
#   presets: [require('decanter')],
#   content: ['./src/**/*.{html,js}']
# };
# src/input.css
# @tailwind base;
# @tailwind components;
# @tailwind utilities;
npx tailwindcss -c tailwind.config.cjs -i ./src/input.css -o ./dist/styles.css

适用于你项目的提示词

Agent 提示词
使用 Decanter 7.5.3/Tailwind 3 组合一页编辑风格的活动页面。使用预设,明确选择 basefont,并采用 type-* 字号比例和 cc 屏幕边缘。通过语义化卡片区分主题、标题、时间和地点。实现页面内主题筛选以及带 aria-expanded 的摘要控制。避免使用已弃用的 foggy/slab 工具类、照搬大学新闻内容或使用形象识别标志。若预览是手动解读而非通过 Decanter 构建所得,请另行标注。
05

Decanter 设计系统:来源与范围

这是独立的 OpenDesign 教育用途内容组合,并非大学官方活动页面。内容为原创,且不使用斯坦福标志。代码采用与经品牌授权的形象识别素材使用是两回事。