导航

v2.1.0
应用页面

应用框架

主区域滚动时侧边栏留在原位,空间不足时改用抽屉。

应用框架是应用的页面框架,主区域滚动时,侧边栏留在原位。它基于 shell 布局类,由这些类处理工具类无法表达的布局细节,包括以 dvh 为单位的高度、可独立滚动的粘性侧边栏、为主屏幕指示条预留的安全区内边距,以及隐藏侧边栏的宽度阈值。

应用框架只负责布局。示例用边框工具类绘制细线,用导航栏显示顶部栏,用导航组织链接,并在自动网格中排列卡片。

应用框架

<div class="shell bg-surface-base fg-text-body text-sm">  <a class="skip" href="#app-main">Skip to content</a>  <aside class="shell-sidebar gap-md p-sm bxe(1) bxe-solid b-line-hair">    <a class="navbar-brand h(40) px-xs" 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="nav" aria-label="Workspace">      <a class="nav-item" 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">          <path d="M3 13L3 6.9624A1 1 0 0 1 3.3524 6.2005L7.3524 2.8005A1 1 0 0 1 8.6476 2.8005L12.6476 6.2005A1 1 0 0 1 13 6.9624L13 13A1 1 0 0 1 12 14L4 14A1 1 0 0 1 3 13Z" /><path d="M6.5 14L6.5 11A1 1 0 0 1 7.5 10L8.5 10A1 1 0 0 1 9.5 11L9.5 14" />        </svg>Overview      </a>      <a class="nav-item" href="#" aria-current="page">        <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">          <rect x="2.5" y="2.5" width="4" height="4" rx="1" /><rect x="9.5" y="2.5" width="4" height="4" rx="1" /><rect x="2.5" y="9.5" width="4" height="4" rx="1" /><rect x="9.5" y="9.5" width="4" height="4" rx="1" />        </svg>Projects<span class="nav-end">12</span>      </a>      <a class="nav-item" 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.7707 2.0497A6.0005 6.0005 0 0 0 7.2293 2.0497Q6.1162 3.1938 5.4813 4.6077Q4.8542 6.0044 4.7648 7.5H2.0209A5.9913 5.9913 0 0 0 2.0209 8.5H4.7648Q4.8542 9.9956 5.4813 11.3923Q6.1162 12.8062 7.2293 13.9503A6.0005 6.0005 0 0 0 8.7707 13.9503Q9.8838 12.8062 10.5187 11.3923Q11.1458 9.9956 11.2352 8.5H13.9791A5.9913 5.9913 0 0 0 13.9791 7.5H11.2352Q11.1458 6.0044 10.5187 4.6077Q9.8838 3.1938 8.7707 2.0497ZM9.6064 5.0173Q10.1455 6.2181 10.2331 7.5H5.7669Q5.8545 6.2181 6.3936 5.0173Q6.971 3.7314 8 2.6921Q9.029 3.7314 9.6064 5.0173ZM6.3936 10.9827Q5.8545 9.7819 5.7669 8.5H10.2331Q10.1455 9.7819 9.6064 10.9827Q9.029 12.2686 8 13.3079Q6.971 12.2686 6.3936 10.9827Z" fill="currentColor" stroke="none" fill-rule="evenodd" />        </svg>Domains      </a>      <a class="nav-item" 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">          <rect x="2" y="8" width="2.5" height="6" rx="0.75" /><rect x="6.75" y="3" width="2.5" height="11" rx="0.75" /><rect x="11.5" y="6" width="2.5" height="8" rx="0.75" />        </svg>Analytics      </a>      <a class="nav-item" 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="6.25" cy="4.5" r="2" /><path d="M2.25 13.75V12.5C2.25 10.7 3.85 9.5 5.35 9.5H7.15C8.65 9.5 10.25 10.7 10.25 12.5V13.75" /><path d="M11.1 2.6C13.8 2.6 13.8 6.6 11.1 6.6" /><path d="M12 9.5C13.5 9.75 14.25 11.25 14.25 12.5V13.75" />        </svg>Team      </a>      <a class="nav-item" 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">          <path d="M2.5 4.5L4.5 4.5" /><circle cx="6" cy="4.5" r="1.5" /><path d="M7.5 4.5L13.5 4.5" /><path d="M2.5 11.5L8.5 11.5" /><circle cx="10" cy="11.5" r="1.5" /><path d="M11.5 11.5L13.5 11.5" />        </svg>Settings      </a>    </nav>    <button type="button" class="btn btn-quiet justify-start px-xs mt-auto">      <span class="avatar avatar-xs" aria-hidden="true">        <img class="avatar-image" src="/demo/people/yiching-lin.webp" alt width="20" height="20"><span class="avatar-fallback">YL</span>      </span>Yi-ching Lin    </button>  </aside>  <main class="shell-main" id="app-main" tabindex="-1">    <header class="navbar" style="--navbar-padding-x: 1.5rem">      <button type="button" class="btn btn-quiet btn-square btn-sm shell-toggle" commandfor="shell-nav" command="show-modal" aria-label="Open navigation">        <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>      <h1 class="heading heading-sm">Projects</h1>      <div class="navbar-end">        <button type="button" class="btn btn-quiet btn-square btn-sm" aria-label="Search">          <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="7" cy="7" r="4.5" /><path d="M10.182 10.182L14 14" />          </svg>        </button>        <button type="button" class="btn btn-primary btn-sm">          <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 8L13 8" /><path d="M8 3L8 13" />          </svg>New project        </button>      </div>    </header>    <div class="p-lg">      <ul class="auto-grid">        <li>          <article class="card">            <header class="card-header">              <h2 class="card-title">Atlas</h2>              <p class="card-description">atlas.dev</p>              <span class="badge badge-success badge-dot card-action">Ready</span>            </header>          </article>        </li>        <li>          <article class="card">            <header class="card-header">              <h2 class="card-title">Borealis</h2>              <p class="card-description">borealis.app</p>              <span class="badge badge-info badge-dot card-action">Building</span>            </header>          </article>        </li>        <li>          <article class="card">            <header class="card-header">              <h2 class="card-title">Cinder</h2>              <p class="card-description">cinder.io</p>              <span class="badge badge-success badge-dot card-action">Ready</span>            </header>          </article>        </li>        <li>          <article class="card">            <header class="card-header">              <h2 class="card-title">Drift</h2>              <p class="card-description">drift.so</p>              <span class="badge badge-danger badge-dot card-action">Failed</span>            </header>          </article>        </li>        <li>          <article class="card">            <header class="card-header">              <h2 class="card-title">Ember</h2>              <p class="card-description">ember.dev</p>              <span class="badge badge-success badge-dot card-action">Ready</span>            </header>          </article>        </li>        <li>          <article class="card">            <header class="card-header">              <h2 class="card-title">Fathom</h2>              <p class="card-description">fathom.app</p>              <span class="badge badge-success badge-dot card-action">Ready</span>            </header>          </article>        </li>      </ul>    </div>  </main>  <dialog class="dialog dialog-drawer dialog-drawer-start" id="shell-nav" closedby="any" aria-label="Navigation">    <div class="dialog-body flex flex-col gap-md">      <a class="navbar-brand h(40) px-xs" 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="nav" aria-label="Workspace, in the drawer">        <a class="nav-item" 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">            <path d="M3 13L3 6.9624A1 1 0 0 1 3.3524 6.2005L7.3524 2.8005A1 1 0 0 1 8.6476 2.8005L12.6476 6.2005A1 1 0 0 1 13 6.9624L13 13A1 1 0 0 1 12 14L4 14A1 1 0 0 1 3 13Z" /><path d="M6.5 14L6.5 11A1 1 0 0 1 7.5 10L8.5 10A1 1 0 0 1 9.5 11L9.5 14" />          </svg>Overview        </a>        <a class="nav-item" href="#" aria-current="page">          <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">            <rect x="2.5" y="2.5" width="4" height="4" rx="1" /><rect x="9.5" y="2.5" width="4" height="4" rx="1" /><rect x="2.5" y="9.5" width="4" height="4" rx="1" /><rect x="9.5" y="9.5" width="4" height="4" rx="1" />          </svg>Projects<span class="nav-end">12</span>        </a>        <a class="nav-item" 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.7707 2.0497A6.0005 6.0005 0 0 0 7.2293 2.0497Q6.1162 3.1938 5.4813 4.6077Q4.8542 6.0044 4.7648 7.5H2.0209A5.9913 5.9913 0 0 0 2.0209 8.5H4.7648Q4.8542 9.9956 5.4813 11.3923Q6.1162 12.8062 7.2293 13.9503A6.0005 6.0005 0 0 0 8.7707 13.9503Q9.8838 12.8062 10.5187 11.3923Q11.1458 9.9956 11.2352 8.5H13.9791A5.9913 5.9913 0 0 0 13.9791 7.5H11.2352Q11.1458 6.0044 10.5187 4.6077Q9.8838 3.1938 8.7707 2.0497ZM9.6064 5.0173Q10.1455 6.2181 10.2331 7.5H5.7669Q5.8545 6.2181 6.3936 5.0173Q6.971 3.7314 8 2.6921Q9.029 3.7314 9.6064 5.0173ZM6.3936 10.9827Q5.8545 9.7819 5.7669 8.5H10.2331Q10.1455 9.7819 9.6064 10.9827Q9.029 12.2686 8 13.3079Q6.971 12.2686 6.3936 10.9827Z" fill="currentColor" stroke="none" fill-rule="evenodd" />          </svg>Domains        </a>        <a class="nav-item" 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">            <rect x="2" y="8" width="2.5" height="6" rx="0.75" /><rect x="6.75" y="3" width="2.5" height="11" rx="0.75" /><rect x="11.5" y="6" width="2.5" height="8" rx="0.75" />          </svg>Analytics        </a>        <a class="nav-item" 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="6.25" cy="4.5" r="2" /><path d="M2.25 13.75V12.5C2.25 10.7 3.85 9.5 5.35 9.5H7.15C8.65 9.5 10.25 10.7 10.25 12.5V13.75" /><path d="M11.1 2.6C13.8 2.6 13.8 6.6 11.1 6.6" /><path d="M12 9.5C13.5 9.75 14.25 11.25 14.25 12.5V13.75" />          </svg>Team        </a>        <a class="nav-item" 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">            <path d="M2.5 4.5L4.5 4.5" /><circle cx="6" cy="4.5" r="1.5" /><path d="M7.5 4.5L13.5 4.5" /><path d="M2.5 11.5L8.5 11.5" /><circle cx="10" cy="11.5" r="1.5" /><path d="M11.5 11.5L13.5 11.5" />          </svg>Settings        </a>      </nav>      <button type="button" class="btn btn-quiet justify-start px-xs mt-auto">        <span class="avatar avatar-xs" aria-hidden="true">          <img class="avatar-image" src="/demo/people/yiching-lin.webp" alt width="20" height="20"><span class="avatar-fallback">YL</span>        </span>Yi-ching Lin      </button>    </div>    <button type="button" class="btn btn-quiet btn-square btn-sm dialog-close" commandfor="shell-nav" command="close" aria-label="Close navigation">      <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="M4 4L12 12" /><path d="M4 12L12 4" />      </svg>    </button>  </dialog></div>
import ContrastIcon from '@master/icons-react/native/16/soft/contrast'import HomeIcon from '@master/icons-react/native/16/soft/home'import GridIcon from '@master/icons-react/native/16/soft/grid'import GlobeIcon from '@master/icons-react/native/16/soft/globe'import ChartBarIcon from '@master/icons-react/native/16/soft/chart-bar'import UsersIcon from '@master/icons-react/native/16/soft/users'import SlidersIcon from '@master/icons-react/native/16/soft/sliders'import MenuIcon from '@master/icons-react/native/16/soft/menu'import SearchIcon from '@master/icons-react/native/16/soft/search'import PlusIcon from '@master/icons-react/native/16/soft/plus'import XIcon from '@master/icons-react/native/16/soft/x'<div className="shell bg-surface-base fg-text-body text-sm">  <a className="skip" href="#app-main">Skip to content</a>  <aside className="shell-sidebar gap-md p-sm bxe(1) bxe-solid b-line-hair">    <a className="navbar-brand h(40) px-xs" href="#"><ContrastIcon className="icon" />Atlas</a>    <nav className="nav" aria-label="Workspace">      <a className="nav-item" href="#"><HomeIcon className="icon" />Overview</a>      <a className="nav-item" href="#" aria-current="page">        <GridIcon className="icon" />Projects<span className="nav-end">12</span>      </a>      <a className="nav-item" href="#"><GlobeIcon className="icon" />Domains</a>      <a className="nav-item" href="#"><ChartBarIcon className="icon" />Analytics</a>      <a className="nav-item" href="#"><UsersIcon className="icon" />Team</a>      <a className="nav-item" href="#"><SlidersIcon className="icon" />Settings</a>    </nav>    <button type="button" className="btn btn-quiet justify-start px-xs mt-auto">      <span className="avatar avatar-xs" aria-hidden="true">        <img className="avatar-image" src="/demo/people/yiching-lin.webp" alt="" width="20" height="20" /><span className="avatar-fallback">YL</span>      </span>Yi-ching Lin    </button>  </aside>  <main className="shell-main" id="app-main" tabIndex={-1}>    <header className="navbar" style={{ '--navbar-padding-x': '1.5rem' } as React.CSSProperties}>      <button type="button" className="btn btn-quiet btn-square btn-sm shell-toggle" {...{ commandfor: 'shell-nav', command: 'show-modal' }} aria-label="Open navigation">        <MenuIcon className="icon" />      </button>      <h1 className="heading heading-sm">Projects</h1>      <div className="navbar-end">        <button type="button" className="btn btn-quiet btn-square btn-sm" aria-label="Search">          <SearchIcon className="icon" />        </button>        <button type="button" className="btn btn-primary btn-sm">          <PlusIcon className="icon" />New project        </button>      </div>    </header>    <div className="p-lg">      <ul className="auto-grid">        <li>          <article className="card">            <header className="card-header">              <h2 className="card-title">Atlas</h2>              <p className="card-description">atlas.dev</p>              <span className="badge badge-success badge-dot card-action">Ready</span>            </header>          </article>        </li>        <li>          <article className="card">            <header className="card-header">              <h2 className="card-title">Borealis</h2>              <p className="card-description">borealis.app</p>              <span className="badge badge-info badge-dot card-action">Building</span>            </header>          </article>        </li>        <li>          <article className="card">            <header className="card-header">              <h2 className="card-title">Cinder</h2>              <p className="card-description">cinder.io</p>              <span className="badge badge-success badge-dot card-action">Ready</span>            </header>          </article>        </li>        <li>          <article className="card">            <header className="card-header">              <h2 className="card-title">Drift</h2>              <p className="card-description">drift.so</p>              <span className="badge badge-danger badge-dot card-action">Failed</span>            </header>          </article>        </li>        <li>          <article className="card">            <header className="card-header">              <h2 className="card-title">Ember</h2>              <p className="card-description">ember.dev</p>              <span className="badge badge-success badge-dot card-action">Ready</span>            </header>          </article>        </li>        <li>          <article className="card">            <header className="card-header">              <h2 className="card-title">Fathom</h2>              <p className="card-description">fathom.app</p>              <span className="badge badge-success badge-dot card-action">Ready</span>            </header>          </article>        </li>      </ul>    </div>  </main>  <dialog className="dialog dialog-drawer dialog-drawer-start" id="shell-nav" closedby="any" aria-label="Navigation">    <div className="dialog-body flex flex-col gap-md">      <a className="navbar-brand h(40) px-xs" href="#"><ContrastIcon className="icon" />Atlas</a>      <nav className="nav" aria-label="Workspace, in the drawer">        <a className="nav-item" href="#"><HomeIcon className="icon" />Overview</a>        <a className="nav-item" href="#" aria-current="page">          <GridIcon className="icon" />Projects<span className="nav-end">12</span>        </a>        <a className="nav-item" href="#"><GlobeIcon className="icon" />Domains</a>        <a className="nav-item" href="#"><ChartBarIcon className="icon" />Analytics</a>        <a className="nav-item" href="#"><UsersIcon className="icon" />Team</a>        <a className="nav-item" href="#"><SlidersIcon className="icon" />Settings</a>      </nav>      <button type="button" className="btn btn-quiet justify-start px-xs mt-auto">        <span className="avatar avatar-xs" aria-hidden="true">          <img className="avatar-image" src="/demo/people/yiching-lin.webp" alt="" width="20" height="20" /><span className="avatar-fallback">YL</span>        </span>Yi-ching Lin      </button>    </div>    <button type="button" className="btn btn-quiet btn-square btn-sm dialog-close" {...{ commandfor: 'shell-nav', command: 'close' }} aria-label="Close navigation">      <XIcon className="icon" />    </button>  </dialog></div>
<script>  import ContrastIcon from '@master/icons-svelte/native/16/soft/contrast'  import HomeIcon from '@master/icons-svelte/native/16/soft/home'  import GridIcon from '@master/icons-svelte/native/16/soft/grid'  import GlobeIcon from '@master/icons-svelte/native/16/soft/globe'  import ChartBarIcon from '@master/icons-svelte/native/16/soft/chart-bar'  import UsersIcon from '@master/icons-svelte/native/16/soft/users'  import SlidersIcon from '@master/icons-svelte/native/16/soft/sliders'  import MenuIcon from '@master/icons-svelte/native/16/soft/menu'  import SearchIcon from '@master/icons-svelte/native/16/soft/search'  import PlusIcon from '@master/icons-svelte/native/16/soft/plus'  import XIcon from '@master/icons-svelte/native/16/soft/x'</script><div class="shell bg-surface-base fg-text-body text-sm">  <a class="skip" href="#app-main">Skip to content</a>  <aside class="shell-sidebar gap-md p-sm bxe(1) bxe-solid b-line-hair">    <a class="navbar-brand h(40) px-xs" href="#"><ContrastIcon class="icon" />Atlas</a>    <nav class="nav" aria-label="Workspace">      <a class="nav-item" href="#"><HomeIcon class="icon" />Overview</a>      <a class="nav-item" href="#" aria-current="page">        <GridIcon class="icon" />Projects<span class="nav-end">12</span>      </a>      <a class="nav-item" href="#"><GlobeIcon class="icon" />Domains</a>      <a class="nav-item" href="#"><ChartBarIcon class="icon" />Analytics</a>      <a class="nav-item" href="#"><UsersIcon class="icon" />Team</a>      <a class="nav-item" href="#"><SlidersIcon class="icon" />Settings</a>    </nav>    <button type="button" class="btn btn-quiet justify-start px-xs mt-auto">      <span class="avatar avatar-xs" aria-hidden="true">        <img class="avatar-image" src="/demo/people/yiching-lin.webp" alt width="20" height="20"><span class="avatar-fallback">YL</span>      </span>Yi-ching Lin    </button>  </aside>  <main class="shell-main" id="app-main" tabindex="-1">    <header class="navbar" style="--navbar-padding-x: 1.5rem">      <button type="button" class="btn btn-quiet btn-square btn-sm shell-toggle" commandfor="shell-nav" command="show-modal" aria-label="Open navigation">        <MenuIcon class="icon" />      </button>      <h1 class="heading heading-sm">Projects</h1>      <div class="navbar-end">        <button type="button" class="btn btn-quiet btn-square btn-sm" aria-label="Search">          <SearchIcon class="icon" />        </button>        <button type="button" class="btn btn-primary btn-sm">          <PlusIcon class="icon" />New project        </button>      </div>    </header>    <div class="p-lg">      <ul class="auto-grid">        <li>          <article class="card">            <header class="card-header">              <h2 class="card-title">Atlas</h2>              <p class="card-description">atlas.dev</p>              <span class="badge badge-success badge-dot card-action">Ready</span>            </header>          </article>        </li>        <li>          <article class="card">            <header class="card-header">              <h2 class="card-title">Borealis</h2>              <p class="card-description">borealis.app</p>              <span class="badge badge-info badge-dot card-action">Building</span>            </header>          </article>        </li>        <li>          <article class="card">            <header class="card-header">              <h2 class="card-title">Cinder</h2>              <p class="card-description">cinder.io</p>              <span class="badge badge-success badge-dot card-action">Ready</span>            </header>          </article>        </li>        <li>          <article class="card">            <header class="card-header">              <h2 class="card-title">Drift</h2>              <p class="card-description">drift.so</p>              <span class="badge badge-danger badge-dot card-action">Failed</span>            </header>          </article>        </li>        <li>          <article class="card">            <header class="card-header">              <h2 class="card-title">Ember</h2>              <p class="card-description">ember.dev</p>              <span class="badge badge-success badge-dot card-action">Ready</span>            </header>          </article>        </li>        <li>          <article class="card">            <header class="card-header">              <h2 class="card-title">Fathom</h2>              <p class="card-description">fathom.app</p>              <span class="badge badge-success badge-dot card-action">Ready</span>            </header>          </article>        </li>      </ul>    </div>  </main>  <dialog class="dialog dialog-drawer dialog-drawer-start" id="shell-nav" closedby="any" aria-label="Navigation">    <div class="dialog-body flex flex-col gap-md">      <a class="navbar-brand h(40) px-xs" href="#"><ContrastIcon class="icon" />Atlas</a>      <nav class="nav" aria-label="Workspace, in the drawer">        <a class="nav-item" href="#"><HomeIcon class="icon" />Overview</a>        <a class="nav-item" href="#" aria-current="page">          <GridIcon class="icon" />Projects<span class="nav-end">12</span>        </a>        <a class="nav-item" href="#"><GlobeIcon class="icon" />Domains</a>        <a class="nav-item" href="#"><ChartBarIcon class="icon" />Analytics</a>        <a class="nav-item" href="#"><UsersIcon class="icon" />Team</a>        <a class="nav-item" href="#"><SlidersIcon class="icon" />Settings</a>      </nav>      <button type="button" class="btn btn-quiet justify-start px-xs mt-auto">        <span class="avatar avatar-xs" aria-hidden="true">          <img class="avatar-image" src="/demo/people/yiching-lin.webp" alt width="20" height="20"><span class="avatar-fallback">YL</span>        </span>Yi-ching Lin      </button>    </div>    <button type="button" class="btn btn-quiet btn-square btn-sm dialog-close" commandfor="shell-nav" command="close" aria-label="Close navigation">      <XIcon class="icon" />    </button>  </dialog></div>
<script setup>import ContrastIcon from '@master/icons-vue/native/16/soft/contrast'import HomeIcon from '@master/icons-vue/native/16/soft/home'import GridIcon from '@master/icons-vue/native/16/soft/grid'import GlobeIcon from '@master/icons-vue/native/16/soft/globe'import ChartBarIcon from '@master/icons-vue/native/16/soft/chart-bar'import UsersIcon from '@master/icons-vue/native/16/soft/users'import SlidersIcon from '@master/icons-vue/native/16/soft/sliders'import MenuIcon from '@master/icons-vue/native/16/soft/menu'import SearchIcon from '@master/icons-vue/native/16/soft/search'import PlusIcon from '@master/icons-vue/native/16/soft/plus'import XIcon from '@master/icons-vue/native/16/soft/x'</script><template>  <div class="shell bg-surface-base fg-text-body text-sm">    <a class="skip" href="#app-main">Skip to content</a>    <aside class="shell-sidebar gap-md p-sm bxe(1) bxe-solid b-line-hair">      <a class="navbar-brand h(40) px-xs" href="#"><ContrastIcon class="icon" />Atlas</a>      <nav class="nav" aria-label="Workspace">        <a class="nav-item" href="#"><HomeIcon class="icon" />Overview</a>        <a class="nav-item" href="#" aria-current="page">          <GridIcon class="icon" />Projects<span class="nav-end">12</span>        </a>        <a class="nav-item" href="#"><GlobeIcon class="icon" />Domains</a>        <a class="nav-item" href="#"><ChartBarIcon class="icon" />Analytics</a>        <a class="nav-item" href="#"><UsersIcon class="icon" />Team</a>        <a class="nav-item" href="#"><SlidersIcon class="icon" />Settings</a>      </nav>      <button type="button" class="btn btn-quiet justify-start px-xs mt-auto">        <span class="avatar avatar-xs" aria-hidden="true">          <img class="avatar-image" src="/demo/people/yiching-lin.webp" alt width="20" height="20"><span class="avatar-fallback">YL</span>        </span>Yi-ching Lin      </button>    </aside>    <main class="shell-main" id="app-main" tabindex="-1">      <header class="navbar" style="--navbar-padding-x: 1.5rem">        <button type="button" class="btn btn-quiet btn-square btn-sm shell-toggle" commandfor="shell-nav" command="show-modal" aria-label="Open navigation">          <MenuIcon class="icon" />        </button>        <h1 class="heading heading-sm">Projects</h1>        <div class="navbar-end">          <button type="button" class="btn btn-quiet btn-square btn-sm" aria-label="Search">            <SearchIcon class="icon" />          </button>          <button type="button" class="btn btn-primary btn-sm">            <PlusIcon class="icon" />New project          </button>        </div>      </header>      <div class="p-lg">        <ul class="auto-grid">          <li>            <article class="card">              <header class="card-header">                <h2 class="card-title">Atlas</h2>                <p class="card-description">atlas.dev</p>                <span class="badge badge-success badge-dot card-action">Ready</span>              </header>            </article>          </li>          <li>            <article class="card">              <header class="card-header">                <h2 class="card-title">Borealis</h2>                <p class="card-description">borealis.app</p>                <span class="badge badge-info badge-dot card-action">Building</span>              </header>            </article>          </li>          <li>            <article class="card">              <header class="card-header">                <h2 class="card-title">Cinder</h2>                <p class="card-description">cinder.io</p>                <span class="badge badge-success badge-dot card-action">Ready</span>              </header>            </article>          </li>          <li>            <article class="card">              <header class="card-header">                <h2 class="card-title">Drift</h2>                <p class="card-description">drift.so</p>                <span class="badge badge-danger badge-dot card-action">Failed</span>              </header>            </article>          </li>          <li>            <article class="card">              <header class="card-header">                <h2 class="card-title">Ember</h2>                <p class="card-description">ember.dev</p>                <span class="badge badge-success badge-dot card-action">Ready</span>              </header>            </article>          </li>          <li>            <article class="card">              <header class="card-header">                <h2 class="card-title">Fathom</h2>                <p class="card-description">fathom.app</p>                <span class="badge badge-success badge-dot card-action">Ready</span>              </header>            </article>          </li>        </ul>      </div>    </main>    <dialog class="dialog dialog-drawer dialog-drawer-start" id="shell-nav" closedby="any" aria-label="Navigation">      <div class="dialog-body flex flex-col gap-md">        <a class="navbar-brand h(40) px-xs" href="#"><ContrastIcon class="icon" />Atlas</a>        <nav class="nav" aria-label="Workspace, in the drawer">          <a class="nav-item" href="#"><HomeIcon class="icon" />Overview</a>          <a class="nav-item" href="#" aria-current="page">            <GridIcon class="icon" />Projects<span class="nav-end">12</span>          </a>          <a class="nav-item" href="#"><GlobeIcon class="icon" />Domains</a>          <a class="nav-item" href="#"><ChartBarIcon class="icon" />Analytics</a>          <a class="nav-item" href="#"><UsersIcon class="icon" />Team</a>          <a class="nav-item" href="#"><SlidersIcon class="icon" />Settings</a>        </nav>        <button type="button" class="btn btn-quiet justify-start px-xs mt-auto">          <span class="avatar avatar-xs" aria-hidden="true">            <img class="avatar-image" src="/demo/people/yiching-lin.webp" alt width="20" height="20"><span class="avatar-fallback">YL</span>          </span>Yi-ching Lin        </button>      </div>      <button type="button" class="btn btn-quiet btn-square btn-sm dialog-close" commandfor="shell-nav" command="close" aria-label="Close navigation">        <XIcon class="icon" />      </button>    </dialog>  </div></template>
滚动页面时,侧边栏和顶部栏留在原位。选择手机视图后,侧边栏隐藏,页面会显示一个按钮,可将侧边栏作为抽屉打开。

#布局结构

部分类名作用
页面框架shell高度至少等于视口高度的网格,同时也是名为 shell 的尺寸容器
侧边栏shell-sidebar粘附在页眉下方,占满视口剩余高度,并可独立滚动
主区域shell-main占据剩余的一列,宽度始终限制在该列内
切换控件shell-toggle仅在侧边栏退出布局时才出现的任意控件

默认由文档整体滚动。粘性导航栏照常工作,标题链接会跳转到对应位置,返回时浏览器会恢复滚动位置。

应用框架的宽度低于 48rem 时,侧边栏会退出布局,且不会自动出现替代控件。要保留导航,请将相同的导航放入起始边缘的抽屉,并通过带有 shell-toggle 的按钮打开它。抽屉使用原生 <dialog>,通过 commandfor 打开,整个布局无需脚本。

阈值按应用框架自身的宽度计算。无论屏幕多宽,应用框架放在狭窄的面板内时,只要自身宽度低于阈值,侧边栏就会退出布局。

各处边缘彼此对齐。主区域中的导航栏将 --navbar-padding-x 设为 1.5rem,与下方内容的内边距相同,因此标题和第一张卡片从同一条线开始。侧边栏通过 p-sm 加上导航项自身的内边距,让每个图标都内缩 1.25rem;品牌和账户按钮各自使用 px-xs,也从同一位置开始。

#托盘上的布局

为应用框架使用托盘底色,将主区域放在凸起面板上,向内留出 8px。这样,侧边栏看起来属于页面框架,内容则呈现在框架上方。沿用相同的布局类,只更改表面。

托盘上的布局

<div class="shell bg-surface-tray fg-text-body text-sm">  <a class="skip" href="#app-main-inset">Skip to content</a>  <aside class="shell-sidebar gap-md p-sm">    <a class="navbar-brand h(40) px-xs" 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="nav" aria-label="Workspace">      <a class="nav-item" 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">          <path d="M3 13L3 6.9624A1 1 0 0 1 3.3524 6.2005L7.3524 2.8005A1 1 0 0 1 8.6476 2.8005L12.6476 6.2005A1 1 0 0 1 13 6.9624L13 13A1 1 0 0 1 12 14L4 14A1 1 0 0 1 3 13Z" /><path d="M6.5 14L6.5 11A1 1 0 0 1 7.5 10L8.5 10A1 1 0 0 1 9.5 11L9.5 14" />        </svg>Overview      </a>      <a class="nav-item" href="#" aria-current="page">        <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">          <rect x="2.5" y="2.5" width="4" height="4" rx="1" /><rect x="9.5" y="2.5" width="4" height="4" rx="1" /><rect x="2.5" y="9.5" width="4" height="4" rx="1" /><rect x="9.5" y="9.5" width="4" height="4" rx="1" />        </svg>Projects<span class="nav-end">12</span>      </a>      <a class="nav-item" 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.7707 2.0497A6.0005 6.0005 0 0 0 7.2293 2.0497Q6.1162 3.1938 5.4813 4.6077Q4.8542 6.0044 4.7648 7.5H2.0209A5.9913 5.9913 0 0 0 2.0209 8.5H4.7648Q4.8542 9.9956 5.4813 11.3923Q6.1162 12.8062 7.2293 13.9503A6.0005 6.0005 0 0 0 8.7707 13.9503Q9.8838 12.8062 10.5187 11.3923Q11.1458 9.9956 11.2352 8.5H13.9791A5.9913 5.9913 0 0 0 13.9791 7.5H11.2352Q11.1458 6.0044 10.5187 4.6077Q9.8838 3.1938 8.7707 2.0497ZM9.6064 5.0173Q10.1455 6.2181 10.2331 7.5H5.7669Q5.8545 6.2181 6.3936 5.0173Q6.971 3.7314 8 2.6921Q9.029 3.7314 9.6064 5.0173ZM6.3936 10.9827Q5.8545 9.7819 5.7669 8.5H10.2331Q10.1455 9.7819 9.6064 10.9827Q9.029 12.2686 8 13.3079Q6.971 12.2686 6.3936 10.9827Z" fill="currentColor" stroke="none" fill-rule="evenodd" />        </svg>Domains      </a>      <a class="nav-item" 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">          <rect x="2" y="8" width="2.5" height="6" rx="0.75" /><rect x="6.75" y="3" width="2.5" height="11" rx="0.75" /><rect x="11.5" y="6" width="2.5" height="8" rx="0.75" />        </svg>Analytics      </a>      <a class="nav-item" 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="6.25" cy="4.5" r="2" /><path d="M2.25 13.75V12.5C2.25 10.7 3.85 9.5 5.35 9.5H7.15C8.65 9.5 10.25 10.7 10.25 12.5V13.75" /><path d="M11.1 2.6C13.8 2.6 13.8 6.6 11.1 6.6" /><path d="M12 9.5C13.5 9.75 14.25 11.25 14.25 12.5V13.75" />        </svg>Team      </a>      <a class="nav-item" 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">          <path d="M2.5 4.5L4.5 4.5" /><circle cx="6" cy="4.5" r="1.5" /><path d="M7.5 4.5L13.5 4.5" /><path d="M2.5 11.5L8.5 11.5" /><circle cx="10" cy="11.5" r="1.5" /><path d="M11.5 11.5L13.5 11.5" />        </svg>Settings      </a>    </nav>    <button type="button" class="btn btn-quiet justify-start px-xs mt-auto">      <span class="avatar avatar-xs" aria-hidden="true">        <img class="avatar-image" src="/demo/people/yiching-lin.webp" alt width="20" height="20"><span class="avatar-fallback">YL</span>      </span>Yi-ching Lin    </button>  </aside>  <div class="shell-main flex flex-col p(8) pxs(0)@container(--3xl)">    <main class="sheet grow(1)" id="app-main-inset" tabindex="-1">      <header class="navbar" style="--navbar-color: var(--color-surface-raised); --navbar-padding-x: 1.5rem">        <button type="button" class="btn btn-quiet btn-square btn-sm shell-toggle" commandfor="shell-nav-inset" command="show-modal" aria-label="Open navigation">          <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>        <h1 class="heading heading-sm">Projects</h1>        <div class="navbar-end">          <button type="button" class="btn btn-primary btn-sm">            <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 8L13 8" /><path d="M8 3L8 13" />            </svg>New project          </button>        </div>      </header>      <div class="p-lg">        <ul class="auto-grid">          <li>            <article class="card card-flat">              <header class="card-header">                <h2 class="card-title">Atlas</h2>                <p class="card-description">atlas.dev</p>                <span class="badge badge-success badge-dot card-action">Ready</span>              </header>            </article>          </li>          <li>            <article class="card card-flat">              <header class="card-header">                <h2 class="card-title">Borealis</h2>                <p class="card-description">borealis.app</p>                <span class="badge badge-info badge-dot card-action">Building</span>              </header>            </article>          </li>          <li>            <article class="card card-flat">              <header class="card-header">                <h2 class="card-title">Cinder</h2>                <p class="card-description">cinder.io</p>                <span class="badge badge-success badge-dot card-action">Ready</span>              </header>            </article>          </li>          <li>            <article class="card card-flat">              <header class="card-header">                <h2 class="card-title">Drift</h2>                <p class="card-description">drift.so</p>                <span class="badge badge-danger badge-dot card-action">Failed</span>              </header>            </article>          </li>          <li>            <article class="card card-flat">              <header class="card-header">                <h2 class="card-title">Ember</h2>                <p class="card-description">ember.dev</p>                <span class="badge badge-success badge-dot card-action">Ready</span>              </header>            </article>          </li>          <li>            <article class="card card-flat">              <header class="card-header">                <h2 class="card-title">Fathom</h2>                <p class="card-description">fathom.app</p>                <span class="badge badge-success badge-dot card-action">Ready</span>              </header>            </article>          </li>        </ul>      </div>    </main>  </div>  <dialog class="dialog dialog-drawer dialog-drawer-start" id="shell-nav-inset" closedby="any" aria-label="Navigation">    <div class="dialog-body flex flex-col gap-md">      <a class="navbar-brand h(40) px-xs" 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="nav" aria-label="Workspace, in the drawer">        <a class="nav-item" 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">            <path d="M3 13L3 6.9624A1 1 0 0 1 3.3524 6.2005L7.3524 2.8005A1 1 0 0 1 8.6476 2.8005L12.6476 6.2005A1 1 0 0 1 13 6.9624L13 13A1 1 0 0 1 12 14L4 14A1 1 0 0 1 3 13Z" /><path d="M6.5 14L6.5 11A1 1 0 0 1 7.5 10L8.5 10A1 1 0 0 1 9.5 11L9.5 14" />          </svg>Overview        </a>        <a class="nav-item" href="#" aria-current="page">          <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">            <rect x="2.5" y="2.5" width="4" height="4" rx="1" /><rect x="9.5" y="2.5" width="4" height="4" rx="1" /><rect x="2.5" y="9.5" width="4" height="4" rx="1" /><rect x="9.5" y="9.5" width="4" height="4" rx="1" />          </svg>Projects<span class="nav-end">12</span>        </a>        <a class="nav-item" 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.7707 2.0497A6.0005 6.0005 0 0 0 7.2293 2.0497Q6.1162 3.1938 5.4813 4.6077Q4.8542 6.0044 4.7648 7.5H2.0209A5.9913 5.9913 0 0 0 2.0209 8.5H4.7648Q4.8542 9.9956 5.4813 11.3923Q6.1162 12.8062 7.2293 13.9503A6.0005 6.0005 0 0 0 8.7707 13.9503Q9.8838 12.8062 10.5187 11.3923Q11.1458 9.9956 11.2352 8.5H13.9791A5.9913 5.9913 0 0 0 13.9791 7.5H11.2352Q11.1458 6.0044 10.5187 4.6077Q9.8838 3.1938 8.7707 2.0497ZM9.6064 5.0173Q10.1455 6.2181 10.2331 7.5H5.7669Q5.8545 6.2181 6.3936 5.0173Q6.971 3.7314 8 2.6921Q9.029 3.7314 9.6064 5.0173ZM6.3936 10.9827Q5.8545 9.7819 5.7669 8.5H10.2331Q10.1455 9.7819 9.6064 10.9827Q9.029 12.2686 8 13.3079Q6.971 12.2686 6.3936 10.9827Z" fill="currentColor" stroke="none" fill-rule="evenodd" />          </svg>Domains        </a>        <a class="nav-item" 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">            <rect x="2" y="8" width="2.5" height="6" rx="0.75" /><rect x="6.75" y="3" width="2.5" height="11" rx="0.75" /><rect x="11.5" y="6" width="2.5" height="8" rx="0.75" />          </svg>Analytics        </a>        <a class="nav-item" 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="6.25" cy="4.5" r="2" /><path d="M2.25 13.75V12.5C2.25 10.7 3.85 9.5 5.35 9.5H7.15C8.65 9.5 10.25 10.7 10.25 12.5V13.75" /><path d="M11.1 2.6C13.8 2.6 13.8 6.6 11.1 6.6" /><path d="M12 9.5C13.5 9.75 14.25 11.25 14.25 12.5V13.75" />          </svg>Team        </a>        <a class="nav-item" 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">            <path d="M2.5 4.5L4.5 4.5" /><circle cx="6" cy="4.5" r="1.5" /><path d="M7.5 4.5L13.5 4.5" /><path d="M2.5 11.5L8.5 11.5" /><circle cx="10" cy="11.5" r="1.5" /><path d="M11.5 11.5L13.5 11.5" />          </svg>Settings        </a>      </nav>      <button type="button" class="btn btn-quiet justify-start px-xs mt-auto">        <span class="avatar avatar-xs" aria-hidden="true">          <img class="avatar-image" src="/demo/people/yiching-lin.webp" alt width="20" height="20"><span class="avatar-fallback">YL</span>        </span>Yi-ching Lin      </button>    </div>    <button type="button" class="btn btn-quiet btn-square btn-sm dialog-close" commandfor="shell-nav-inset" command="close" aria-label="Close navigation">      <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="M4 4L12 12" /><path d="M4 12L12 4" />      </svg>    </button>  </dialog></div>
import ContrastIcon from '@master/icons-react/native/16/soft/contrast'import HomeIcon from '@master/icons-react/native/16/soft/home'import GridIcon from '@master/icons-react/native/16/soft/grid'import GlobeIcon from '@master/icons-react/native/16/soft/globe'import ChartBarIcon from '@master/icons-react/native/16/soft/chart-bar'import UsersIcon from '@master/icons-react/native/16/soft/users'import SlidersIcon from '@master/icons-react/native/16/soft/sliders'import MenuIcon from '@master/icons-react/native/16/soft/menu'import PlusIcon from '@master/icons-react/native/16/soft/plus'import XIcon from '@master/icons-react/native/16/soft/x'<div className="shell bg-surface-tray fg-text-body text-sm">  <a className="skip" href="#app-main-inset">Skip to content</a>  <aside className="shell-sidebar gap-md p-sm">    <a className="navbar-brand h(40) px-xs" href="#"><ContrastIcon className="icon" />Atlas</a>    <nav className="nav" aria-label="Workspace">      <a className="nav-item" href="#"><HomeIcon className="icon" />Overview</a>      <a className="nav-item" href="#" aria-current="page">        <GridIcon className="icon" />Projects<span className="nav-end">12</span>      </a>      <a className="nav-item" href="#"><GlobeIcon className="icon" />Domains</a>      <a className="nav-item" href="#"><ChartBarIcon className="icon" />Analytics</a>      <a className="nav-item" href="#"><UsersIcon className="icon" />Team</a>      <a className="nav-item" href="#"><SlidersIcon className="icon" />Settings</a>    </nav>    <button type="button" className="btn btn-quiet justify-start px-xs mt-auto">      <span className="avatar avatar-xs" aria-hidden="true">        <img className="avatar-image" src="/demo/people/yiching-lin.webp" alt="" width="20" height="20" /><span className="avatar-fallback">YL</span>      </span>Yi-ching Lin    </button>  </aside>  <div className="shell-main flex flex-col p(8) pxs(0)@container(--3xl)">    <main className="sheet grow(1)" id="app-main-inset" tabIndex={-1}>      <header className="navbar" style={{ '--navbar-color': 'var(--color-surface-raised)', '--navbar-padding-x': '1.5rem' } as React.CSSProperties}>        <button type="button" className="btn btn-quiet btn-square btn-sm shell-toggle" {...{ commandfor: 'shell-nav-inset', command: 'show-modal' }} aria-label="Open navigation">          <MenuIcon className="icon" />        </button>        <h1 className="heading heading-sm">Projects</h1>        <div className="navbar-end">          <button type="button" className="btn btn-primary btn-sm">            <PlusIcon className="icon" />New project          </button>        </div>      </header>      <div className="p-lg">        <ul className="auto-grid">          <li>            <article className="card card-flat">              <header className="card-header">                <h2 className="card-title">Atlas</h2>                <p className="card-description">atlas.dev</p>                <span className="badge badge-success badge-dot card-action">Ready</span>              </header>            </article>          </li>          <li>            <article className="card card-flat">              <header className="card-header">                <h2 className="card-title">Borealis</h2>                <p className="card-description">borealis.app</p>                <span className="badge badge-info badge-dot card-action">Building</span>              </header>            </article>          </li>          <li>            <article className="card card-flat">              <header className="card-header">                <h2 className="card-title">Cinder</h2>                <p className="card-description">cinder.io</p>                <span className="badge badge-success badge-dot card-action">Ready</span>              </header>            </article>          </li>          <li>            <article className="card card-flat">              <header className="card-header">                <h2 className="card-title">Drift</h2>                <p className="card-description">drift.so</p>                <span className="badge badge-danger badge-dot card-action">Failed</span>              </header>            </article>          </li>          <li>            <article className="card card-flat">              <header className="card-header">                <h2 className="card-title">Ember</h2>                <p className="card-description">ember.dev</p>                <span className="badge badge-success badge-dot card-action">Ready</span>              </header>            </article>          </li>          <li>            <article className="card card-flat">              <header className="card-header">                <h2 className="card-title">Fathom</h2>                <p className="card-description">fathom.app</p>                <span className="badge badge-success badge-dot card-action">Ready</span>              </header>            </article>          </li>        </ul>      </div>    </main>  </div>  <dialog className="dialog dialog-drawer dialog-drawer-start" id="shell-nav-inset" closedby="any" aria-label="Navigation">    <div className="dialog-body flex flex-col gap-md">      <a className="navbar-brand h(40) px-xs" href="#"><ContrastIcon className="icon" />Atlas</a>      <nav className="nav" aria-label="Workspace, in the drawer">        <a className="nav-item" href="#"><HomeIcon className="icon" />Overview</a>        <a className="nav-item" href="#" aria-current="page">          <GridIcon className="icon" />Projects<span className="nav-end">12</span>        </a>        <a className="nav-item" href="#"><GlobeIcon className="icon" />Domains</a>        <a className="nav-item" href="#"><ChartBarIcon className="icon" />Analytics</a>        <a className="nav-item" href="#"><UsersIcon className="icon" />Team</a>        <a className="nav-item" href="#"><SlidersIcon className="icon" />Settings</a>      </nav>      <button type="button" className="btn btn-quiet justify-start px-xs mt-auto">        <span className="avatar avatar-xs" aria-hidden="true">          <img className="avatar-image" src="/demo/people/yiching-lin.webp" alt="" width="20" height="20" /><span className="avatar-fallback">YL</span>        </span>Yi-ching Lin      </button>    </div>    <button type="button" className="btn btn-quiet btn-square btn-sm dialog-close" {...{ commandfor: 'shell-nav-inset', command: 'close' }} aria-label="Close navigation">      <XIcon className="icon" />    </button>  </dialog></div>
<script>  import ContrastIcon from '@master/icons-svelte/native/16/soft/contrast'  import HomeIcon from '@master/icons-svelte/native/16/soft/home'  import GridIcon from '@master/icons-svelte/native/16/soft/grid'  import GlobeIcon from '@master/icons-svelte/native/16/soft/globe'  import ChartBarIcon from '@master/icons-svelte/native/16/soft/chart-bar'  import UsersIcon from '@master/icons-svelte/native/16/soft/users'  import SlidersIcon from '@master/icons-svelte/native/16/soft/sliders'  import MenuIcon from '@master/icons-svelte/native/16/soft/menu'  import PlusIcon from '@master/icons-svelte/native/16/soft/plus'  import XIcon from '@master/icons-svelte/native/16/soft/x'</script><div class="shell bg-surface-tray fg-text-body text-sm">  <a class="skip" href="#app-main-inset">Skip to content</a>  <aside class="shell-sidebar gap-md p-sm">    <a class="navbar-brand h(40) px-xs" href="#"><ContrastIcon class="icon" />Atlas</a>    <nav class="nav" aria-label="Workspace">      <a class="nav-item" href="#"><HomeIcon class="icon" />Overview</a>      <a class="nav-item" href="#" aria-current="page">        <GridIcon class="icon" />Projects<span class="nav-end">12</span>      </a>      <a class="nav-item" href="#"><GlobeIcon class="icon" />Domains</a>      <a class="nav-item" href="#"><ChartBarIcon class="icon" />Analytics</a>      <a class="nav-item" href="#"><UsersIcon class="icon" />Team</a>      <a class="nav-item" href="#"><SlidersIcon class="icon" />Settings</a>    </nav>    <button type="button" class="btn btn-quiet justify-start px-xs mt-auto">      <span class="avatar avatar-xs" aria-hidden="true">        <img class="avatar-image" src="/demo/people/yiching-lin.webp" alt width="20" height="20"><span class="avatar-fallback">YL</span>      </span>Yi-ching Lin    </button>  </aside>  <div class="shell-main flex flex-col p(8) pxs(0)@container(--3xl)">    <main class="sheet grow(1)" id="app-main-inset" tabindex="-1">      <header class="navbar" style="--navbar-color: var(--color-surface-raised); --navbar-padding-x: 1.5rem">        <button type="button" class="btn btn-quiet btn-square btn-sm shell-toggle" commandfor="shell-nav-inset" command="show-modal" aria-label="Open navigation">          <MenuIcon class="icon" />        </button>        <h1 class="heading heading-sm">Projects</h1>        <div class="navbar-end">          <button type="button" class="btn btn-primary btn-sm">            <PlusIcon class="icon" />New project          </button>        </div>      </header>      <div class="p-lg">        <ul class="auto-grid">          <li>            <article class="card card-flat">              <header class="card-header">                <h2 class="card-title">Atlas</h2>                <p class="card-description">atlas.dev</p>                <span class="badge badge-success badge-dot card-action">Ready</span>              </header>            </article>          </li>          <li>            <article class="card card-flat">              <header class="card-header">                <h2 class="card-title">Borealis</h2>                <p class="card-description">borealis.app</p>                <span class="badge badge-info badge-dot card-action">Building</span>              </header>            </article>          </li>          <li>            <article class="card card-flat">              <header class="card-header">                <h2 class="card-title">Cinder</h2>                <p class="card-description">cinder.io</p>                <span class="badge badge-success badge-dot card-action">Ready</span>              </header>            </article>          </li>          <li>            <article class="card card-flat">              <header class="card-header">                <h2 class="card-title">Drift</h2>                <p class="card-description">drift.so</p>                <span class="badge badge-danger badge-dot card-action">Failed</span>              </header>            </article>          </li>          <li>            <article class="card card-flat">              <header class="card-header">                <h2 class="card-title">Ember</h2>                <p class="card-description">ember.dev</p>                <span class="badge badge-success badge-dot card-action">Ready</span>              </header>            </article>          </li>          <li>            <article class="card card-flat">              <header class="card-header">                <h2 class="card-title">Fathom</h2>                <p class="card-description">fathom.app</p>                <span class="badge badge-success badge-dot card-action">Ready</span>              </header>            </article>          </li>        </ul>      </div>    </main>  </div>  <dialog class="dialog dialog-drawer dialog-drawer-start" id="shell-nav-inset" closedby="any" aria-label="Navigation">    <div class="dialog-body flex flex-col gap-md">      <a class="navbar-brand h(40) px-xs" href="#"><ContrastIcon class="icon" />Atlas</a>      <nav class="nav" aria-label="Workspace, in the drawer">        <a class="nav-item" href="#"><HomeIcon class="icon" />Overview</a>        <a class="nav-item" href="#" aria-current="page">          <GridIcon class="icon" />Projects<span class="nav-end">12</span>        </a>        <a class="nav-item" href="#"><GlobeIcon class="icon" />Domains</a>        <a class="nav-item" href="#"><ChartBarIcon class="icon" />Analytics</a>        <a class="nav-item" href="#"><UsersIcon class="icon" />Team</a>        <a class="nav-item" href="#"><SlidersIcon class="icon" />Settings</a>      </nav>      <button type="button" class="btn btn-quiet justify-start px-xs mt-auto">        <span class="avatar avatar-xs" aria-hidden="true">          <img class="avatar-image" src="/demo/people/yiching-lin.webp" alt width="20" height="20"><span class="avatar-fallback">YL</span>        </span>Yi-ching Lin      </button>    </div>    <button type="button" class="btn btn-quiet btn-square btn-sm dialog-close" commandfor="shell-nav-inset" command="close" aria-label="Close navigation">      <XIcon class="icon" />    </button>  </dialog></div>
<script setup>import ContrastIcon from '@master/icons-vue/native/16/soft/contrast'import HomeIcon from '@master/icons-vue/native/16/soft/home'import GridIcon from '@master/icons-vue/native/16/soft/grid'import GlobeIcon from '@master/icons-vue/native/16/soft/globe'import ChartBarIcon from '@master/icons-vue/native/16/soft/chart-bar'import UsersIcon from '@master/icons-vue/native/16/soft/users'import SlidersIcon from '@master/icons-vue/native/16/soft/sliders'import MenuIcon from '@master/icons-vue/native/16/soft/menu'import PlusIcon from '@master/icons-vue/native/16/soft/plus'import XIcon from '@master/icons-vue/native/16/soft/x'</script><template>  <div class="shell bg-surface-tray fg-text-body text-sm">    <a class="skip" href="#app-main-inset">Skip to content</a>    <aside class="shell-sidebar gap-md p-sm">      <a class="navbar-brand h(40) px-xs" href="#"><ContrastIcon class="icon" />Atlas</a>      <nav class="nav" aria-label="Workspace">        <a class="nav-item" href="#"><HomeIcon class="icon" />Overview</a>        <a class="nav-item" href="#" aria-current="page">          <GridIcon class="icon" />Projects<span class="nav-end">12</span>        </a>        <a class="nav-item" href="#"><GlobeIcon class="icon" />Domains</a>        <a class="nav-item" href="#"><ChartBarIcon class="icon" />Analytics</a>        <a class="nav-item" href="#"><UsersIcon class="icon" />Team</a>        <a class="nav-item" href="#"><SlidersIcon class="icon" />Settings</a>      </nav>      <button type="button" class="btn btn-quiet justify-start px-xs mt-auto">        <span class="avatar avatar-xs" aria-hidden="true">          <img class="avatar-image" src="/demo/people/yiching-lin.webp" alt width="20" height="20"><span class="avatar-fallback">YL</span>        </span>Yi-ching Lin      </button>    </aside>    <div class="shell-main flex flex-col p(8) pxs(0)@container(--3xl)">      <main class="sheet grow(1)" id="app-main-inset" tabindex="-1">        <header class="navbar" style="--navbar-color: var(--color-surface-raised); --navbar-padding-x: 1.5rem">          <button type="button" class="btn btn-quiet btn-square btn-sm shell-toggle" commandfor="shell-nav-inset" command="show-modal" aria-label="Open navigation">            <MenuIcon class="icon" />          </button>          <h1 class="heading heading-sm">Projects</h1>          <div class="navbar-end">            <button type="button" class="btn btn-primary btn-sm">              <PlusIcon class="icon" />New project            </button>          </div>        </header>        <div class="p-lg">          <ul class="auto-grid">            <li>              <article class="card card-flat">                <header class="card-header">                  <h2 class="card-title">Atlas</h2>                  <p class="card-description">atlas.dev</p>                  <span class="badge badge-success badge-dot card-action">Ready</span>                </header>              </article>            </li>            <li>              <article class="card card-flat">                <header class="card-header">                  <h2 class="card-title">Borealis</h2>                  <p class="card-description">borealis.app</p>                  <span class="badge badge-info badge-dot card-action">Building</span>                </header>              </article>            </li>            <li>              <article class="card card-flat">                <header class="card-header">                  <h2 class="card-title">Cinder</h2>                  <p class="card-description">cinder.io</p>                  <span class="badge badge-success badge-dot card-action">Ready</span>                </header>              </article>            </li>            <li>              <article class="card card-flat">                <header class="card-header">                  <h2 class="card-title">Drift</h2>                  <p class="card-description">drift.so</p>                  <span class="badge badge-danger badge-dot card-action">Failed</span>                </header>              </article>            </li>            <li>              <article class="card card-flat">                <header class="card-header">                  <h2 class="card-title">Ember</h2>                  <p class="card-description">ember.dev</p>                  <span class="badge badge-success badge-dot card-action">Ready</span>                </header>              </article>            </li>            <li>              <article class="card card-flat">                <header class="card-header">                  <h2 class="card-title">Fathom</h2>                  <p class="card-description">fathom.app</p>                  <span class="badge badge-success badge-dot card-action">Ready</span>                </header>              </article>            </li>          </ul>        </div>      </main>    </div>    <dialog class="dialog dialog-drawer dialog-drawer-start" id="shell-nav-inset" closedby="any" aria-label="Navigation">      <div class="dialog-body flex flex-col gap-md">        <a class="navbar-brand h(40) px-xs" href="#"><ContrastIcon class="icon" />Atlas</a>        <nav class="nav" aria-label="Workspace, in the drawer">          <a class="nav-item" href="#"><HomeIcon class="icon" />Overview</a>          <a class="nav-item" href="#" aria-current="page">            <GridIcon class="icon" />Projects<span class="nav-end">12</span>          </a>          <a class="nav-item" href="#"><GlobeIcon class="icon" />Domains</a>          <a class="nav-item" href="#"><ChartBarIcon class="icon" />Analytics</a>          <a class="nav-item" href="#"><UsersIcon class="icon" />Team</a>          <a class="nav-item" href="#"><SlidersIcon class="icon" />Settings</a>        </nav>        <button type="button" class="btn btn-quiet justify-start px-xs mt-auto">          <span class="avatar avatar-xs" aria-hidden="true">            <img class="avatar-image" src="/demo/people/yiching-lin.webp" alt width="20" height="20"><span class="avatar-fallback">YL</span>          </span>Yi-ching Lin        </button>      </div>      <button type="button" class="btn btn-quiet btn-square btn-sm dialog-close" commandfor="shell-nav-inset" command="close" aria-label="Close navigation">        <XIcon class="icon" />      </button>    </dialog>  </div></template>

导航栏的表面以其背后的表面颜色着色。导航栏位于凸起面板上时,将 --navbar-color 设为面板的颜色。

#带页眉的布局

shell-header 位于应用框架顶部,横跨两列。侧边栏粘附在它下方,应用框架通过 --shell-header 预留空间,默认值为 3.5rem,与导航栏的高度相同。页眉更高时,调整这个属性。此处页眉的 --navbar-padding-x 为 1.25rem,使品牌正好位于侧边栏图标的上方。

带页眉的布局

<div class="shell bg-surface-base fg-text-body text-sm">  <a class="skip" href="#app-main-header">Skip to content</a>  <header class="navbar shell-header bb(1) bb-solid b-line-hair" style="--navbar-padding-x: 1.25rem">    <button type="button" class="btn btn-quiet btn-square btn-sm shell-toggle" commandfor="shell-nav-header" command="show-modal" aria-label="Open navigation">      <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>    <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>    <div class="navbar-end">      <button type="button" class="btn btn-quiet btn-square btn-sm" aria-label="Notifications">        <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="M4.25 6C4.25 4.25 6 2.5 8 2.5C10 2.5 11.75 4.25 11.75 6V8.25C11.75 9.75 12.75 10.75 13.25 11.25Q13.5 11.75 12.75 11.75H3.25Q2.5 11.75 2.75 11.25C3.25 10.75 4.25 9.75 4.25 8.25Z" /><path d="M6.85 14Q8 15 9.15 14" />        </svg>      </button>      <button type="button" class="btn btn-quiet btn-square btn-sm mxe(-4)" aria-label="Account">        <span class="avatar avatar-sm" aria-hidden="true">          <img class="avatar-image" src="/demo/people/yiching-lin.webp" alt width="24" height="24"><span class="avatar-fallback">YL</span>        </span>      </button>    </div>  </header>  <div class="shell-sidebar p-sm bxe(1) bxe-solid b-line-hair">    <nav class="nav" aria-label="Workspace">      <a class="nav-item" 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">          <path d="M3 13L3 6.9624A1 1 0 0 1 3.3524 6.2005L7.3524 2.8005A1 1 0 0 1 8.6476 2.8005L12.6476 6.2005A1 1 0 0 1 13 6.9624L13 13A1 1 0 0 1 12 14L4 14A1 1 0 0 1 3 13Z" /><path d="M6.5 14L6.5 11A1 1 0 0 1 7.5 10L8.5 10A1 1 0 0 1 9.5 11L9.5 14" />        </svg>Overview      </a>      <a class="nav-item" href="#" aria-current="page">        <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">          <rect x="2.5" y="2.5" width="4" height="4" rx="1" /><rect x="9.5" y="2.5" width="4" height="4" rx="1" /><rect x="2.5" y="9.5" width="4" height="4" rx="1" /><rect x="9.5" y="9.5" width="4" height="4" rx="1" />        </svg>Projects<span class="nav-end">12</span>      </a>      <a class="nav-item" 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.7707 2.0497A6.0005 6.0005 0 0 0 7.2293 2.0497Q6.1162 3.1938 5.4813 4.6077Q4.8542 6.0044 4.7648 7.5H2.0209A5.9913 5.9913 0 0 0 2.0209 8.5H4.7648Q4.8542 9.9956 5.4813 11.3923Q6.1162 12.8062 7.2293 13.9503A6.0005 6.0005 0 0 0 8.7707 13.9503Q9.8838 12.8062 10.5187 11.3923Q11.1458 9.9956 11.2352 8.5H13.9791A5.9913 5.9913 0 0 0 13.9791 7.5H11.2352Q11.1458 6.0044 10.5187 4.6077Q9.8838 3.1938 8.7707 2.0497ZM9.6064 5.0173Q10.1455 6.2181 10.2331 7.5H5.7669Q5.8545 6.2181 6.3936 5.0173Q6.971 3.7314 8 2.6921Q9.029 3.7314 9.6064 5.0173ZM6.3936 10.9827Q5.8545 9.7819 5.7669 8.5H10.2331Q10.1455 9.7819 9.6064 10.9827Q9.029 12.2686 8 13.3079Q6.971 12.2686 6.3936 10.9827Z" fill="currentColor" stroke="none" fill-rule="evenodd" />        </svg>Domains      </a>      <a class="nav-item" 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">          <rect x="2" y="8" width="2.5" height="6" rx="0.75" /><rect x="6.75" y="3" width="2.5" height="11" rx="0.75" /><rect x="11.5" y="6" width="2.5" height="8" rx="0.75" />        </svg>Analytics      </a>      <a class="nav-item" 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="6.25" cy="4.5" r="2" /><path d="M2.25 13.75V12.5C2.25 10.7 3.85 9.5 5.35 9.5H7.15C8.65 9.5 10.25 10.7 10.25 12.5V13.75" /><path d="M11.1 2.6C13.8 2.6 13.8 6.6 11.1 6.6" /><path d="M12 9.5C13.5 9.75 14.25 11.25 14.25 12.5V13.75" />        </svg>Team      </a>      <a class="nav-item" 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">          <path d="M2.5 4.5L4.5 4.5" /><circle cx="6" cy="4.5" r="1.5" /><path d="M7.5 4.5L13.5 4.5" /><path d="M2.5 11.5L8.5 11.5" /><circle cx="10" cy="11.5" r="1.5" /><path d="M11.5 11.5L13.5 11.5" />        </svg>Settings      </a>    </nav>  </div>  <main class="shell-main flex flex-col gap-lg px(20) py-lg" id="app-main-header" tabindex="-1">    <h1 class="heading heading-lg">Projects</h1>    <ul class="auto-grid">      <li>        <article class="card">          <header class="card-header">            <h2 class="card-title">Atlas</h2>            <p class="card-description">atlas.dev</p>            <span class="badge badge-success badge-dot card-action">Ready</span>          </header>        </article>      </li>      <li>        <article class="card">          <header class="card-header">            <h2 class="card-title">Borealis</h2>            <p class="card-description">borealis.app</p>            <span class="badge badge-info badge-dot card-action">Building</span>          </header>        </article>      </li>      <li>        <article class="card">          <header class="card-header">            <h2 class="card-title">Cinder</h2>            <p class="card-description">cinder.io</p>            <span class="badge badge-success badge-dot card-action">Ready</span>          </header>        </article>      </li>      <li>        <article class="card">          <header class="card-header">            <h2 class="card-title">Drift</h2>            <p class="card-description">drift.so</p>            <span class="badge badge-danger badge-dot card-action">Failed</span>          </header>        </article>      </li>      <li>        <article class="card">          <header class="card-header">            <h2 class="card-title">Ember</h2>            <p class="card-description">ember.dev</p>            <span class="badge badge-success badge-dot card-action">Ready</span>          </header>        </article>      </li>      <li>        <article class="card">          <header class="card-header">            <h2 class="card-title">Fathom</h2>            <p class="card-description">fathom.app</p>            <span class="badge badge-success badge-dot card-action">Ready</span>          </header>        </article>      </li>    </ul>  </main>  <dialog class="dialog dialog-drawer dialog-drawer-start" id="shell-nav-header" closedby="any" aria-label="Navigation">    <div class="dialog-body flex flex-col gap-md">      <a class="navbar-brand h(40) px-xs" 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="nav" aria-label="Workspace, in the drawer">        <a class="nav-item" 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">            <path d="M3 13L3 6.9624A1 1 0 0 1 3.3524 6.2005L7.3524 2.8005A1 1 0 0 1 8.6476 2.8005L12.6476 6.2005A1 1 0 0 1 13 6.9624L13 13A1 1 0 0 1 12 14L4 14A1 1 0 0 1 3 13Z" /><path d="M6.5 14L6.5 11A1 1 0 0 1 7.5 10L8.5 10A1 1 0 0 1 9.5 11L9.5 14" />          </svg>Overview        </a>        <a class="nav-item" href="#" aria-current="page">          <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">            <rect x="2.5" y="2.5" width="4" height="4" rx="1" /><rect x="9.5" y="2.5" width="4" height="4" rx="1" /><rect x="2.5" y="9.5" width="4" height="4" rx="1" /><rect x="9.5" y="9.5" width="4" height="4" rx="1" />          </svg>Projects<span class="nav-end">12</span>        </a>        <a class="nav-item" 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.7707 2.0497A6.0005 6.0005 0 0 0 7.2293 2.0497Q6.1162 3.1938 5.4813 4.6077Q4.8542 6.0044 4.7648 7.5H2.0209A5.9913 5.9913 0 0 0 2.0209 8.5H4.7648Q4.8542 9.9956 5.4813 11.3923Q6.1162 12.8062 7.2293 13.9503A6.0005 6.0005 0 0 0 8.7707 13.9503Q9.8838 12.8062 10.5187 11.3923Q11.1458 9.9956 11.2352 8.5H13.9791A5.9913 5.9913 0 0 0 13.9791 7.5H11.2352Q11.1458 6.0044 10.5187 4.6077Q9.8838 3.1938 8.7707 2.0497ZM9.6064 5.0173Q10.1455 6.2181 10.2331 7.5H5.7669Q5.8545 6.2181 6.3936 5.0173Q6.971 3.7314 8 2.6921Q9.029 3.7314 9.6064 5.0173ZM6.3936 10.9827Q5.8545 9.7819 5.7669 8.5H10.2331Q10.1455 9.7819 9.6064 10.9827Q9.029 12.2686 8 13.3079Q6.971 12.2686 6.3936 10.9827Z" fill="currentColor" stroke="none" fill-rule="evenodd" />          </svg>Domains        </a>        <a class="nav-item" 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">            <rect x="2" y="8" width="2.5" height="6" rx="0.75" /><rect x="6.75" y="3" width="2.5" height="11" rx="0.75" /><rect x="11.5" y="6" width="2.5" height="8" rx="0.75" />          </svg>Analytics        </a>        <a class="nav-item" 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="6.25" cy="4.5" r="2" /><path d="M2.25 13.75V12.5C2.25 10.7 3.85 9.5 5.35 9.5H7.15C8.65 9.5 10.25 10.7 10.25 12.5V13.75" /><path d="M11.1 2.6C13.8 2.6 13.8 6.6 11.1 6.6" /><path d="M12 9.5C13.5 9.75 14.25 11.25 14.25 12.5V13.75" />          </svg>Team        </a>        <a class="nav-item" 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">            <path d="M2.5 4.5L4.5 4.5" /><circle cx="6" cy="4.5" r="1.5" /><path d="M7.5 4.5L13.5 4.5" /><path d="M2.5 11.5L8.5 11.5" /><circle cx="10" cy="11.5" r="1.5" /><path d="M11.5 11.5L13.5 11.5" />          </svg>Settings        </a>      </nav>    </div>    <button type="button" class="btn btn-quiet btn-square btn-sm dialog-close" commandfor="shell-nav-header" command="close" aria-label="Close navigation">      <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="M4 4L12 12" /><path d="M4 12L12 4" />      </svg>    </button>  </dialog></div>
import MenuIcon from '@master/icons-react/native/16/soft/menu'import ContrastIcon from '@master/icons-react/native/16/soft/contrast'import BellIcon from '@master/icons-react/native/16/soft/bell'import HomeIcon from '@master/icons-react/native/16/soft/home'import GridIcon from '@master/icons-react/native/16/soft/grid'import GlobeIcon from '@master/icons-react/native/16/soft/globe'import ChartBarIcon from '@master/icons-react/native/16/soft/chart-bar'import UsersIcon from '@master/icons-react/native/16/soft/users'import SlidersIcon from '@master/icons-react/native/16/soft/sliders'import XIcon from '@master/icons-react/native/16/soft/x'<div className="shell bg-surface-base fg-text-body text-sm">  <a className="skip" href="#app-main-header">Skip to content</a>  <header className="navbar shell-header bb(1) bb-solid b-line-hair" style={{ '--navbar-padding-x': '1.25rem' } as React.CSSProperties}>    <button type="button" className="btn btn-quiet btn-square btn-sm shell-toggle" {...{ commandfor: 'shell-nav-header', command: 'show-modal' }} aria-label="Open navigation">      <MenuIcon className="icon" />    </button>    <a className="navbar-brand" href="#"><ContrastIcon className="icon" />Atlas</a>    <div className="navbar-end">      <button type="button" className="btn btn-quiet btn-square btn-sm" aria-label="Notifications">        <BellIcon className="icon" />      </button>      <button type="button" className="btn btn-quiet btn-square btn-sm mxe(-4)" aria-label="Account">        <span className="avatar avatar-sm" aria-hidden="true">          <img className="avatar-image" src="/demo/people/yiching-lin.webp" alt="" width="24" height="24" /><span className="avatar-fallback">YL</span>        </span>      </button>    </div>  </header>  <div className="shell-sidebar p-sm bxe(1) bxe-solid b-line-hair">    <nav className="nav" aria-label="Workspace">      <a className="nav-item" href="#"><HomeIcon className="icon" />Overview</a>      <a className="nav-item" href="#" aria-current="page">        <GridIcon className="icon" />Projects<span className="nav-end">12</span>      </a>      <a className="nav-item" href="#"><GlobeIcon className="icon" />Domains</a>      <a className="nav-item" href="#"><ChartBarIcon className="icon" />Analytics</a>      <a className="nav-item" href="#"><UsersIcon className="icon" />Team</a>      <a className="nav-item" href="#"><SlidersIcon className="icon" />Settings</a>    </nav>  </div>  <main className="shell-main flex flex-col gap-lg px(20) py-lg" id="app-main-header" tabIndex={-1}>    <h1 className="heading heading-lg">Projects</h1>    <ul className="auto-grid">      <li>        <article className="card">          <header className="card-header">            <h2 className="card-title">Atlas</h2>            <p className="card-description">atlas.dev</p>            <span className="badge badge-success badge-dot card-action">Ready</span>          </header>        </article>      </li>      <li>        <article className="card">          <header className="card-header">            <h2 className="card-title">Borealis</h2>            <p className="card-description">borealis.app</p>            <span className="badge badge-info badge-dot card-action">Building</span>          </header>        </article>      </li>      <li>        <article className="card">          <header className="card-header">            <h2 className="card-title">Cinder</h2>            <p className="card-description">cinder.io</p>            <span className="badge badge-success badge-dot card-action">Ready</span>          </header>        </article>      </li>      <li>        <article className="card">          <header className="card-header">            <h2 className="card-title">Drift</h2>            <p className="card-description">drift.so</p>            <span className="badge badge-danger badge-dot card-action">Failed</span>          </header>        </article>      </li>      <li>        <article className="card">          <header className="card-header">            <h2 className="card-title">Ember</h2>            <p className="card-description">ember.dev</p>            <span className="badge badge-success badge-dot card-action">Ready</span>          </header>        </article>      </li>      <li>        <article className="card">          <header className="card-header">            <h2 className="card-title">Fathom</h2>            <p className="card-description">fathom.app</p>            <span className="badge badge-success badge-dot card-action">Ready</span>          </header>        </article>      </li>    </ul>  </main>  <dialog className="dialog dialog-drawer dialog-drawer-start" id="shell-nav-header" closedby="any" aria-label="Navigation">    <div className="dialog-body flex flex-col gap-md">      <a className="navbar-brand h(40) px-xs" href="#"><ContrastIcon className="icon" />Atlas</a>      <nav className="nav" aria-label="Workspace, in the drawer">        <a className="nav-item" href="#"><HomeIcon className="icon" />Overview</a>        <a className="nav-item" href="#" aria-current="page">          <GridIcon className="icon" />Projects<span className="nav-end">12</span>        </a>        <a className="nav-item" href="#"><GlobeIcon className="icon" />Domains</a>        <a className="nav-item" href="#"><ChartBarIcon className="icon" />Analytics</a>        <a className="nav-item" href="#"><UsersIcon className="icon" />Team</a>        <a className="nav-item" href="#"><SlidersIcon className="icon" />Settings</a>      </nav>    </div>    <button type="button" className="btn btn-quiet btn-square btn-sm dialog-close" {...{ commandfor: 'shell-nav-header', command: 'close' }} aria-label="Close navigation">      <XIcon className="icon" />    </button>  </dialog></div>
<script>  import MenuIcon from '@master/icons-svelte/native/16/soft/menu'  import ContrastIcon from '@master/icons-svelte/native/16/soft/contrast'  import BellIcon from '@master/icons-svelte/native/16/soft/bell'  import HomeIcon from '@master/icons-svelte/native/16/soft/home'  import GridIcon from '@master/icons-svelte/native/16/soft/grid'  import GlobeIcon from '@master/icons-svelte/native/16/soft/globe'  import ChartBarIcon from '@master/icons-svelte/native/16/soft/chart-bar'  import UsersIcon from '@master/icons-svelte/native/16/soft/users'  import SlidersIcon from '@master/icons-svelte/native/16/soft/sliders'  import XIcon from '@master/icons-svelte/native/16/soft/x'</script><div class="shell bg-surface-base fg-text-body text-sm">  <a class="skip" href="#app-main-header">Skip to content</a>  <header class="navbar shell-header bb(1) bb-solid b-line-hair" style="--navbar-padding-x: 1.25rem">    <button type="button" class="btn btn-quiet btn-square btn-sm shell-toggle" commandfor="shell-nav-header" command="show-modal" aria-label="Open navigation">      <MenuIcon class="icon" />    </button>    <a class="navbar-brand" href="#"><ContrastIcon class="icon" />Atlas</a>    <div class="navbar-end">      <button type="button" class="btn btn-quiet btn-square btn-sm" aria-label="Notifications">        <BellIcon class="icon" />      </button>      <button type="button" class="btn btn-quiet btn-square btn-sm mxe(-4)" aria-label="Account">        <span class="avatar avatar-sm" aria-hidden="true">          <img class="avatar-image" src="/demo/people/yiching-lin.webp" alt width="24" height="24"><span class="avatar-fallback">YL</span>        </span>      </button>    </div>  </header>  <div class="shell-sidebar p-sm bxe(1) bxe-solid b-line-hair">    <nav class="nav" aria-label="Workspace">      <a class="nav-item" href="#"><HomeIcon class="icon" />Overview</a>      <a class="nav-item" href="#" aria-current="page">        <GridIcon class="icon" />Projects<span class="nav-end">12</span>      </a>      <a class="nav-item" href="#"><GlobeIcon class="icon" />Domains</a>      <a class="nav-item" href="#"><ChartBarIcon class="icon" />Analytics</a>      <a class="nav-item" href="#"><UsersIcon class="icon" />Team</a>      <a class="nav-item" href="#"><SlidersIcon class="icon" />Settings</a>    </nav>  </div>  <main class="shell-main flex flex-col gap-lg px(20) py-lg" id="app-main-header" tabindex="-1">    <h1 class="heading heading-lg">Projects</h1>    <ul class="auto-grid">      <li>        <article class="card">          <header class="card-header">            <h2 class="card-title">Atlas</h2>            <p class="card-description">atlas.dev</p>            <span class="badge badge-success badge-dot card-action">Ready</span>          </header>        </article>      </li>      <li>        <article class="card">          <header class="card-header">            <h2 class="card-title">Borealis</h2>            <p class="card-description">borealis.app</p>            <span class="badge badge-info badge-dot card-action">Building</span>          </header>        </article>      </li>      <li>        <article class="card">          <header class="card-header">            <h2 class="card-title">Cinder</h2>            <p class="card-description">cinder.io</p>            <span class="badge badge-success badge-dot card-action">Ready</span>          </header>        </article>      </li>      <li>        <article class="card">          <header class="card-header">            <h2 class="card-title">Drift</h2>            <p class="card-description">drift.so</p>            <span class="badge badge-danger badge-dot card-action">Failed</span>          </header>        </article>      </li>      <li>        <article class="card">          <header class="card-header">            <h2 class="card-title">Ember</h2>            <p class="card-description">ember.dev</p>            <span class="badge badge-success badge-dot card-action">Ready</span>          </header>        </article>      </li>      <li>        <article class="card">          <header class="card-header">            <h2 class="card-title">Fathom</h2>            <p class="card-description">fathom.app</p>            <span class="badge badge-success badge-dot card-action">Ready</span>          </header>        </article>      </li>    </ul>  </main>  <dialog class="dialog dialog-drawer dialog-drawer-start" id="shell-nav-header" closedby="any" aria-label="Navigation">    <div class="dialog-body flex flex-col gap-md">      <a class="navbar-brand h(40) px-xs" href="#"><ContrastIcon class="icon" />Atlas</a>      <nav class="nav" aria-label="Workspace, in the drawer">        <a class="nav-item" href="#"><HomeIcon class="icon" />Overview</a>        <a class="nav-item" href="#" aria-current="page">          <GridIcon class="icon" />Projects<span class="nav-end">12</span>        </a>        <a class="nav-item" href="#"><GlobeIcon class="icon" />Domains</a>        <a class="nav-item" href="#"><ChartBarIcon class="icon" />Analytics</a>        <a class="nav-item" href="#"><UsersIcon class="icon" />Team</a>        <a class="nav-item" href="#"><SlidersIcon class="icon" />Settings</a>      </nav>    </div>    <button type="button" class="btn btn-quiet btn-square btn-sm dialog-close" commandfor="shell-nav-header" command="close" aria-label="Close navigation">      <XIcon class="icon" />    </button>  </dialog></div>
<script setup>import MenuIcon from '@master/icons-vue/native/16/soft/menu'import ContrastIcon from '@master/icons-vue/native/16/soft/contrast'import BellIcon from '@master/icons-vue/native/16/soft/bell'import HomeIcon from '@master/icons-vue/native/16/soft/home'import GridIcon from '@master/icons-vue/native/16/soft/grid'import GlobeIcon from '@master/icons-vue/native/16/soft/globe'import ChartBarIcon from '@master/icons-vue/native/16/soft/chart-bar'import UsersIcon from '@master/icons-vue/native/16/soft/users'import SlidersIcon from '@master/icons-vue/native/16/soft/sliders'import XIcon from '@master/icons-vue/native/16/soft/x'</script><template>  <div class="shell bg-surface-base fg-text-body text-sm">    <a class="skip" href="#app-main-header">Skip to content</a>    <header class="navbar shell-header bb(1) bb-solid b-line-hair" style="--navbar-padding-x: 1.25rem">      <button type="button" class="btn btn-quiet btn-square btn-sm shell-toggle" commandfor="shell-nav-header" command="show-modal" aria-label="Open navigation">        <MenuIcon class="icon" />      </button>      <a class="navbar-brand" href="#"><ContrastIcon class="icon" />Atlas</a>      <div class="navbar-end">        <button type="button" class="btn btn-quiet btn-square btn-sm" aria-label="Notifications">          <BellIcon class="icon" />        </button>        <button type="button" class="btn btn-quiet btn-square btn-sm mxe(-4)" aria-label="Account">          <span class="avatar avatar-sm" aria-hidden="true">            <img class="avatar-image" src="/demo/people/yiching-lin.webp" alt width="24" height="24"><span class="avatar-fallback">YL</span>          </span>        </button>      </div>    </header>    <div class="shell-sidebar p-sm bxe(1) bxe-solid b-line-hair">      <nav class="nav" aria-label="Workspace">        <a class="nav-item" href="#"><HomeIcon class="icon" />Overview</a>        <a class="nav-item" href="#" aria-current="page">          <GridIcon class="icon" />Projects<span class="nav-end">12</span>        </a>        <a class="nav-item" href="#"><GlobeIcon class="icon" />Domains</a>        <a class="nav-item" href="#"><ChartBarIcon class="icon" />Analytics</a>        <a class="nav-item" href="#"><UsersIcon class="icon" />Team</a>        <a class="nav-item" href="#"><SlidersIcon class="icon" />Settings</a>      </nav>    </div>    <main class="shell-main flex flex-col gap-lg px(20) py-lg" id="app-main-header" tabindex="-1">      <h1 class="heading heading-lg">Projects</h1>      <ul class="auto-grid">        <li>          <article class="card">            <header class="card-header">              <h2 class="card-title">Atlas</h2>              <p class="card-description">atlas.dev</p>              <span class="badge badge-success badge-dot card-action">Ready</span>            </header>          </article>        </li>        <li>          <article class="card">            <header class="card-header">              <h2 class="card-title">Borealis</h2>              <p class="card-description">borealis.app</p>              <span class="badge badge-info badge-dot card-action">Building</span>            </header>          </article>        </li>        <li>          <article class="card">            <header class="card-header">              <h2 class="card-title">Cinder</h2>              <p class="card-description">cinder.io</p>              <span class="badge badge-success badge-dot card-action">Ready</span>            </header>          </article>        </li>        <li>          <article class="card">            <header class="card-header">              <h2 class="card-title">Drift</h2>              <p class="card-description">drift.so</p>              <span class="badge badge-danger badge-dot card-action">Failed</span>            </header>          </article>        </li>        <li>          <article class="card">            <header class="card-header">              <h2 class="card-title">Ember</h2>              <p class="card-description">ember.dev</p>              <span class="badge badge-success badge-dot card-action">Ready</span>            </header>          </article>        </li>        <li>          <article class="card">            <header class="card-header">              <h2 class="card-title">Fathom</h2>              <p class="card-description">fathom.app</p>              <span class="badge badge-success badge-dot card-action">Ready</span>            </header>          </article>        </li>      </ul>    </main>    <dialog class="dialog dialog-drawer dialog-drawer-start" id="shell-nav-header" closedby="any" aria-label="Navigation">      <div class="dialog-body flex flex-col gap-md">        <a class="navbar-brand h(40) px-xs" href="#"><ContrastIcon class="icon" />Atlas</a>        <nav class="nav" aria-label="Workspace, in the drawer">          <a class="nav-item" href="#"><HomeIcon class="icon" />Overview</a>          <a class="nav-item" href="#" aria-current="page">            <GridIcon class="icon" />Projects<span class="nav-end">12</span>          </a>          <a class="nav-item" href="#"><GlobeIcon class="icon" />Domains</a>          <a class="nav-item" href="#"><ChartBarIcon class="icon" />Analytics</a>          <a class="nav-item" href="#"><UsersIcon class="icon" />Team</a>          <a class="nav-item" href="#"><SlidersIcon class="icon" />Settings</a>        </nav>      </div>      <button type="button" class="btn btn-quiet btn-square btn-sm dialog-close" commandfor="shell-nav-header" command="close" aria-label="Close navigation">        <XIcon class="icon" />      </button>    </dialog>  </div></template>

#固定布局

shell-fixed 让应用框架的尺寸与视口完全一致。只有各区域可以独立滚动,阅读已打开的内容时,列表会保持原来的滚动位置。收件箱、编辑器或聊天界面需要并排查看两处内容,适合使用固定布局。其他场景使用默认布局,让文档整体滚动。手机浏览器的工具栏会随页面滚动收起,因此整体滚动在手机上表现更好。

--shell-sidebar 设置侧边栏宽度。此处设为 20rem,用于显示消息列表。

这一栏由标题和列表组成,只有列表滚动:列表使用 grow(1) min-h(0) overflow-y-auto,因此标题和筛选按钮保持不动。列表通过 px-sm 与栏的两侧保持距离,当前行的凸起面板不会贴住边缘;标题使用与行自身内缩 --list-inset 相同的 pxs(10),因此与各行文字从同一位置开始。每一行都使用 items-baseline,让时间与标题落在同一行。

固定布局

<div class="shell shell-fixed bg-surface-base fg-text-body text-sm" style="--shell-sidebar: 20rem">  <a class="skip" href="#app-main-fixed">Skip to content</a>  <aside class="shell-sidebar bxe(1) bxe-solid b-line-hair" aria-labelledby="inbox-title">    <header class="flex items-center justify-between gap-xs shrink(0) h(56) px-sm">      <h1 class="heading heading-sm pxs(10)" id="inbox-title">Inbox</h1>      <button type="button" class="btn btn-quiet btn-square btn-sm" aria-label="Filter messages">        <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="M4.5365 3L11.4635 3A1 1 0 0 1 12.2548 4.6114L9.4587 8.2299A1 1 0 0 0 9.25 8.8413L9.25 11.323A1 1 0 0 1 8.6214 12.2514L7.875 12.55A0.8203 0.8203 0 0 1 6.75 11.7883L6.75 8.8413A1 1 0 0 0 6.5413 8.2299L3.7452 4.6114A1 1 0 0 1 4.5365 3Z" />        </svg>      </button>    </header>    <ul class="list list-interactive grow(1) min-h(0) overflow-y-auto px-sm pt-2xs pb-sm">      <li>        <a class="list-row items-baseline" href="#" aria-current="true">          <div class="list-body">            <p class="list-title">Deploy failed on drift.so</p>            <p class="list-description">The install step exited with code 1.</p>          </div>          <time class="list-end" datetime="2026-11-12T09:41">09:41</time>        </a>      </li>      <li>        <a class="list-row items-baseline" href="#">          <div class="list-body">            <p class="list-title">Misaki invited you to Borealis</p>            <p class="list-description">You now have access as an editor.</p>          </div>          <time class="list-end" datetime="2026-11-12T09:12">09:12</time>        </a>      </li>      <li>        <a class="list-row items-baseline" href="#">          <div class="list-body">            <p class="list-title">Your invoice for October</p>            <p class="list-description">$48.00, paid with the card ending 4242.</p>          </div>          <time class="list-end" datetime="2026-11-10">Tue</time>        </a>      </li>      <li>        <a class="list-row items-baseline" href="#">          <div class="list-body">            <p class="list-title">Domain atlas.dev renewed</p>            <p class="list-description">Valid until 4 November next year.</p>          </div>          <time class="list-end" datetime="2026-11-09">Mon</time>        </a>      </li>      <li>        <a class="list-row items-baseline" href="#">          <div class="list-body">            <p class="list-title">Weekly summary</p>            <p class="list-description">1.28M requests, 0.02% errors.</p>          </div>          <time class="list-end" datetime="2026-11-09">Mon</time>        </a>      </li>      <li>        <a class="list-row items-baseline" href="#">          <div class="list-body">            <p class="list-title">Cinder is live in 14 regions</p>            <p class="list-description">Deployed from main by Po-han.</p>          </div>          <time class="list-end" datetime="2026-11-08">Sun</time>        </a>      </li>      <li>        <a class="list-row items-baseline" href="#">          <div class="list-body">            <p class="list-title">New sign-in from Tokyo</p>            <p class="list-description">If this was you, there is nothing to do.</p>          </div>          <time class="list-end" datetime="2026-11-07">Sat</time>        </a>      </li>      <li>        <a class="list-row items-baseline" href="#">          <div class="list-body">            <p class="list-title">Usage at 80% of your plan</p>            <p class="list-description">Upgrade or lower traffic before the 30th.</p>          </div>          <time class="list-end" datetime="2026-11-06">Fri</time>        </a>      </li>    </ul>  </aside>  <main class="shell-main" id="app-main-fixed" tabindex="-1">    <div class="flex flex-col items-start gap-lg max-w(688) p-lg">      <button type="button" class="btn btn-sm shell-toggle" commandfor="inbox-list" command="show-modal">        <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="M2.6667 3.3333L13.3333 3.3333" /><path d="M2.6667 6.3333L9.3333 6.3333" /><path d="M2.6667 9.3333L13.3333 9.3333" /><path d="M2.6667 12.3333L9.3333 12.3333" />        </svg>Inbox      </button>      <article class="flex flex-col gap-lg">        <header class="flex flex-col gap-xs">          <p class="eyebrow">Deployments</p>          <h2 class="heading heading-xl">Deploy failed on drift.so</h2>          <p class="lead lead-sm">            The install step exited with code 1. Nothing was published, and the previous deployment is still serving traffic.          </p>        </header>        <pre class="code-block"><code>npm error code ERESOLVEnpm error ERESOLVE could not resolvenpm error While resolving: drift@2.4.0</code></pre>        <div class="flex flex-col gap-sm">          <p class="m(0) leading-md">            The adapter that drift pins was withdrawn from the registry this morning, so the lockfile no longer resolves. Two other projects in this team pin the same version.          </p>          <p class="m(0) leading-md">            Retry the deployment after pinning the dependency, or roll back from the deployments list. The log above is the last three lines; the full log is on the deployment page.          </p>        </div>        <div class="flex flex-wrap gap-xs">          <button type="button" class="btn btn-primary">Retry deployment</button>          <button type="button" class="btn">View full log</button>        </div>      </article>    </div>  </main>  <dialog class="dialog dialog-drawer dialog-drawer-start" id="inbox-list" closedby="any" aria-labelledby="inbox-drawer-title">    <header class="dialog-header">      <h2 class="dialog-title pxs(10)" id="inbox-drawer-title">Inbox</h2>    </header>    <div class="dialog-body">      <ul class="list list-interactive">        <li>          <a class="list-row items-baseline" href="#" aria-current="true">            <div class="list-body">              <p class="list-title">Deploy failed on drift.so</p>              <p class="list-description">The install step exited with code 1.</p>            </div>            <time class="list-end" datetime="2026-11-12T09:41">09:41</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">Misaki invited you to Borealis</p>              <p class="list-description">You now have access as an editor.</p>            </div>            <time class="list-end" datetime="2026-11-12T09:12">09:12</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">Your invoice for October</p>              <p class="list-description">$48.00, paid with the card ending 4242.</p>            </div>            <time class="list-end" datetime="2026-11-10">Tue</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">Domain atlas.dev renewed</p>              <p class="list-description">Valid until 4 November next year.</p>            </div>            <time class="list-end" datetime="2026-11-09">Mon</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">Weekly summary</p>              <p class="list-description">1.28M requests, 0.02% errors.</p>            </div>            <time class="list-end" datetime="2026-11-09">Mon</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">Cinder is live in 14 regions</p>              <p class="list-description">Deployed from main by Po-han.</p>            </div>            <time class="list-end" datetime="2026-11-08">Sun</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">New sign-in from Tokyo</p>              <p class="list-description">If this was you, there is nothing to do.</p>            </div>            <time class="list-end" datetime="2026-11-07">Sat</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">Usage at 80% of your plan</p>              <p class="list-description">Upgrade or lower traffic before the 30th.</p>            </div>            <time class="list-end" datetime="2026-11-06">Fri</time>          </a>        </li>      </ul>    </div>    <button type="button" class="btn btn-quiet btn-square btn-sm dialog-close" commandfor="inbox-list" command="close" aria-label="Close the inbox">      <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="M4 4L12 12" /><path d="M4 12L12 4" />      </svg>    </button>  </dialog></div>
<script>  import FilterIcon from '@master/icons-svelte/native/16/soft/filter'  import AlignLeftIcon from '@master/icons-svelte/native/16/soft/align-left'  import XIcon from '@master/icons-svelte/native/16/soft/x'</script><div class="shell shell-fixed bg-surface-base fg-text-body text-sm" style="--shell-sidebar: 20rem">  <a class="skip" href="#app-main-fixed">Skip to content</a>  <aside class="shell-sidebar bxe(1) bxe-solid b-line-hair" aria-labelledby="inbox-title">    <header class="flex items-center justify-between gap-xs shrink(0) h(56) px-sm">      <h1 class="heading heading-sm pxs(10)" id="inbox-title">Inbox</h1>      <button type="button" class="btn btn-quiet btn-square btn-sm" aria-label="Filter messages">        <FilterIcon class="icon" />      </button>    </header>    <ul class="list list-interactive grow(1) min-h(0) overflow-y-auto px-sm pt-2xs pb-sm">      <li>        <a class="list-row items-baseline" href="#" aria-current="true">          <div class="list-body">            <p class="list-title">Deploy failed on drift.so</p>            <p class="list-description">The install step exited with code 1.</p>          </div>          <time class="list-end" datetime="2026-11-12T09:41">09:41</time>        </a>      </li>      <li>        <a class="list-row items-baseline" href="#">          <div class="list-body">            <p class="list-title">Misaki invited you to Borealis</p>            <p class="list-description">You now have access as an editor.</p>          </div>          <time class="list-end" datetime="2026-11-12T09:12">09:12</time>        </a>      </li>      <li>        <a class="list-row items-baseline" href="#">          <div class="list-body">            <p class="list-title">Your invoice for October</p>            <p class="list-description">$48.00, paid with the card ending 4242.</p>          </div>          <time class="list-end" datetime="2026-11-10">Tue</time>        </a>      </li>      <li>        <a class="list-row items-baseline" href="#">          <div class="list-body">            <p class="list-title">Domain atlas.dev renewed</p>            <p class="list-description">Valid until 4 November next year.</p>          </div>          <time class="list-end" datetime="2026-11-09">Mon</time>        </a>      </li>      <li>        <a class="list-row items-baseline" href="#">          <div class="list-body">            <p class="list-title">Weekly summary</p>            <p class="list-description">1.28M requests, 0.02% errors.</p>          </div>          <time class="list-end" datetime="2026-11-09">Mon</time>        </a>      </li>      <li>        <a class="list-row items-baseline" href="#">          <div class="list-body">            <p class="list-title">Cinder is live in 14 regions</p>            <p class="list-description">Deployed from main by Po-han.</p>          </div>          <time class="list-end" datetime="2026-11-08">Sun</time>        </a>      </li>      <li>        <a class="list-row items-baseline" href="#">          <div class="list-body">            <p class="list-title">New sign-in from Tokyo</p>            <p class="list-description">If this was you, there is nothing to do.</p>          </div>          <time class="list-end" datetime="2026-11-07">Sat</time>        </a>      </li>      <li>        <a class="list-row items-baseline" href="#">          <div class="list-body">            <p class="list-title">Usage at 80% of your plan</p>            <p class="list-description">Upgrade or lower traffic before the 30th.</p>          </div>          <time class="list-end" datetime="2026-11-06">Fri</time>        </a>      </li>    </ul>  </aside>  <main class="shell-main" id="app-main-fixed" tabindex="-1">    <div class="flex flex-col items-start gap-lg max-w(688) p-lg">      <button type="button" class="btn btn-sm shell-toggle" commandfor="inbox-list" command="show-modal">        <AlignLeftIcon class="icon" />Inbox      </button>      <article class="flex flex-col gap-lg">        <header class="flex flex-col gap-xs">          <p class="eyebrow">Deployments</p>          <h2 class="heading heading-xl">Deploy failed on drift.so</h2>          <p class="lead lead-sm">            The install step exited with code 1. Nothing was published, and the previous deployment is still serving traffic.          </p>        </header>        <pre class="code-block"><code>npm error code ERESOLVEnpm error ERESOLVE could not resolvenpm error While resolving: drift@2.4.0</code></pre>        <div class="flex flex-col gap-sm">          <p class="m(0) leading-md">            The adapter that drift pins was withdrawn from the registry this morning, so the lockfile no longer resolves. Two other projects in this team pin the same version.          </p>          <p class="m(0) leading-md">            Retry the deployment after pinning the dependency, or roll back from the deployments list. The log above is the last three lines; the full log is on the deployment page.          </p>        </div>        <div class="flex flex-wrap gap-xs">          <button type="button" class="btn btn-primary">Retry deployment</button>          <button type="button" class="btn">View full log</button>        </div>      </article>    </div>  </main>  <dialog class="dialog dialog-drawer dialog-drawer-start" id="inbox-list" closedby="any" aria-labelledby="inbox-drawer-title">    <header class="dialog-header">      <h2 class="dialog-title pxs(10)" id="inbox-drawer-title">Inbox</h2>    </header>    <div class="dialog-body">      <ul class="list list-interactive">        <li>          <a class="list-row items-baseline" href="#" aria-current="true">            <div class="list-body">              <p class="list-title">Deploy failed on drift.so</p>              <p class="list-description">The install step exited with code 1.</p>            </div>            <time class="list-end" datetime="2026-11-12T09:41">09:41</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">Misaki invited you to Borealis</p>              <p class="list-description">You now have access as an editor.</p>            </div>            <time class="list-end" datetime="2026-11-12T09:12">09:12</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">Your invoice for October</p>              <p class="list-description">$48.00, paid with the card ending 4242.</p>            </div>            <time class="list-end" datetime="2026-11-10">Tue</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">Domain atlas.dev renewed</p>              <p class="list-description">Valid until 4 November next year.</p>            </div>            <time class="list-end" datetime="2026-11-09">Mon</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">Weekly summary</p>              <p class="list-description">1.28M requests, 0.02% errors.</p>            </div>            <time class="list-end" datetime="2026-11-09">Mon</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">Cinder is live in 14 regions</p>              <p class="list-description">Deployed from main by Po-han.</p>            </div>            <time class="list-end" datetime="2026-11-08">Sun</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">New sign-in from Tokyo</p>              <p class="list-description">If this was you, there is nothing to do.</p>            </div>            <time class="list-end" datetime="2026-11-07">Sat</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">Usage at 80% of your plan</p>              <p class="list-description">Upgrade or lower traffic before the 30th.</p>            </div>            <time class="list-end" datetime="2026-11-06">Fri</time>          </a>        </li>      </ul>    </div>    <button type="button" class="btn btn-quiet btn-square btn-sm dialog-close" commandfor="inbox-list" command="close" aria-label="Close the inbox">      <XIcon class="icon" />    </button>  </dialog></div>
<script setup>import FilterIcon from '@master/icons-vue/native/16/soft/filter'import AlignLeftIcon from '@master/icons-vue/native/16/soft/align-left'import XIcon from '@master/icons-vue/native/16/soft/x'</script><template>  <div class="shell shell-fixed bg-surface-base fg-text-body text-sm" style="--shell-sidebar: 20rem">    <a class="skip" href="#app-main-fixed">Skip to content</a>    <aside class="shell-sidebar bxe(1) bxe-solid b-line-hair" aria-labelledby="inbox-title">      <header class="flex items-center justify-between gap-xs shrink(0) h(56) px-sm">        <h1 class="heading heading-sm pxs(10)" id="inbox-title">Inbox</h1>        <button type="button" class="btn btn-quiet btn-square btn-sm" aria-label="Filter messages">          <FilterIcon class="icon" />        </button>      </header>      <ul class="list list-interactive grow(1) min-h(0) overflow-y-auto px-sm pt-2xs pb-sm">        <li>          <a class="list-row items-baseline" href="#" aria-current="true">            <div class="list-body">              <p class="list-title">Deploy failed on drift.so</p>              <p class="list-description">The install step exited with code 1.</p>            </div>            <time class="list-end" datetime="2026-11-12T09:41">09:41</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">Misaki invited you to Borealis</p>              <p class="list-description">You now have access as an editor.</p>            </div>            <time class="list-end" datetime="2026-11-12T09:12">09:12</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">Your invoice for October</p>              <p class="list-description">$48.00, paid with the card ending 4242.</p>            </div>            <time class="list-end" datetime="2026-11-10">Tue</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">Domain atlas.dev renewed</p>              <p class="list-description">Valid until 4 November next year.</p>            </div>            <time class="list-end" datetime="2026-11-09">Mon</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">Weekly summary</p>              <p class="list-description">1.28M requests, 0.02% errors.</p>            </div>            <time class="list-end" datetime="2026-11-09">Mon</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">Cinder is live in 14 regions</p>              <p class="list-description">Deployed from main by Po-han.</p>            </div>            <time class="list-end" datetime="2026-11-08">Sun</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">New sign-in from Tokyo</p>              <p class="list-description">If this was you, there is nothing to do.</p>            </div>            <time class="list-end" datetime="2026-11-07">Sat</time>          </a>        </li>        <li>          <a class="list-row items-baseline" href="#">            <div class="list-body">              <p class="list-title">Usage at 80% of your plan</p>              <p class="list-description">Upgrade or lower traffic before the 30th.</p>            </div>            <time class="list-end" datetime="2026-11-06">Fri</time>          </a>        </li>      </ul>    </aside>    <main class="shell-main" id="app-main-fixed" tabindex="-1">      <div class="flex flex-col items-start gap-lg max-w(688) p-lg">        <button type="button" class="btn btn-sm shell-toggle" commandfor="inbox-list" command="show-modal">          <AlignLeftIcon class="icon" />Inbox        </button>        <article class="flex flex-col gap-lg">          <header class="flex flex-col gap-xs">            <p class="eyebrow">Deployments</p>            <h2 class="heading heading-xl">Deploy failed on drift.so</h2>            <p class="lead lead-sm">              The install step exited with code 1. Nothing was published, and the previous deployment is still serving traffic.            </p>          </header>          <pre class="code-block"><code>npm error code ERESOLVEnpm error ERESOLVE could not resolvenpm error While resolving: drift@2.4.0</code></pre>          <div class="flex flex-col gap-sm">            <p class="m(0) leading-md">              The adapter that drift pins was withdrawn from the registry this morning, so the lockfile no longer resolves. Two other projects in this team pin the same version.            </p>            <p class="m(0) leading-md">              Retry the deployment after pinning the dependency, or roll back from the deployments list. The log above is the last three lines; the full log is on the deployment page.            </p>          </div>          <div class="flex flex-wrap gap-xs">            <button type="button" class="btn btn-primary">Retry deployment</button>            <button type="button" class="btn">View full log</button>          </div>        </article>      </div>    </main>    <dialog class="dialog dialog-drawer dialog-drawer-start" id="inbox-list" closedby="any" aria-labelledby="inbox-drawer-title">      <header class="dialog-header">        <h2 class="dialog-title pxs(10)" id="inbox-drawer-title">Inbox</h2>      </header>      <div class="dialog-body">        <ul class="list list-interactive">          <li>            <a class="list-row items-baseline" href="#" aria-current="true">              <div class="list-body">                <p class="list-title">Deploy failed on drift.so</p>                <p class="list-description">The install step exited with code 1.</p>              </div>              <time class="list-end" datetime="2026-11-12T09:41">09:41</time>            </a>          </li>          <li>            <a class="list-row items-baseline" href="#">              <div class="list-body">                <p class="list-title">Misaki invited you to Borealis</p>                <p class="list-description">You now have access as an editor.</p>              </div>              <time class="list-end" datetime="2026-11-12T09:12">09:12</time>            </a>          </li>          <li>            <a class="list-row items-baseline" href="#">              <div class="list-body">                <p class="list-title">Your invoice for October</p>                <p class="list-description">$48.00, paid with the card ending 4242.</p>              </div>              <time class="list-end" datetime="2026-11-10">Tue</time>            </a>          </li>          <li>            <a class="list-row items-baseline" href="#">              <div class="list-body">                <p class="list-title">Domain atlas.dev renewed</p>                <p class="list-description">Valid until 4 November next year.</p>              </div>              <time class="list-end" datetime="2026-11-09">Mon</time>            </a>          </li>          <li>            <a class="list-row items-baseline" href="#">              <div class="list-body">                <p class="list-title">Weekly summary</p>                <p class="list-description">1.28M requests, 0.02% errors.</p>              </div>              <time class="list-end" datetime="2026-11-09">Mon</time>            </a>          </li>          <li>            <a class="list-row items-baseline" href="#">              <div class="list-body">                <p class="list-title">Cinder is live in 14 regions</p>                <p class="list-description">Deployed from main by Po-han.</p>              </div>              <time class="list-end" datetime="2026-11-08">Sun</time>            </a>          </li>          <li>            <a class="list-row items-baseline" href="#">              <div class="list-body">                <p class="list-title">New sign-in from Tokyo</p>                <p class="list-description">If this was you, there is nothing to do.</p>              </div>              <time class="list-end" datetime="2026-11-07">Sat</time>            </a>          </li>          <li>            <a class="list-row items-baseline" href="#">              <div class="list-body">                <p class="list-title">Usage at 80% of your plan</p>                <p class="list-description">Upgrade or lower traffic before the 30th.</p>              </div>              <time class="list-end" datetime="2026-11-06">Fri</time>            </a>          </li>        </ul>      </div>      <button type="button" class="btn btn-quiet btn-square btn-sm dialog-close" commandfor="inbox-list" command="close" aria-label="Close the inbox">        <XIcon class="icon" />      </button>    </dialog>  </div></template>
列表和消息各自滚动,页面本身保持固定。切换到手机视图后,列表隐藏,可通过按钮将其作为抽屉打开。

#工作区

工作区是带有第三个区域的固定布局:编辑器位于通向它的导航和所编辑内容的属性之间。读者长时间处理同一项内容,而其设置应始终留在旁边时使用它,例如一篇文章、一份发布说明或一条记录。如果工作内容旁边没有需要设置的东西,上文的固定布局就够了。

属性位于 shell-aside 中,这里通过 --shell-aside 将其设为 18rem 宽。主区域是位于编辑器上方的页眉,编辑器的引擎是 Tiptap,与富文本指南中相同。

工作区

<div class="shell shell-fixed bg-surface-base fg-text-body text-sm" style="--shell-aside: 18rem" data-example="workspace">  <a class="skip" href="#workspace-main">Skip to content</a>  <aside class="shell-sidebar gap-md p-sm bxe(1) bxe-solid b-line-hair" aria-label="Workspace">    <a class="navbar-brand h(40) px-xs" 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="nav" aria-label="Sections">      <a class="nav-item" 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">          <path d="M3 13L3 6.9624A1 1 0 0 1 3.3524 6.2005L7.3524 2.8005A1 1 0 0 1 8.6476 2.8005L12.6476 6.2005A1 1 0 0 1 13 6.9624L13 13A1 1 0 0 1 12 14L4 14A1 1 0 0 1 3 13Z" />          <path d="M6.5 14L6.5 11A1 1 0 0 1 7.5 10L8.5 10A1 1 0 0 1 9.5 11L9.5 14" />        </svg>Overview</a>      <a class="nav-item" href="#" aria-current="page">        <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="M4.5 2L9.0858 2A1 1 0 0 1 9.7929 2.2929L12.2071 4.7071A1 1 0 0 1 12.5 5.4142L12.5 13A1 1 0 0 1 11.5 14L4.5 14A1 1 0 0 1 3.5 13L3.5 3A1 1 0 0 1 4.5 2Z" />          <path d="M10 2.5V4.4A0.1 0.1 0 0 0 10.1 4.5H12L12.2409 4.7427A0.9993 0.9993 0 0 1 12.5 5.4142V5.5H10.1Q9.6444 5.5 9.3222 5.1778Q9 4.8556 9 4.4V2A1.1002 1.1002 0 0 1 9.3761 2.0431A1.0001 1.0001 0 0 1 9.7929 2.2929L10 2.5Z" fill="currentColor" stroke="none" fill-rule="evenodd" />          <path d="M6 10.5L10 10.5" />        </svg>Changelog        <span class="nav-end">8</span>      </a>      <a class="nav-item" 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">          <path d="M3 12.3333V3.6667Q3 2 4.6667 2H12.6Q13 2 13 2.4V13.6Q13 14 12.6 14H4.6667Q3 14 3 12.3333Z" />          <path d="M3 12.3333Q3 10.6667 4.6667 10.6667H13" />        </svg>Guides</a>      <a class="nav-item" 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">          <rect x="2" y="2.6667" width="12" height="10.6667" rx="1" />          <path d="M5.3356 13.3334H4.1667A0.5 0.5 0 0 1 4.293 13.0011L9.4854 7.1596Q9.6862 6.9338 9.9881 6.925Q10.29 6.9162 10.5036 7.1298L14 10.6262V11.8333A0.5006 0.5006 0 0 1 13.6465 11.6869L10.0214 8.0618L5.3356 13.3334Z" fill="currentColor" stroke="none" fill-rule="evenodd" />          <circle cx="5" cy="5.6667" r="0.9" fill="currentColor" stroke="none" />        </svg>Media</a>      <a class="nav-item" 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="6.25" cy="4.5" r="2" />          <path d="M2.25 13.75V12.5C2.25 10.7 3.85 9.5 5.35 9.5H7.15C8.65 9.5 10.25 10.7 10.25 12.5V13.75" />          <path d="M11.1 2.6C13.8 2.6 13.8 6.6 11.1 6.6" />          <path d="M12 9.5C13.5 9.75 14.25 11.25 14.25 12.5V13.75" />        </svg>Team</a>      <a class="nav-item" 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">          <path d="M2.5 4.5L4.5 4.5" />          <circle cx="6" cy="4.5" r="1.5" />          <path d="M7.5 4.5L13.5 4.5" />          <path d="M2.5 11.5L8.5 11.5" />          <circle cx="10" cy="11.5" r="1.5" />          <path d="M11.5 11.5L13.5 11.5" />        </svg>Settings</a>    </nav>  </aside>  <main class="shell-main flex flex-col" id="workspace-main" tabindex="-1">    <header class="flex items-center gap-xs shrink(0) min-h(56) px-lg">      <button type="button" class="btn btn-quiet btn-square btn-sm btn-hang-start shell-toggle" commandfor="workspace-navigation" command="show-modal" aria-label="Open navigation">        <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>      <h1 class="heading heading-sm min-w(0) truncate" id="workspace-title" data-title>Regions, closer to your readers</h1>      <span class="badge badge-dot shrink(0) hidden@container(--max-sm)" data-status>Draft</span>      <button type="button" class="btn btn-sm shrink(0) ml-auto hidden@container(--5xl)" commandfor="workspace-properties-drawer" command="show-modal" aria-label="Properties" data-properties-toggle>        <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">          <rect x="2" y="2.6667" width="12" height="10.6667" rx="1" />          <path d="M10 2.6667L10 13.3333" />        </svg>        <span class="hidden@container(--max-sm)">Properties</span>      </button>    </header>    <div class="flex flex-col grow(1) min-h(0) px-lg pb-lg">      <div class="editor grow(1) min-h(0)" style="--editor-rows: 3; --editor-max-rows: infinity">        <div class="toolbar editor-toolbar" role="toolbar" aria-label="Formatting" aria-controls="workspace-document">          <select class="select select-sm" data-command="style" aria-label="Text style">            <option value="paragraph">Paragraph</option>            <option value="heading">Heading</option>            <option value="subheading">Subheading</option>          </select>          <span class="toolbar-separator" role="separator" aria-orientation="vertical"></span>          <button type="button" class="btn btn-quiet btn-sm btn-square" data-command="bold" aria-label="Bold" aria-keyshortcuts="Control+B Meta+B" aria-pressed="false">            <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="M4.6667 3H8.3333C12.3333 3 12.3333 7.6667 8.3333 7.6667H4.6667M4.6667 3V13H9C13.3333 13 13.3333 7.6667 9 7.6667" />            </svg>          </button>          <button type="button" class="btn btn-quiet btn-sm btn-square" data-command="italic" aria-label="Italic" aria-keyshortcuts="Control+I Meta+I" aria-pressed="false">            <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="M6.6667 3L12.6667 3" />              <path d="M3.3333 13L9.3333 13" />              <path d="M9.6667 3L6.3333 13" stroke-linecap="butt" />            </svg>          </button>          <button type="button" class="btn btn-quiet btn-sm btn-square" data-command="underline" aria-label="Underline" aria-keyshortcuts="Control+U Meta+U" aria-pressed="false">            <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="M4.3333 2.6667V7.6667C4.3333 12.3333 11.6667 12.3333 11.6667 7.6667V2.6667" />              <path d="M3 14L13 14" />            </svg>          </button>          <span class="toolbar-separator" role="separator" aria-orientation="vertical"></span>          <button type="button" class="btn btn-quiet btn-sm btn-square" data-command="bulletList" aria-label="Bulleted list" aria-pressed="false">            <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="3" cy="4" r="0.5" fill="currentColor" stroke="none" />              <path d="M6 4L13.5 4" />              <circle cx="3" cy="8" r="0.5" fill="currentColor" stroke="none" />              <path d="M6 8L13.5 8" />              <circle cx="3" cy="12" r="0.5" fill="currentColor" stroke="none" />              <path d="M6 12L13.5 12" />            </svg>          </button>          <button type="button" class="btn btn-quiet btn-sm btn-square" data-command="orderedList" aria-label="Numbered list" aria-pressed="false">            <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="M2 3.3333L3 2.6667V6M2 6H4" stroke-width="0.8" />              <path d="M2 9.6667C2 8.3333 4 8.3333 4 9.6667C4 10.6667 2 11 2 12.6667H4" stroke-width="0.8" />              <path d="M6.6667 4.6667L14 4.6667" />              <path d="M6.6667 11.3333L14 11.3333" />            </svg>          </button>          <button type="button" class="btn btn-quiet btn-sm btn-square" data-command="blockquote" aria-label="Quotation" aria-pressed="false">            <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="M2.7667 3.3333H6.2333Q6.6667 3.3333 6.6667 3.7667V8.6667C6.6667 11.3333 4.6667 12.6667 2.3333 12.6667V10.6667C4 10.6667 4.3333 9.6667 4.3333 8H2.7667Q2.3333 8 2.3333 7.5667V3.7667Q2.3333 3.3333 2.7667 3.3333Z" />              <path d="M9.7667 3.3333H13.2333Q13.6667 3.3333 13.6667 3.7667V8.6667C13.6667 11.3333 11.6667 12.6667 9.3333 12.6667V10.6667C11 10.6667 11.3333 9.6667 11.3333 8H9.7667Q9.3333 8 9.3333 7.5667V3.7667Q9.3333 3.3333 9.7667 3.3333Z" />            </svg>          </button>          <button type="button" class="btn btn-quiet btn-sm btn-square ml-auto" data-command="undo" aria-label="Undo" aria-keyshortcuts="Control+Z Meta+Z">            <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="M6 3L3.1414 5.8586A0.2 0.2 0 0 0 3.1414 6.1414L6 9" />              <path d="M2.715 6.4108A0.4996 0.4996 0 0 0 3 6.5H9.5A2.9999 2.9999 0 0 1 10.6043 12.2894Q10.0722 12.5 9.5 12.5L5.9755 12.5006A0.5 0.5 0 0 0 5.9266 13.4946L6 13.5H9.5A3.9999 3.9999 0 0 0 10.9724 5.7808Q10.263 5.5 9.5 5.5L2.9621 5.5014A0.5007 0.5007 0 0 0 2.715 5.5892A0.7044 0.7044 0 0 0 2.715 6.4108Z" fill="currentColor" stroke="none" fill-rule="evenodd" />            </svg>          </button>          <button type="button" class="btn btn-quiet btn-sm btn-square" data-command="redo" aria-label="Redo" aria-keyshortcuts="Control+Shift+Z Meta+Shift+Z">            <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="M6 3L3.1414 5.8586A0.2 0.2 0 0 0 3.1414 6.1414L6 9" transform="translate(16 0) scale(-1 1)" />              <path d="M2.715 6.4108A0.4996 0.4996 0 0 0 3 6.5H9.5A2.9999 2.9999 0 0 1 10.6043 12.2894Q10.0722 12.5 9.5 12.5L5.9755 12.5006A0.5 0.5 0 0 0 5.9266 13.4946L6 13.5H9.5A3.9999 3.9999 0 0 0 10.9724 5.7808Q10.263 5.5 9.5 5.5L2.9621 5.5014A0.5007 0.5007 0 0 0 2.715 5.5892A0.7044 0.7044 0 0 0 2.715 6.4108Z" fill="currentColor" stroke="none" fill-rule="evenodd" transform="translate(16 0) scale(-1 1)" />            </svg>          </button>        </div>        <div class="flex flex-col grow(1) min-h(0)" data-editor></div>      </div>    </div>  </main>  <aside class="shell-aside bxs(1) bxs-solid b-line-hair" aria-labelledby="workspace-properties-title">    <header class="flex items-center shrink(0) min-h(56) px(20)">      <h2 class="heading heading-sm" id="workspace-properties-title">Properties</h2>    </header>    <div class="px(20) pb(20)" data-properties-home>      <div class="form" data-properties>        <label class="field">Title          <input class="input" type="text" name="title" value="Regions, closer to your readers" autocomplete="off">        </label>        <label class="field">Status          <select class="select" name="status">            <option class="select-option" value="draft">Draft</option>            <option class="select-option" value="review">In review</option>            <option class="select-option" value="published">Published</option>          </select>        </label>        <div class="field">          <label for="ws-summary">Summary</label>          <textarea class="input input-auto" id="ws-summary" name="summary" aria-describedby="ws-summary-hint">Four new regions, and a faster path to all of them.</textarea>          <span class="field-hint" id="ws-summary-hint">Shown under the title in the changelog.</span>        </div>        <label class="check">          <input type="checkbox" role="switch" class="switch" name="listed" checked>List in the changelog</label>      </div>    </div>  </aside>  <dialog class="dialog dialog-drawer dialog-drawer-start" id="workspace-navigation" closedby="any" aria-label="Navigation">    <div class="dialog-body flex flex-col gap-md">      <a class="navbar-brand h(40) px-xs" 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="nav" aria-label="Sections, in the drawer">        <a class="nav-item" 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">            <path d="M3 13L3 6.9624A1 1 0 0 1 3.3524 6.2005L7.3524 2.8005A1 1 0 0 1 8.6476 2.8005L12.6476 6.2005A1 1 0 0 1 13 6.9624L13 13A1 1 0 0 1 12 14L4 14A1 1 0 0 1 3 13Z" />            <path d="M6.5 14L6.5 11A1 1 0 0 1 7.5 10L8.5 10A1 1 0 0 1 9.5 11L9.5 14" />          </svg>Overview</a>        <a class="nav-item" href="#" aria-current="page">          <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="M4.5 2L9.0858 2A1 1 0 0 1 9.7929 2.2929L12.2071 4.7071A1 1 0 0 1 12.5 5.4142L12.5 13A1 1 0 0 1 11.5 14L4.5 14A1 1 0 0 1 3.5 13L3.5 3A1 1 0 0 1 4.5 2Z" />            <path d="M10 2.5V4.4A0.1 0.1 0 0 0 10.1 4.5H12L12.2409 4.7427A0.9993 0.9993 0 0 1 12.5 5.4142V5.5H10.1Q9.6444 5.5 9.3222 5.1778Q9 4.8556 9 4.4V2A1.1002 1.1002 0 0 1 9.3761 2.0431A1.0001 1.0001 0 0 1 9.7929 2.2929L10 2.5Z" fill="currentColor" stroke="none" fill-rule="evenodd" />            <path d="M6 10.5L10 10.5" />          </svg>Changelog          <span class="nav-end">8</span>        </a>        <a class="nav-item" 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">            <path d="M3 12.3333V3.6667Q3 2 4.6667 2H12.6Q13 2 13 2.4V13.6Q13 14 12.6 14H4.6667Q3 14 3 12.3333Z" />            <path d="M3 12.3333Q3 10.6667 4.6667 10.6667H13" />          </svg>Guides</a>        <a class="nav-item" 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">            <rect x="2" y="2.6667" width="12" height="10.6667" rx="1" />            <path d="M5.3356 13.3334H4.1667A0.5 0.5 0 0 1 4.293 13.0011L9.4854 7.1596Q9.6862 6.9338 9.9881 6.925Q10.29 6.9162 10.5036 7.1298L14 10.6262V11.8333A0.5006 0.5006 0 0 1 13.6465 11.6869L10.0214 8.0618L5.3356 13.3334Z" fill="currentColor" stroke="none" fill-rule="evenodd" />            <circle cx="5" cy="5.6667" r="0.9" fill="currentColor" stroke="none" />          </svg>Media</a>        <a class="nav-item" 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="6.25" cy="4.5" r="2" />            <path d="M2.25 13.75V12.5C2.25 10.7 3.85 9.5 5.35 9.5H7.15C8.65 9.5 10.25 10.7 10.25 12.5V13.75" />            <path d="M11.1 2.6C13.8 2.6 13.8 6.6 11.1 6.6" />            <path d="M12 9.5C13.5 9.75 14.25 11.25 14.25 12.5V13.75" />          </svg>Team</a>        <a class="nav-item" 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">            <path d="M2.5 4.5L4.5 4.5" />            <circle cx="6" cy="4.5" r="1.5" />            <path d="M7.5 4.5L13.5 4.5" />            <path d="M2.5 11.5L8.5 11.5" />            <circle cx="10" cy="11.5" r="1.5" />            <path d="M11.5 11.5L13.5 11.5" />          </svg>Settings</a>      </nav>    </div>    <button type="button" class="btn btn-quiet btn-square btn-sm dialog-close" commandfor="workspace-navigation" command="close" aria-label="Close navigation">      <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="M4 4L12 12" />        <path d="M4 12L12 4" />      </svg>    </button>  </dialog>  <dialog class="dialog dialog-drawer" id="workspace-properties-drawer" closedby="any" aria-labelledby="workspace-properties-drawer-title">    <header class="dialog-header">      <h2 class="dialog-title" id="workspace-properties-drawer-title">Properties</h2>    </header>    <div class="dialog-body" data-properties-away></div>    <button type="button" class="btn btn-quiet btn-square btn-sm dialog-close" commandfor="workspace-properties-drawer" command="close" aria-label="Close properties">      <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="M4 4L12 12" />        <path d="M4 12L12 4" />      </svg>    </button>  </dialog></div>
输入内容并滚动文档:工具栏留在原位。选择平板:属性栏退出布局,可通过按钮将其作为抽屉打开。选择手机:导航也是如此。更改一项属性,再选择另一种宽度,更改仍然保留。
  • 只有一个区域滚动:文档。 主区域为 flex flex-col。其页眉为 shrink(0);编辑器及其外层的容器为 grow(1) min-h(0),因此编辑器的外框正好与剩余空间等高。--editor-max-rows: infinity 取消了文档自身十八行的上限,使其高度由外框决定,editor-document 在外框内滚动。主区域中没有其他内容高于自己的盒子,因此文档的滚动条旁边不会出现第二个滚动条。
  • 工具栏留在原位,是因为它从不滚动。 它是编辑器外框顶部的一条横栏,位于文档上方,而不是滚动内容中的粘性栏。外框较窄时,它会换到第二行。
  • 应用框架低于 64rem 时,补充区域退出布局。 此时才出现一个 Properties 按钮 hidden@container(--5xl),用来打开抽屉 dialog dialog-drawer,抽屉停靠在末端边缘。低于 24rem 时,按钮只保留图形,徽标也为标题让出位置。低于 48rem 时,侧边栏同样退出布局,shell-toggle 在 dialog-drawer-start 中打开导航,与本页的其他应用框架一样。
  • 属性只存在一份。 应用框架上的 ResizeObserver 检查补充区域是否显示,并移动这唯一的一组字段:显示时移入补充区域,不显示时移入抽屉。绑定到同一状态的两组字段,需要为每个字段准备两个 id,并在每次更改时复制一次;只用一组字段,则每个标签、每个 id 和每个值都留在原处。浏览器支持 moveBefore() 时用它移动,因此持有焦点的字段不会失去焦点;不支持时使用 append(),随后由脚本恢复焦点。字段移入已关闭的抽屉时,焦点移到 Properties 按钮。
  • 编辑器从不移动,也从不复制。 在任何宽度下它都留在主区域中,因此文档、选区和历史记录都只在一处。
  • 导航是重复的,而不是移动的。 链接不持有状态,因此抽屉中有同样的列表,并使用自己的标签。

页眉读取同一组字段:它的标题是 Title 字段的值,徽标是 Status。

#无障碍

  • 使用页面地标标记各区域。侧边栏用 <aside> 或 <nav>,主区域用 <main>,页眉用 <header>。为每个 <nav> 提供无障碍名称。使用抽屉时会有两个,两者的名称必须不同。
  • 抽屉与侧边栏包含相同的链接,顺序一致。侧边栏显示时,切换控件处于 display: none 状态,并退出 Tab 键的焦点顺序。
  • 如果可独立滚动的区域内没有可聚焦的元素,为该区域设置 tabindex="0" 并提供无障碍名称,使用户可以用键盘滚动。
  • 在固定布局中,这一栏是通过 aria-labelledby 以标题命名的 <aside>,每个时间都是带有程序可读 datetime 的 <time>。
  • 在工作区中,两个 <aside> 元素都有名称:侧边栏使用 aria-label,属性栏以其标题命名。文档是以页面标题命名的 textbox,工具栏是它之前 Tab 键顺序中的一个停靠点,属性在源码中位于它之后,与阅读顺序一致。属性按钮在 aria-label 中写明“Properties”,因为在最窄的应用框架中它的文字会隐藏。
  • 高度使用 dvh,确保侧边栏底部始终不会被手机浏览器的工具栏遮挡。侧边栏还会根据主屏幕指示条的安全区设置底部内边距。

#类名

类名说明
shell网格框架,高度至少为视口高度,同时是名为 shell 的尺寸查询容器。框架本身不绘制任何装饰。
shell-fixedshell 与视口等大,各区域独立滚动,适用于收件箱、编辑器或聊天界面。与 shell 一同使用
shell-header页头横跨 shell 顶部,采用粘性定位的列从顶部向下偏移 --shell-header,为页头留出空间。
shell-sidebar起始侧的列采用 sticky 定位,高度等于视口剩余空间,并可独立滚动。shell 宽度低于 48rem 时,该列退出布局。
shell-main主区域占据剩余的一列,宽度以该列为限。
shell-aside位于末端的列,和侧栏一样采用粘性定位。shell 宽度低于 64rem 时,该列退出布局。
shell-footer页脚横跨 shell 底部,位于各栏下方和首屏之外
shell-toggle仅在侧栏隐藏时显示的控件,例如将同一套导航以抽屉形式打开的按钮。

#自定义属性

属性默认值说明
--shell-sidebar16rem侧栏宽度
--shell-aside14rem辅助区域的宽度
--shell-header3.5rem为粘性列上方的 shell-header 预留的空间,等于 navbar 的高度

#源码

@master/ui/layouts/shell.css
/* * Shell: the frame of an app. A sidebar stays in place while the main region moves. An optional header * runs across the top, an optional aside stands at the end, and an optional footer closes the frame. * * By default the document scrolls. The sidebar sticks under the header and is exactly as tall as the room * left in the viewport, measured in dvh, with a scroll of its own; a sticky navbar, anchor links and the * browser's scroll restoration keep working because nothing replaces the page's scroll. * `shell-fixed` takes the viewport itself: only the regions scroll, for an inbox, an editor or a chat. * * The shell is a size container. Below 48rem of shell the sidebar leaves the layout and `shell-toggle` * appears: put the same navigation in a drawer that the toggle opens. The aside leaves first, below 64rem. * * A shell draws nothing. Its surfaces and lines come from components and utilities. */@layer components.ui {  .shell {    --shell-sidebar: 16rem;    --shell-aside: 14rem;    --shell-header: 3.5rem;    /* The room a header takes at the top; the sticky regions start under it. */    --shell-top: 0px;    /* The columns' row is at least the viewport under the header, so a footer starts below the fold. */    --shell-room: calc(100vh - var(--shell-top));    display: grid;    grid-template-rows: auto minmax(var(--shell-room), 1fr) auto;    grid-template-columns: auto minmax(0, 1fr) auto;    align-items: start;    min-width: 0;    container: shell / inline-size;    @supports (height: 100dvh) {      --shell-room: calc(100dvh - var(--shell-top));    }    &:has(.shell-header) {      --shell-top: var(--shell-header);    }    /* Fixed: the shell is the viewport. Each region scrolls by itself and the page never moves. */    &.shell-fixed {      grid-template-rows: auto minmax(0, 1fr) auto;      align-items: stretch;      height: 100vh;      height: 100dvh;      overflow: hidden;      .shell-sidebar, .shell-aside {        position: static;        height: auto;        max-height: none;      }      /* The main region scrolls by itself here, so its end keeps clear of the home indicator, as the columns' do. */      .shell-main {        min-height: 0;        padding-block-end: env(safe-area-inset-bottom, 0px);        overflow-y: auto;        overscroll-behavior: contain;      }    }  }  /* The header spans the shell. A navbar is already sticky; any other header stays in the flow. */  .shell-header {    grid-row: 1;    grid-column: 1 / -1;    min-width: 0;  }  /*   * The sidebar and the aside: columns that stay while the page scrolls. Each is as tall as the viewport   * under the header and scrolls by itself, so a long navigation never moves the page.   * The foot keeps clear of the home indicator.   */  .shell-sidebar, .shell-aside {    position: sticky;    inset-block-start: var(--shell-top);    grid-row: 2;    display: flex;    flex-direction: column;    min-width: 0;    height: var(--shell-room);    padding-block-end: env(safe-area-inset-bottom, 0px);    overflow-y: auto;    overscroll-behavior: contain;    scrollbar-width: thin;  }  .shell-sidebar {    grid-column: 1;    width: var(--shell-sidebar);    @container shell (inline-size < 48rem) {      display: none;    }  }  .shell-aside {    grid-column: 3;    width: var(--shell-aside);    @container shell (inline-size < 64rem) {      display: none;    }  }  /* The main region takes the column that is left, and never grows past it. */  .shell-main {    grid-row: 2;    grid-column: 2;    align-self: stretch;    min-width: 0;  }  /* The footer spans the shell under the columns. It comes into view after them. */  .shell-footer {    grid-row: 3;    grid-column: 1 / -1;    min-width: 0;  }  /* A control that exists only while the sidebar is away, such as the button that opens it as a drawer. */  .shell-toggle {    @container shell (inline-size >= 48rem) {      display: none;    }  }}