导航

v2.1.0
网站页面

页面框架

由页眉、主区域和页脚组成,框架至少与视口等高。

页面是文档整体滚动时使用的框架,由页眉、主区域和页脚组成。布局类 page 让框架至少与视口等高,其余布局由工具类完成。

页面

<div class="page bg-surface-base fg-text-body text-sm">  <a class="skip" href="#page-main">Skip to content</a>  <header class="navbar" style="--navbar-padding-x: max(1.5rem, calc(50% - 21rem))">    <a class="navbar-brand" href="#">      <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">        <circle cx="8" cy="8" r="6" /><path d="M8 4.3333A3.6667 3.6667 0 0 1 8 11.6667Z" fill="currentColor" stroke="none" />      </svg>Atlas    </a>    <nav class="navbar-nav" aria-label="Main">      <a class="navbar-link" href="#">Product</a>      <a class="navbar-link" href="#">Pricing</a>      <a class="navbar-link" href="#">Docs</a>      <a class="navbar-link" href="#" aria-current="page">Changelog</a>    </nav>    <div class="navbar-end">      <a class="btn btn-sm" href="#">Sign in</a>      <button type="button" class="btn btn-quiet btn-square btn-sm navbar-toggle" popovertarget="page-menu" aria-label="Open the menu">        <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">          <path d="M3 5.5L13 5.5" /><path d="M3 10.5L13 10.5" />        </svg>      </button>      <div class="menu menu-end" id="page-menu" popover>        <a class="menu-item" href="#">Product</a>        <a class="menu-item" href="#">Pricing</a>        <a class="menu-item" href="#">Docs</a>        <a class="menu-item" href="#" aria-current="page">Changelog</a>      </div>    </div>  </header>  <main class="grow(1) w-full max-w(720) mx-auto px-lg py-2xl" id="page-main" tabindex="-1">    <p class="eyebrow">Changelog</p>    <h1 class="heading heading-2xl mt-xs">What shipped this month</h1>    <p class="lead mt-md">      Every change to Atlas, newest first. Subscribe to the feed to hear about them as they land.    </p>    <div class="flex flex-col gap-xl mt-2xl">      <article class="flex flex-col gap-xs">        <p class="m(0) text-xs fg-text-muted">          <span class="badge badge-sm">4.2</span>          <time class="ml-xs" datetime="2026-10-28">28 October</time>        </p>        <h2 class="heading">Faster cold builds</h2>        <p class="m(0) leading-md">          Dependency caches are now restored before the install step, which removes about forty seconds from a cold build. Nothing to configure.        </p>      </article>      <article class="flex flex-col gap-xs">        <p class="m(0) text-xs fg-text-muted">          <span class="badge badge-sm">4.1</span>          <time class="ml-xs" datetime="2026-10-14">14 October</time>        </p>        <h2 class="heading">Preview comments</h2>        <p class="m(0) leading-md">          Leave a comment on any preview deployment, pinned to the element you clicked. Comments follow the element between deployments.        </p>      </article>      <article class="flex flex-col gap-xs">        <p class="m(0) text-xs fg-text-muted">          <span class="badge badge-sm">4.0</span>          <time class="ml-xs" datetime="2026-10-01">1 October</time>        </p>        <h2 class="heading">A new dashboard</h2>        <p class="m(0) leading-md">          Projects, domains and usage now live on one page, and every list can be filtered from the keyboard.        </p>      </article>    </div>  </main>  <footer class="bt(1) bt-solid b-line-hair">    <div class="flex flex-wrap items-center justify-between gap-sm w-full max-w(720) mx-auto px-lg py-lg text-xs fg-text-muted">      <span>© 2026 Atlas Labs</span>      <nav class="flex flex-wrap gap-lg" aria-label="Footer">        <a class="link link-quiet" href="#">Privacy</a>        <a class="link link-quiet" href="#">Terms</a>        <a class="link link-quiet" href="#">Status</a>      </nav>    </div>  </footer></div>
import ContrastIcon from '@master/icons-react/native/16/soft/contrast'import MenuIcon from '@master/icons-react/native/16/soft/menu'<div className="page bg-surface-base fg-text-body text-sm">  <a className="skip" href="#page-main">Skip to content</a>  <header className="navbar" style={{ '--navbar-padding-x': 'max(1.5rem, calc(50% - 21rem))' } as React.CSSProperties}>    <a className="navbar-brand" href="#"><ContrastIcon className="icon" />Atlas</a>    <nav className="navbar-nav" aria-label="Main">      <a className="navbar-link" href="#">Product</a>      <a className="navbar-link" href="#">Pricing</a>      <a className="navbar-link" href="#">Docs</a>      <a className="navbar-link" href="#" aria-current="page">Changelog</a>    </nav>    <div className="navbar-end">      <a className="btn btn-sm" href="#">Sign in</a>      <button type="button" className="btn btn-quiet btn-square btn-sm navbar-toggle" popoverTarget="page-menu" aria-label="Open the menu">        <MenuIcon className="icon" />      </button>      <div className="menu menu-end" id="page-menu" popover="">        <a className="menu-item" href="#">Product</a>        <a className="menu-item" href="#">Pricing</a>        <a className="menu-item" href="#">Docs</a>        <a className="menu-item" href="#" aria-current="page">Changelog</a>      </div>    </div>  </header>  <main className="grow(1) w-full max-w(720) mx-auto px-lg py-2xl" id="page-main" tabIndex={-1}>    <p className="eyebrow">Changelog</p>    <h1 className="heading heading-2xl mt-xs">What shipped this month</h1>    <p className="lead mt-md">      Every change to Atlas, newest first. Subscribe to the feed to hear about them as they land.    </p>    <div className="flex flex-col gap-xl mt-2xl">      <article className="flex flex-col gap-xs">        <p className="m(0) text-xs fg-text-muted">          <span className="badge badge-sm">4.2</span>          <time className="ml-xs" dateTime="2026-10-28">28 October</time>        </p>        <h2 className="heading">Faster cold builds</h2>        <p className="m(0) leading-md">          Dependency caches are now restored before the install step, which removes about forty seconds from a cold build. Nothing to configure.        </p>      </article>      <article className="flex flex-col gap-xs">        <p className="m(0) text-xs fg-text-muted">          <span className="badge badge-sm">4.1</span>          <time className="ml-xs" dateTime="2026-10-14">14 October</time>        </p>        <h2 className="heading">Preview comments</h2>        <p className="m(0) leading-md">          Leave a comment on any preview deployment, pinned to the element you clicked. Comments follow the element between deployments.        </p>      </article>      <article className="flex flex-col gap-xs">        <p className="m(0) text-xs fg-text-muted">          <span className="badge badge-sm">4.0</span>          <time className="ml-xs" dateTime="2026-10-01">1 October</time>        </p>        <h2 className="heading">A new dashboard</h2>        <p className="m(0) leading-md">          Projects, domains and usage now live on one page, and every list can be filtered from the keyboard.        </p>      </article>    </div>  </main>  <footer className="bt(1) bt-solid b-line-hair">    <div className="flex flex-wrap items-center justify-between gap-sm w-full max-w(720) mx-auto px-lg py-lg text-xs fg-text-muted">      <span>© 2026 Atlas Labs</span>      <nav className="flex flex-wrap gap-lg" aria-label="Footer">        <a className="link link-quiet" href="#">Privacy</a>        <a className="link link-quiet" href="#">Terms</a>        <a className="link link-quiet" href="#">Status</a>      </nav>    </div>  </footer></div>
<script>  import ContrastIcon from '@master/icons-svelte/native/16/soft/contrast'  import MenuIcon from '@master/icons-svelte/native/16/soft/menu'</script><div class="page bg-surface-base fg-text-body text-sm">  <a class="skip" href="#page-main">Skip to content</a>  <header class="navbar" style="--navbar-padding-x: max(1.5rem, calc(50% - 21rem))">    <a class="navbar-brand" href="#"><ContrastIcon class="icon" />Atlas</a>    <nav class="navbar-nav" aria-label="Main">      <a class="navbar-link" href="#">Product</a>      <a class="navbar-link" href="#">Pricing</a>      <a class="navbar-link" href="#">Docs</a>      <a class="navbar-link" href="#" aria-current="page">Changelog</a>    </nav>    <div class="navbar-end">      <a class="btn btn-sm" href="#">Sign in</a>      <button type="button" class="btn btn-quiet btn-square btn-sm navbar-toggle" popovertarget="page-menu" aria-label="Open the menu">        <MenuIcon class="icon" />      </button>      <div class="menu menu-end" id="page-menu" popover>        <a class="menu-item" href="#">Product</a>        <a class="menu-item" href="#">Pricing</a>        <a class="menu-item" href="#">Docs</a>        <a class="menu-item" href="#" aria-current="page">Changelog</a>      </div>    </div>  </header>  <main class="grow(1) w-full max-w(720) mx-auto px-lg py-2xl" id="page-main" tabindex="-1">    <p class="eyebrow">Changelog</p>    <h1 class="heading heading-2xl mt-xs">What shipped this month</h1>    <p class="lead mt-md">      Every change to Atlas, newest first. Subscribe to the feed to hear about them as they land.    </p>    <div class="flex flex-col gap-xl mt-2xl">      <article class="flex flex-col gap-xs">        <p class="m(0) text-xs fg-text-muted">          <span class="badge badge-sm">4.2</span>          <time class="ml-xs" datetime="2026-10-28">28 October</time>        </p>        <h2 class="heading">Faster cold builds</h2>        <p class="m(0) leading-md">          Dependency caches are now restored before the install step, which removes about forty seconds from a cold build. Nothing to configure.        </p>      </article>      <article class="flex flex-col gap-xs">        <p class="m(0) text-xs fg-text-muted">          <span class="badge badge-sm">4.1</span>          <time class="ml-xs" datetime="2026-10-14">14 October</time>        </p>        <h2 class="heading">Preview comments</h2>        <p class="m(0) leading-md">          Leave a comment on any preview deployment, pinned to the element you clicked. Comments follow the element between deployments.        </p>      </article>      <article class="flex flex-col gap-xs">        <p class="m(0) text-xs fg-text-muted">          <span class="badge badge-sm">4.0</span>          <time class="ml-xs" datetime="2026-10-01">1 October</time>        </p>        <h2 class="heading">A new dashboard</h2>        <p class="m(0) leading-md">          Projects, domains and usage now live on one page, and every list can be filtered from the keyboard.        </p>      </article>    </div>  </main>  <footer class="bt(1) bt-solid b-line-hair">    <div class="flex flex-wrap items-center justify-between gap-sm w-full max-w(720) mx-auto px-lg py-lg text-xs fg-text-muted">      <span>© 2026 Atlas Labs</span>      <nav class="flex flex-wrap gap-lg" aria-label="Footer">        <a class="link link-quiet" href="#">Privacy</a>        <a class="link link-quiet" href="#">Terms</a>        <a class="link link-quiet" href="#">Status</a>      </nav>    </div>  </footer></div>
<script setup>import ContrastIcon from '@master/icons-vue/native/16/soft/contrast'import MenuIcon from '@master/icons-vue/native/16/soft/menu'</script><template>  <div class="page bg-surface-base fg-text-body text-sm">    <a class="skip" href="#page-main">Skip to content</a>    <header class="navbar" style="--navbar-padding-x: max(1.5rem, calc(50% - 21rem))">      <a class="navbar-brand" href="#"><ContrastIcon class="icon" />Atlas</a>      <nav class="navbar-nav" aria-label="Main">        <a class="navbar-link" href="#">Product</a>        <a class="navbar-link" href="#">Pricing</a>        <a class="navbar-link" href="#">Docs</a>        <a class="navbar-link" href="#" aria-current="page">Changelog</a>      </nav>      <div class="navbar-end">        <a class="btn btn-sm" href="#">Sign in</a>        <button type="button" class="btn btn-quiet btn-square btn-sm navbar-toggle" popovertarget="page-menu" aria-label="Open the menu">          <MenuIcon class="icon" />        </button>        <div class="menu menu-end" id="page-menu" popover>          <a class="menu-item" href="#">Product</a>          <a class="menu-item" href="#">Pricing</a>          <a class="menu-item" href="#">Docs</a>          <a class="menu-item" href="#" aria-current="page">Changelog</a>        </div>      </div>    </header>    <main class="grow(1) w-full max-w(720) mx-auto px-lg py-2xl" id="page-main" tabindex="-1">      <p class="eyebrow">Changelog</p>      <h1 class="heading heading-2xl mt-xs">What shipped this month</h1>      <p class="lead mt-md">        Every change to Atlas, newest first. Subscribe to the feed to hear about them as they land.      </p>      <div class="flex flex-col gap-xl mt-2xl">        <article class="flex flex-col gap-xs">          <p class="m(0) text-xs fg-text-muted">            <span class="badge badge-sm">4.2</span>            <time class="ml-xs" datetime="2026-10-28">28 October</time>          </p>          <h2 class="heading">Faster cold builds</h2>          <p class="m(0) leading-md">            Dependency caches are now restored before the install step, which removes about forty seconds from a cold build. Nothing to configure.          </p>        </article>        <article class="flex flex-col gap-xs">          <p class="m(0) text-xs fg-text-muted">            <span class="badge badge-sm">4.1</span>            <time class="ml-xs" datetime="2026-10-14">14 October</time>          </p>          <h2 class="heading">Preview comments</h2>          <p class="m(0) leading-md">            Leave a comment on any preview deployment, pinned to the element you clicked. Comments follow the element between deployments.          </p>        </article>        <article class="flex flex-col gap-xs">          <p class="m(0) text-xs fg-text-muted">            <span class="badge badge-sm">4.0</span>            <time class="ml-xs" datetime="2026-10-01">1 October</time>          </p>          <h2 class="heading">A new dashboard</h2>          <p class="m(0) leading-md">            Projects, domains and usage now live on one page, and every list can be filtered from the keyboard.          </p>        </article>      </div>    </main>    <footer class="bt(1) bt-solid b-line-hair">      <div class="flex flex-wrap items-center justify-between gap-sm w-full max-w(720) mx-auto px-lg py-lg text-xs fg-text-muted">        <span>© 2026 Atlas Labs</span>        <nav class="flex flex-wrap gap-lg" aria-label="Footer">          <a class="link link-quiet" href="#">Privacy</a>          <a class="link link-quiet" href="#">Terms</a>          <a class="link link-quiet" href="#">Status</a>        </nav>      </div>    </footer>  </div></template>
滚动页面,内容滚到导航栏背后时,导航栏才会呈现其表面材质。

#布局结构

  • 在页面框架上使用 page。 框架采用纵向布局,最小高度为 100dvh。动态视口单位随手机工具栏的显示和隐藏而变化,让框架的最小高度始终贴合可见区域,既不会超出,也不会留下空隙。这里唯一无法用工具类表达的就是这一点。
  • 在主区域上使用 grow(1)。 主区域占据剩余空间,让内容较少时页脚也能留在页面底部。
  • 仅在内容层限制宽度。 页眉和页脚横跨整个页面。主区域与页脚内的内容共用宽度 max-w(720) mx-auto px-lg,使两者边缘对齐。导航栏通过 --navbar-padding-x: max(1.5rem, calc(50% - 21rem)) 对齐同一条边线,也就是从中央向外半个宽度。索引页可以用更宽的尺寸,阅读页用这里的宽度。
  • 表面由组件提供。 导航栏使用自带粘性定位的 navbar,页脚上方的细线由边框工具类绘制。

#内容较少的页面

内容高度小于视口时,主区域仍会占据剩余空间,页脚留在页面底部。在主区域上使用 flex items-center justify-center,让少量内容居中。

内容较少的页面

<div class="page bg-surface-base fg-text-body text-sm">  <a class="skip" href="#page-main-short">Skip to content</a>  <header class="navbar" style="--navbar-padding-x: 1.5rem">    <a class="navbar-brand" href="#">      <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">        <circle cx="8" cy="8" r="6" /><path d="M8 4.3333A3.6667 3.6667 0 0 1 8 11.6667Z" fill="currentColor" stroke="none" />      </svg>Atlas    </a>    <nav class="navbar-nav" aria-label="Main">      <a class="navbar-link" href="#">Product</a>      <a class="navbar-link" href="#">Pricing</a>      <a class="navbar-link" href="#">Docs</a>      <a class="navbar-link" href="#" aria-current="page">Changelog</a>    </nav>    <div class="navbar-end">      <a class="btn btn-sm" href="#">Sign in</a>      <button type="button" class="btn btn-quiet btn-square btn-sm navbar-toggle" popovertarget="page-menu-short" aria-label="Open the menu">        <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">          <path d="M3 5.5L13 5.5" /><path d="M3 10.5L13 10.5" />        </svg>      </button>      <div class="menu menu-end" id="page-menu-short" popover>        <a class="menu-item" href="#">Product</a>        <a class="menu-item" href="#">Pricing</a>        <a class="menu-item" href="#">Docs</a>        <a class="menu-item" href="#" aria-current="page">Changelog</a>      </div>    </div>  </header>  <main class="grow(1) flex items-center justify-center p-lg" id="page-main-short" tabindex="-1">    <div class="empty">      <div class="icon-frame empty-media" aria-hidden="true">        <svg class="icon" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">          <path d="M10 1.6667C5 5.8333 4.5833 10.8333 7.0833 15.4167H12.9167C15.4167 10.8333 15 5.8333 10 1.6667Z" /><circle cx="10" cy="8.3333" r="1" fill="currentColor" stroke="none" /><path d="M12.5059 15.4167Q12.6134 15.5471 12.7721 15.6266L15.7283 17.1047A0.8249 0.8249 0 0 0 16.9109 16.5023L17.6842 11.8631A0.8257 0.8257 0 0 0 17.4914 11.1839L14.9083 8.2317A0.8274 0.8274 0 0 0 14.1839 7.9561C14.3744 8.793 14.4431 9.6377 14.3995 10.4832L14.5438 9.7135L16.4181 11.8557L15.7727 15.7292L13.6179 14.6519L13.9005 13.1446C13.6551 13.9094 13.3247 14.6686 12.9167 15.4167H12.5059ZM5.8161 7.9561A0.8199 0.8199 0 0 0 5.0917 8.2318L2.5086 11.1839A0.8257 0.8257 0 0 0 2.3158 11.8631L3.089 16.5023A0.825 0.825 0 0 0 4.2717 17.1047L7.2279 15.6266Q7.3866 15.5471 7.4941 15.4167H7.0833C6.6753 14.6686 6.3449 13.9094 6.0995 13.1446L6.3821 14.6519L4.2274 15.7292L3.5818 11.8557L5.4562 9.7135L5.6005 10.4832C5.5569 9.6377 5.6256 8.793 5.8161 7.9561Z" fill="currentColor" stroke="none" fill-rule="evenodd" /><path d="M8.3333 18.75L11.6667 18.75" />        </svg>      </div>      <h1 class="empty-title">Nothing has shipped yet</h1>      <p class="empty-description">The first entry appears here with the first release.</p>      <div class="empty-actions">        <button type="button" class="btn btn-sm">Subscribe to the feed</button>      </div>    </div>  </main>  <footer class="bt(1) bt-solid b-line-hair">    <div class="flex flex-wrap items-center justify-between gap-sm w-full max-w(720) mx-auto px-lg py-lg text-xs fg-text-muted">      <span>© 2026 Atlas Labs</span>      <nav class="flex flex-wrap gap-lg" aria-label="Footer">        <a class="link link-quiet" href="#">Privacy</a>        <a class="link link-quiet" href="#">Terms</a>        <a class="link link-quiet" href="#">Status</a>      </nav>    </div>  </footer></div>
import ContrastIcon from '@master/icons-react/native/16/soft/contrast'import MenuIcon from '@master/icons-react/native/16/soft/menu'import RocketIcon from '@master/icons-react/native/20/soft/rocket'<div className="page bg-surface-base fg-text-body text-sm">  <a className="skip" href="#page-main-short">Skip to content</a>  <header className="navbar" style={{ '--navbar-padding-x': '1.5rem' } as React.CSSProperties}>    <a className="navbar-brand" href="#"><ContrastIcon className="icon" />Atlas</a>    <nav className="navbar-nav" aria-label="Main">      <a className="navbar-link" href="#">Product</a>      <a className="navbar-link" href="#">Pricing</a>      <a className="navbar-link" href="#">Docs</a>      <a className="navbar-link" href="#" aria-current="page">Changelog</a>    </nav>    <div className="navbar-end">      <a className="btn btn-sm" href="#">Sign in</a>      <button type="button" className="btn btn-quiet btn-square btn-sm navbar-toggle" popoverTarget="page-menu-short" aria-label="Open the menu">        <MenuIcon className="icon" />      </button>      <div className="menu menu-end" id="page-menu-short" popover="">        <a className="menu-item" href="#">Product</a>        <a className="menu-item" href="#">Pricing</a>        <a className="menu-item" href="#">Docs</a>        <a className="menu-item" href="#" aria-current="page">Changelog</a>      </div>    </div>  </header>  <main className="grow(1) flex items-center justify-center p-lg" id="page-main-short" tabIndex={-1}>    <div className="empty">      <div className="icon-frame empty-media" aria-hidden="true">        <RocketIcon className="icon" />      </div>      <h1 className="empty-title">Nothing has shipped yet</h1>      <p className="empty-description">The first entry appears here with the first release.</p>      <div className="empty-actions">        <button type="button" className="btn btn-sm">Subscribe to the feed</button>      </div>    </div>  </main>  <footer className="bt(1) bt-solid b-line-hair">    <div className="flex flex-wrap items-center justify-between gap-sm w-full max-w(720) mx-auto px-lg py-lg text-xs fg-text-muted">      <span>© 2026 Atlas Labs</span>      <nav className="flex flex-wrap gap-lg" aria-label="Footer">        <a className="link link-quiet" href="#">Privacy</a>        <a className="link link-quiet" href="#">Terms</a>        <a className="link link-quiet" href="#">Status</a>      </nav>    </div>  </footer></div>
<script>  import ContrastIcon from '@master/icons-svelte/native/16/soft/contrast'  import MenuIcon from '@master/icons-svelte/native/16/soft/menu'  import RocketIcon from '@master/icons-svelte/native/20/soft/rocket'</script><div class="page bg-surface-base fg-text-body text-sm">  <a class="skip" href="#page-main-short">Skip to content</a>  <header class="navbar" style="--navbar-padding-x: 1.5rem">    <a class="navbar-brand" href="#"><ContrastIcon class="icon" />Atlas</a>    <nav class="navbar-nav" aria-label="Main">      <a class="navbar-link" href="#">Product</a>      <a class="navbar-link" href="#">Pricing</a>      <a class="navbar-link" href="#">Docs</a>      <a class="navbar-link" href="#" aria-current="page">Changelog</a>    </nav>    <div class="navbar-end">      <a class="btn btn-sm" href="#">Sign in</a>      <button type="button" class="btn btn-quiet btn-square btn-sm navbar-toggle" popovertarget="page-menu-short" aria-label="Open the menu">        <MenuIcon class="icon" />      </button>      <div class="menu menu-end" id="page-menu-short" popover>        <a class="menu-item" href="#">Product</a>        <a class="menu-item" href="#">Pricing</a>        <a class="menu-item" href="#">Docs</a>        <a class="menu-item" href="#" aria-current="page">Changelog</a>      </div>    </div>  </header>  <main class="grow(1) flex items-center justify-center p-lg" id="page-main-short" tabindex="-1">    <div class="empty">      <div class="icon-frame empty-media" aria-hidden="true"><RocketIcon class="icon" /></div>      <h1 class="empty-title">Nothing has shipped yet</h1>      <p class="empty-description">The first entry appears here with the first release.</p>      <div class="empty-actions">        <button type="button" class="btn btn-sm">Subscribe to the feed</button>      </div>    </div>  </main>  <footer class="bt(1) bt-solid b-line-hair">    <div class="flex flex-wrap items-center justify-between gap-sm w-full max-w(720) mx-auto px-lg py-lg text-xs fg-text-muted">      <span>© 2026 Atlas Labs</span>      <nav class="flex flex-wrap gap-lg" aria-label="Footer">        <a class="link link-quiet" href="#">Privacy</a>        <a class="link link-quiet" href="#">Terms</a>        <a class="link link-quiet" href="#">Status</a>      </nav>    </div>  </footer></div>
<script setup>import ContrastIcon from '@master/icons-vue/native/16/soft/contrast'import MenuIcon from '@master/icons-vue/native/16/soft/menu'import RocketIcon from '@master/icons-vue/native/20/soft/rocket'</script><template>  <div class="page bg-surface-base fg-text-body text-sm">    <a class="skip" href="#page-main-short">Skip to content</a>    <header class="navbar" style="--navbar-padding-x: 1.5rem">      <a class="navbar-brand" href="#"><ContrastIcon class="icon" />Atlas</a>      <nav class="navbar-nav" aria-label="Main">        <a class="navbar-link" href="#">Product</a>        <a class="navbar-link" href="#">Pricing</a>        <a class="navbar-link" href="#">Docs</a>        <a class="navbar-link" href="#" aria-current="page">Changelog</a>      </nav>      <div class="navbar-end">        <a class="btn btn-sm" href="#">Sign in</a>        <button type="button" class="btn btn-quiet btn-square btn-sm navbar-toggle" popovertarget="page-menu-short" aria-label="Open the menu">          <MenuIcon class="icon" />        </button>        <div class="menu menu-end" id="page-menu-short" popover>          <a class="menu-item" href="#">Product</a>          <a class="menu-item" href="#">Pricing</a>          <a class="menu-item" href="#">Docs</a>          <a class="menu-item" href="#" aria-current="page">Changelog</a>        </div>      </div>    </header>    <main class="grow(1) flex items-center justify-center p-lg" id="page-main-short" tabindex="-1">      <div class="empty">        <div class="icon-frame empty-media" aria-hidden="true"><RocketIcon class="icon" /></div>        <h1 class="empty-title">Nothing has shipped yet</h1>        <p class="empty-description">The first entry appears here with the first release.</p>        <div class="empty-actions">          <button type="button" class="btn btn-sm">Subscribe to the feed</button>        </div>      </div>    </main>    <footer class="bt(1) bt-solid b-line-hair">      <div class="flex flex-wrap items-center justify-between gap-sm w-full max-w(720) mx-auto px-lg py-lg text-xs fg-text-muted">        <span>© 2026 Atlas Labs</span>        <nav class="flex flex-wrap gap-lg" aria-label="Footer">          <a class="link link-quiet" href="#">Privacy</a>          <a class="link link-quiet" href="#">Terms</a>          <a class="link link-quiet" href="#">Status</a>        </nav>      </div>    </footer>  </div></template>

#可以用它构建的页面

站点的大多数页面,都是这个框架在主区域中放入其他内容。

页面主区域中的内容
文章、博客文章、更新日志出栏布局:一个阅读栏,图片或表格可以伸出栏外
旁边带目录的长文章文档页,它增加了导航和目录
搜索、资源目录搜索结果页:筛选条件位于所得结果的旁边
落地页依次排列的区块:首屏、功能特性、定价、行动号召
登录、错误页面位于中央的一张卡片:居中布局

#无障碍

  • 使用页面地标 <header>、<main> 和 <footer>,每种各用一个,并为每个 <nav> 提供标签。
  • 将指向主区域的跳过链接放在页面首位,并为主区域设置 tabindex="-1",让焦点随跳转移到主区域。使用键盘的读者按一次键即可跳过页眉。
  • 粘性页眉会覆盖页面顶部。在根元素上将 scroll-padding-top 设为页眉的高度,为链接跳转到的标题留出空间。也可以在这些目标标题上使用 flash,让各个标题自行避开页眉。

#类名

类名说明
page纵向框架,高度至少为视口高度,以 dvh 计。不绘制任何视觉样式。

#源码

@master/ui/layouts/page.css
/* * Page: the frame of a document that scrolls as a whole. A header, the main region and a footer stack in it. * The frame is at least as tall as the viewport, measured in dvh, so the toolbars a phone shows and hides * neither leave a gap under the footer nor push it out of reach. Give the main region `grow(1)` and it takes * the room that is left, which keeps the footer at the foot of a short page. * A page draws nothing: its surfaces come from components. */@layer components.ui {  .page {    display: flex;    flex-direction: column;    min-width: 0;    /* vh for engines without dynamic viewport units; dvh replaces it where it is known. */    min-height: 100vh;    min-height: 100dvh;  }}