equinor-design-system
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseEquinor Design System — Design Rules
Equinor设计系统——设计规则
Compact reference for EDS design tokens and Equinor brand constraints. All rules are sourced from eds.equinor.com and the Equinor Communication Toolbox.
This file is a subordinate lookup reference. There are no workflow steps. Consuming agents should look up the relevant section and apply the rule directly.
EDS设计令牌和Equinor品牌约束的精简参考资料。所有规则均源自eds.equinor.com和Equinor传播工具箱。
本文件是从属查询参考资料,无工作流程步骤。调用的Agent应查找相关章节并直接应用规则。
Color tokens
颜色令牌
Use EDS CSS custom properties () for all color values. Never use raw hex, rgb(), or named CSS colors in Fusion app code. All tokens below are from v2.x (the version Fusion apps depend on).
--eds-color-*@equinor/eds-tokensToken naming pattern:--eds-color-<layer>-<semantic>-<variant>
= background fillbg = foreground text / icontext = stroke / dividerborder
所有颜色值均使用EDS CSS自定义属性()。在Fusion应用代码中绝不要使用原始十六进制、rgb()或命名CSS颜色。以下所有令牌均来自 v2.x(Fusion应用依赖的版本)。
--eds-color-*@equinor/eds-tokens令牌命名模式:--eds-color-<layer>-<semantic>-<variant>
= 背景填充bg = 前景文本/图标text = 描边/分隔线border
Background tokens
背景令牌
| Purpose | EDS token |
|---|---|
| Page / app canvas | |
| Surface (card, panel) | |
| Input field background | |
| Floating surface (dropdown, tooltip) | |
| Backdrop / modal scrim | |
| Primary action fill (default) | |
| Primary action fill (hover) | |
| Primary action fill (active) | |
| Muted fill (default) | |
| Muted fill (hover) | |
| Disabled surface | |
| Success surface (subtle bg) | |
| Success fill (emphasis) | |
| Warning surface | |
| Warning fill (emphasis) | |
| Danger / error surface | |
| Danger fill (emphasis) | |
| Info surface | |
| Info fill (emphasis) | |
| Accent surface | |
| Accent fill (emphasis) | |
| 用途 | EDS令牌 |
|---|---|
| 页面/应用画布 | |
| 表面(卡片、面板) | |
| 输入框背景 | |
| 悬浮表面(下拉框、提示框) | |
| 背景遮罩/模态框幕布 | |
| 主要操作填充(默认状态) | |
| 主要操作填充(悬停状态) | |
| 主要操作填充(激活状态) | |
| 弱化填充(默认状态) | |
| 弱化填充(悬停状态) | |
| 禁用表面 | |
| 成功状态表面(柔和背景) | |
| 成功状态填充(强调) | |
| 警告状态表面 | |
| 警告状态填充(强调) | |
| 危险/错误状态表面 | |
| 危险/错误状态填充(强调) | |
| 信息状态表面 | |
| 信息状态填充(强调) | |
| 强调色表面 | |
| 强调色填充(强调) | |
Text tokens
文本令牌
| Purpose | EDS token |
|---|---|
| Primary body text | |
| Text on emphasis/filled backgrounds | |
| Subtle / secondary text | |
| Disabled text | |
| Link | |
| Success text | |
| Success text (subtle) | |
| Warning text | |
| Danger / error text | |
| Info text | |
| Accent text | |
| 用途 | EDS令牌 |
|---|---|
| 主要正文文本 | |
| 强调/填充背景上的文本 | |
| 次要/柔和文本 | |
| 禁用文本 | |
| 链接 | |
| 成功状态文本 | |
| 成功状态文本(柔和) | |
| 警告状态文本 | |
| 危险/错误状态文本 | |
| 信息状态文本 | |
| 强调色文本 | |
Border tokens
边框令牌
| Purpose | EDS token |
|---|---|
| Default divider / border | |
| Subtle border | |
| Strong border | |
| Focus ring | |
| Disabled border | |
| Success border | |
| Warning border | |
| Danger border | |
| Info border | |
| Accent border | |
Brand constraint: Equinor red () is used in the primary logo only — never as a UI action or semantic color. Use EDS color tokens for all clickable and semantic surfaces.#FF1243
| 用途 | EDS令牌 |
|---|---|
| 默认分隔线/边框 | |
| 柔和边框 | |
| 加粗边框 | |
| 聚焦环 | |
| 禁用边框 | |
| 成功状态边框 | |
| 警告状态边框 | |
| 危险/错误状态边框 | |
| 信息状态边框 | |
| 强调色边框 | |
品牌约束:Equinor红色()仅用于主标志——绝不能作为UI操作或语义颜色使用。所有可点击和语义化表面均需使用EDS颜色令牌。#FF1243
Token access in code
代码中访问令牌
Prefer EDS CSS custom properties in styled-components over the JS object when possible — they respect system dark/light mode automatically.
@equinor/eds-tokenstypescript
import styled from 'styled-components';
const Card = styled.div`
background: var(--eds-color-bg-surface);
border: 1px solid var(--eds-color-border-medium);
color: var(--eds-color-text-strong);
`;
const PrimaryButton = styled.button`
background: var(--eds-color-bg-fill-emphasis-default);
color: var(--eds-color-text-strong-on-emphasis);
&:hover {
background: var(--eds-color-bg-fill-emphasis-hover);
}
&:disabled {
background: var(--eds-color-bg-disabled);
color: var(--eds-color-text-disabled);
}
`;尽可能在styled-components中使用EDS CSS自定义属性,而非 JS对象——它们会自动适配系统明暗模式。
@equinor/eds-tokenstypescript
import styled from 'styled-components';
const Card = styled.div`
background: var(--eds-color-bg-surface);
border: 1px solid var(--eds-color-border-medium);
color: var(--eds-color-text-strong);
`;
const PrimaryButton = styled.button`
background: var(--eds-color-bg-fill-emphasis-default);
color: var(--eds-color-text-strong-on-emphasis);
&:hover {
background: var(--eds-color-bg-fill-emphasis-hover);
}
&:disabled {
background: var(--eds-color-bg-disabled);
color: var(--eds-color-text-disabled);
}
`;Typography
排版
Use from for all text rendering. Never set raw , , or manually — use the EDS prop.
Typography@equinor/eds-core-reactfont-sizefont-familyline-heightvariant所有文本渲染均使用中的组件。绝不要手动设置原始、或——使用EDS的属性。
@equinor/eds-core-reactTypographyfont-sizefont-familyline-heightvariantVariant hierarchy
变体层级
| Level | | Usage |
|---|---|---|
| Display | | Hero headings (rarely used in apps) |
| Page title | | Top-level page heading |
| Section heading | | Section title, card header |
| Sub-heading | | Sub-section, panel title |
| Overline | | Category labels, breadcrumb-level text |
| Body | | Multi-line body text |
| Body short | | Single-line body, table cells |
| Caption | | Metadata, timestamps, helper text |
| Label | | Form field labels |
typescript
import { Typography } from '@equinor/eds-core-react';
// Correct
<Typography variant="h3">Section heading</Typography>
<Typography variant="body_short">Table cell value</Typography>
<Typography variant="caption">Last updated 2 hours ago</Typography>
// Wrong — never do this
<p style={{ fontSize: '14px' }}>…</p>| 级别 | | 用途 |
|---|---|---|
| 展示级 | | 英雄标题(应用中极少使用) |
| 页面标题 | | 顶级页面标题 |
| 章节标题 | | 章节标题、卡片头部 |
| 子标题 | | 子章节、面板标题 |
| overline | | 分类标签、面包屑层级文本 |
| 正文 | | 多行正文文本 |
| 短正文 | | 单行正文、表格单元格 |
| 说明文字 | | 元数据、时间戳、辅助文本 |
| 标签 | | 表单字段标签 |
typescript
import { Typography } from '@equinor/eds-core-react';
// 正确用法
<Typography variant="h3">Section heading</Typography>
<Typography variant="body_short">Table cell value</Typography>
<Typography variant="caption">Last updated 2 hours ago</Typography>
// 错误用法——绝不要这样做
<p style={{ fontSize: '14px' }}>…</p>Brand constraint
品牌约束
Equinor brand typeface is Equinor (used in marketing). Fusion apps must use the EDS system typeface defined by — do not import or override the Equinor brand font in app CSS.
@equinor/eds-core-reactEquinor品牌字体为Equinor(用于营销场景)。Fusion应用必须使用定义的EDS系统字体——不要在应用CSS中导入或覆盖Equinor品牌字体。
@equinor/eds-core-reactSpacing tokens
间距令牌
Use and from v2 for margin, padding, and gap. Do not use arbitrary pixel values.
--eds-spacing-horizontal-<size>--eds-spacing-vertical-<size>@equinor/eds-tokensThe horizontal and vertical scales share the same size steps but may differ by a few pixels at each step; use the axis-appropriate token (horizontal for left/right, vertical for top/bottom).
| Size | Horizontal value | Vertical value | Use for |
|---|---|---|---|
| 2 px | 2 px | Micro gap, tight icon padding |
| 4 px | 4 px | XS gap |
| 6 px | 6 px | Small inset padding |
| 8 px | 8 px | SM gap, compact list spacing |
| 12 px | 12 px | Inner padding (chips, badges) |
| 16 px | 16 px | Standard content padding |
| 20 px | 20 px | LG gap, section spacing |
| 24 px | 24 px | XL gap, card separation |
| 28 px | 28 px | Major section break |
| 32 px | 32 px | Section-level whitespace |
typescript
const Section = styled.section`
padding-inline: var(--eds-spacing-horizontal-md);
padding-block: var(--eds-spacing-vertical-lg);
gap: var(--eds-spacing-vertical-sm);
`;边距、内边距和间隙均使用 v2中的和。不要使用任意像素值。
@equinor/eds-tokens--eds-spacing-horizontal-<size>--eds-spacing-vertical-<size>水平和垂直间距刻度共享相同的尺寸步骤,但每个步骤可能相差几个像素;请使用对应轴的令牌(水平方向用于左右,垂直方向用于上下)。
| 尺寸 | 水平值 | 垂直值 | 用途 |
|---|---|---|---|
| 2 px | 2 px | 微间隙、紧凑图标内边距 |
| 4 px | 4 px | 极小间隙 |
| 6 px | 6 px | 小内边距 |
| 8 px | 8 px | 小间隙、紧凑列表间距 |
| 12 px | 12 px | 内部内边距(芯片、徽章) |
| 16 px | 16 px | 标准内容内边距 |
| 20 px | 20 px | 大间隙、章节间距 |
| 24 px | 24 px | 超大间隙、卡片间距 |
| 28 px | 28 px | 主要章节分隔 |
| 32 px | 32 px | 章节级留白 |
typescript
const Section = styled.section`
padding-inline: var(--eds-spacing-horizontal-md);
padding-block: var(--eds-spacing-vertical-lg);
gap: var(--eds-spacing-vertical-sm);
`;Border radius
边框圆角
| Token / value | Use for |
|---|---|
| Standard rounded corners (cards, buttons) |
| Sharp / square corners |
| Full pill (tags, chips) |
| 令牌/值 | 用途 |
|---|---|
| 标准圆角(卡片、按钮) |
| 直角/方角 |
| 全圆角(标签、芯片) |
Elevation and shadow
层级与阴影
EDS v2 ( ^2) does not expose elevation as CSS custom properties. For elevated surfaces use the EDS component which applies the correct shadow for its variant, or use EDS tokens via the JS object import from when you need raw values in styled-components.
@equinor/eds-tokensPaperElevation@equinor/eds-tokenstypescript
import { Paper } from '@equinor/eds-core-react';
// Prefer Paper for cards/panels — elevation is handled automatically
<Paper elevation="raised">
<CardContent />
</Paper>If you need raw values from JS (rare): import from , not hardcoded values.
box-shadow@equinor/eds-tokensEDS v2( ^2)未将层级作为CSS自定义属性暴露。对于需要提升层级的表面,请使用EDS 组件,它会为其变体应用正确的阴影;当你需要在styled-components中使用原始值时,请通过的JS对象导入EDS 令牌。
@equinor/eds-tokensPaper@equinor/eds-tokensElevationtypescript
import { Paper } from '@equinor/eds-core-react';
// 卡片/面板优先使用Paper组件——层级会自动处理
<Paper elevation="raised">
<CardContent />
</Paper>如果你需要从JS中获取原始值(极少情况):请从导入,不要使用硬编码值。
box-shadow@equinor/eds-tokensIcon usage
图标使用
Use with the EDS component. Do not import SVGs directly or use third-party icon sets. Always pass icon data via the prop — do not use the string prop. Icon names from are in .
@equinor/eds-iconsIcondataname@equinor/eds-iconssnake_casetypescript
import { Icon } from '@equinor/eds-core-react';
import { add, close, settings } from '@equinor/eds-icons';
// Pass icon data object via the `data` prop; provide `title` for accessibility
<Icon data={add} title="Add" />
<Icon data={close} title="Close" size={16} />
<Icon data={settings} title="Settings" />Icon sizes follow a fixed scale: , (default), , , . Do not set arbitrary sizes.
1624324048将与EDS 组件配合使用。不要直接导入SVG或使用第三方图标集。始终通过属性传递图标数据——不要使用字符串属性。中的图标名称采用格式。
@equinor/eds-iconsIcondataname@equinor/eds-iconssnake_casetypescript
import { Icon } from '@equinor/eds-core-react';
import { add, close, settings } from '@equinor/eds-icons';
// 通过`data`属性传递图标数据对象;为了可访问性请提供`title`
<Icon data={add} title="Add" />
<Icon data={close} title="Close" size={16} />
<Icon data={settings} title="Settings" />图标尺寸遵循固定刻度:、(默认)、、、。不要设置任意尺寸。
1624324048Page layout zones
页面布局区域
Fusion Portal apps run inside the Fusion Portal shell, which owns the top navigation, left rail, and outer margins. Apps must not replicate or conflict with these zones.
Fusion Portal应用运行在Fusion Portal外壳内部,外壳负责顶部导航、左侧栏和外边距。应用不得重复或与这些区域冲突。
Three-zone app shell
三区域应用外壳
| Zone | Component | Notes |
|---|---|---|
| Top bar / header | Provided by Fusion Portal shell | Apps do not render a global header |
| Main content area | | Full available width and height |
| Side panel / detail | | Slides in from the right; do not use custom positioned overlays |
| 区域 | 组件 | 说明 |
|---|---|---|
| 顶部栏/页眉 | 由Fusion Portal外壳提供 | 应用无需渲染全局页眉 |
| 主内容区域 | | 占满可用宽度和高度 |
| 侧边面板/详情 | | 从右侧滑入;不要使用自定义定位的覆盖层 |
Layout constraints
布局约束
- Do not add outer or
marginto the root app component — the portal shell provides the content inset.padding - Use /
--eds-spacing-horizontal-<size>tokens for internal section spacing.--eds-spacing-vertical-<size> - Do not use fixed on the root container — allow content to stretch to the available viewport height.
height - Do not create custom scrollable containers that wrap the full page — the browser scroll is the standard scroll surface.
- Nested scrollable regions are acceptable for fixed-height grid/table areas, but must be deliberate and clearly bounded.
- 不要为根应用组件添加外部或
margin——门户外壳已提供内容内边距。padding - 使用/
--eds-spacing-horizontal-<size>令牌设置内部章节间距。--eds-spacing-vertical-<size> - 不要为根容器设置固定——允许内容拉伸至可用视口高度。
height - 不要创建包裹整个页面的自定义滚动容器——浏览器滚动是标准滚动表面。
- 嵌套滚动区域适用于固定高度的网格/表格区域,但必须是刻意设计且边界清晰的。
Empty and loading states
空状态与加载状态
| State | Pattern |
|---|---|
| Loading | EDS |
| Empty (no data) | EDS |
| Error | EDS |
| 状态 | 模式 |
|---|---|
| 加载中 | EDS |
| 空状态(无数据) | EDS |
| 错误状态 | EDS |
Sources
来源
- EDS design resources: https://eds.equinor.com/docs/resources/
- EDS component library: https://eds.equinor.com/components/
- Equinor brand color: https://communicationtoolbox.equinor.com/point/en/equinor/component/default/100056
- Equinor brand typography: https://communicationtoolbox.equinor.com/point/en/equinor/component/default/100059
- Equinor brand layout: https://communicationtoolbox.equinor.com/point/en/equinor/component/default/100061
- EDS设计资源:https://eds.equinor.com/docs/resources/
- EDS组件库:https://eds.equinor.com/components/
- Equinor品牌颜色:https://communicationtoolbox.equinor.com/point/en/equinor/component/default/100056
- Equinor品牌排版:https://communicationtoolbox.equinor.com/point/en/equinor/component/default/100059
- Equinor品牌布局:https://communicationtoolbox.equinor.com/point/en/equinor/component/default/100061