# 使用步骤

访客要做哪些事、按什么顺序做，以及每一步会留下什么。

“使用步骤”区块在请访客开始之前，按实际操作的顺序带他们走一遍要做的事。它是一个以网格排列的有序列表：每一步都有用文字写出的序号、一个标题、一句话，以及一块小[面板](https://ui.master.co/cn/components/surface#sheet)，展示这一步留下的成果。这一排面板本身就是论据：横向读完，产品就完整运行了一遍。

**使用步骤**

```html
<section class="container-inline px-lg py-4xl" aria-labelledby="how-title">
  <div class="flex flex-col gap-2xl max-w(1040) mx-auto">
    <header class="flex flex-col gap-sm max-w(560)">
      <p class="eyebrow">How it works</p>
      <h2 class="heading heading-2xl" id="how-title">From a repository to an address in three steps.</h2>
      <p class="lead">There is nothing to install and no pipeline to write. Atlas reads the repository and does the rest.</p>
    </header>
    <ol class="grid gap-xl row-gap-2xl m(0) p(0) grid-cols(3)@container(--4xl)">
      <li class="grid gap-md items-start grid-cols(2)@container(--xl) grid-cols(1)@container(--4xl)">
        <div class="sheet flex items-center justify-between gap-sm px-md py-sm">
          <span class="fg-text-strong truncate">atlas-labs/storefront</span>
          <span class="badge">Astro</span>
        </div>
        <div class="flex flex-col gap-xs">
          <p class="eyebrow">Step 1</p>
          <h3 class="heading heading-sm">Connect a repository</h3>
          <p class="m(0) leading-md">Sign in with your Git host and pick a repository. Atlas recognizes the framework and fills in the build command.</p>
        </div>
      </li>
      <li class="grid gap-md items-start grid-cols(2)@container(--xl) grid-cols(1)@container(--4xl)">
        <div class="sheet flex items-center justify-between gap-sm px-md py-sm">
          <code class="code truncate">git push origin main</code>
          <span class="badge badge-info badge-dot">Building</span>
        </div>
        <div class="flex flex-col gap-xs">
          <p class="eyebrow">Step 2</p>
          <h3 class="heading heading-sm">Push as you always do</h3>
          <p class="m(0) leading-md">Every push starts a build. A branch gets a preview of its own, and main goes to production.</p>
        </div>
      </li>
      <li class="grid gap-md items-start grid-cols(2)@container(--xl) grid-cols(1)@container(--4xl)">
        <div class="sheet flex items-center justify-between gap-sm px-md py-sm">
          <span class="fg-text-strong truncate">storefront.atlas.dev</span>
          <span class="badge badge-success badge-dot">Ready in 48s</span>
        </div>
        <div class="flex flex-col gap-xs">
          <p class="eyebrow">Step 3</p>
          <h3 class="heading heading-sm">Share the address</h3>
          <p class="m(0) leading-md">The deployment is live in fourteen regions with a certificate in place. Add your own domain when you are ready.</p>
        </div>
      </li>
    </ol>
    <div class="flex flex-wrap items-center gap-sm">
      <a class="btn btn-brand btn-lg" href="#">Start deploying</a>
      <a class="btn btn-lg" href="#">Read the docs</a>
    </div>
  </div>
</section>
```

区块提供可直接复制的标记，沿用页面的文字颜色和字号。预览在 body 上设置 `fg-text-body text-sm`。每个区块都是尺寸容器，会根据自身宽度重排，无论放在宽页面、侧边栏大小的空间还是对话框中。

<a id="anatomy"></a>

## 区块组成

- **步骤是一个 `<ol>`。** 顺序就是内容，所以由元素来表达：屏幕阅读器会播报“列表，3 项”以及每一步的位置。列表是一个网格，默认单列，通过 `grid-cols(3)@container(--4xl)` 变为三列。每个列表项也是网格，不绘制项目标记，因此浏览器自带的编号不会印在用文字写出的序号旁边。
- **序号是一个[引题](https://ui.master.co/cn/components/heading#eyebrow-and-lead)：“Step 1”（第 1 步）。** 它是步骤 `<h3>` 上方的 `<p>`，正如区块自己的引题位于区块标题上方。画在圆圈里的数字又是一种需要另行设计的形状，而写进 `<h3>` 的数字会让标题列表读成“1 Connect a repository”。
- **每一步都展示它留下的成果。** 一块小 `sheet` 里放一行内容：仓库和检测到的框架，命令和它启动的构建，网址和所用的时间。文字写明那里有什么，[徽标](https://ui.master.co/cn/components/badge.md)说明它的状态。排成三列时，面板位于文字上方，就像图片位于卡片标题上方，因此无论句子长短，三块面板都能对齐。宽度介于手机与三列之间时，每一步改为横排，面板排在文字旁边：横贯平板宽度的一行文字太长，不便阅读，而那么宽的面板大半是空的。
- **这些是状态，所以可以使用彩色。** “Building”（构建中）使用信息色调，“Ready in 48s”（48 秒就绪）使用成功色调，各带一个圆点，并各自用文字说出色调表达的意思。框架名称不是状态，保持中性。
- **一个步骤就是一个标题加一句话。** 三个步骤是在承诺这件事很简单。如果如实数来有七步，这个区块就不合适：那属于文档。
- **行动号召放在步骤之后**，而不是之前：“Start deploying”（开始部署）是页面上唯一的 `btn-brand`，旁边是进一步了解的入口。

<a id="accessibility"></a>

## 无障碍

- 区块是一个以其 `<h2>` 命名的 `<section>`。各步骤使用 `<h3>`，低一级。
- 保留 `<ol>`。这里没有任何地方设置 `list-style: none`；在 Safari 中，它会在去掉项目标记的同时去掉列表的角色。
- 每块面板中的那一行是对该步骤的图示，会随步骤一起读出，先于步骤标题。让它保持为文字：如果换成截图，就需要用 `alt` 说明这一步产生了什么。
- 徽标的色调绝不是唯一的信号。在强制颜色模式和黑白打印中，“Building”和“Ready in 48s”这两段文字仍能传达状态。

<a id="related"></a>

## 相关内容

- [标题](https://ui.master.co/cn/components/heading.md)
- [表面](https://ui.master.co/cn/components/surface.md)
- [徽标](https://ui.master.co/cn/components/badge.md)
- [代码](https://ui.master.co/cn/components/code.md)
- [按钮](https://ui.master.co/cn/components/button.md)

- [首屏](https://ui.master.co/cn/blocks/hero.md)
- [功能介绍](https://ui.master.co/cn/blocks/features.md)
- [定价](https://ui.master.co/cn/blocks/pricing.md)
- [行动号召](https://ui.master.co/cn/blocks/cta.md)
