多步骤任务按顺序收集几项信息:进度指示读者所在的位置,当前只处理一个步骤,步骤中的操作通向下一步或返回上一步。框架是页面框架,因此文档整体滚动,操作按钮位于表单末尾,随表单一起排布。示例分三步创建一个工作区,并把已输入的内容保存在页面自身的内存中。
多步骤任务
<div class="page bg-surface-base fg-text-body text-sm" data-example="multi-step"> <header class="navbar" style="--navbar-padding-x: max(1.5rem, calc(50% - 26rem))"> <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> <a class="btn btn-quiet btn-sm ml-auto shrink(1)" href="#">Save and exit</a> </header> <main class="grow(1) w-full max-w(880) mx-auto px-lg pt-xl pb-2xl container-inline"> <header class="flex flex-col gap-3xs mb-xl"> <h1 class="heading heading-xl">Set up your workspace</h1> <p class="m(0) fg-text-muted">Three steps, about two minutes. Everything here can be changed later in settings.</p> </header> <nav class="mb-xl max-w(560) hidden@container(--3xl)" aria-label="Progress"> <ol class="steps" data-ms-progress="short"> <li class="steps-item basis-auto"> <a class="steps-title link link-quiet" href="#ms-details">Basic details</a> </li> <li class="steps-item basis-auto"> <a class="steps-title link link-quiet" href="#ms-preferences">Preferences</a> </li> <li class="steps-item basis-auto"> <span class="steps-title">Review</span> </li> </ol> </nav> <div class="flex gap-2xl items-start"> <nav class="w(224) shrink(0) sticky top(72) hidden block@container(--3xl)" aria-label="Progress"> <ol class="steps steps-vertical" data-ms-progress> <li class="steps-item"> <span class="steps-body"> <a class="steps-title link link-quiet" href="#ms-details">Basic details</a> <span class="steps-description">Name, address and contact</span> </span> </li> <li class="steps-item"> <span class="steps-body"> <a class="steps-title link link-quiet" href="#ms-preferences">Preferences</a> <span class="steps-description">Alerts and region</span> </span> </li> <li class="steps-item"> <span class="steps-body"> <span class="steps-title">Review</span> <span class="steps-description">Check, then create</span> </span> </li> </ol> </nav> <div class="grow(1) basis(0) min-w(0) max-w(560)"> <div data-ms-task> <form class="form" method="post"> <section id="ms-details" data-ms-step aria-labelledby="ms-details-title"> <div class="form-fields"> <div class="flex flex-col gap-3xs"> <h2 class="heading scroll-mt(72)" id="ms-details-title" tabindex="-1"> <span class="sr-only">Step 1 of 3:</span>Basic details</h2> <p class="m(0) fg-text-muted">What the workspace is called and who answers for it.</p> </div> <div class="field"> <label for="ms-name">Workspace name</label> <input class="input" id="ms-name" name="name" autocomplete="organization" required pattern=".*\S.*" data-error="ms-name-error"> <span class="field-error" id="ms-name-error">Enter a name for the workspace.</span> </div> <div class="field"> <label for="ms-slug">Address</label> <div class="input-group"> <span class="input-group-addon">atlas.dev/</span> <input class="input-group-field" id="ms-slug" name="slug" autocomplete="off" autocapitalize="none" spellcheck="false" pattern="[a-z0-9]+(-[a-z0-9]+)*" required aria-describedby="ms-slug-hint" data-error="ms-slug-error"> </div> <span class="field-hint" id="ms-slug-hint">Lowercase letters, numbers and hyphens.</span> <span class="field-error" id="ms-slug-error">Enter an address in lowercase letters, numbers and hyphens, such as atlas-labs.</span> </div> <div class="field"> <label for="ms-email">Contact email</label> <input class="input" id="ms-email" type="email" name="email" autocomplete="email" placeholder="you@company.com" required data-error="ms-email-error"> <span class="field-error" id="ms-email-error">Enter an email address, such as you@company.com.</span> </div> </div> </section> <section id="ms-preferences" data-ms-step aria-labelledby="ms-preferences-title"> <div class="form-fields"> <div class="flex flex-col gap-3xs"> <h2 class="heading scroll-mt(72)" id="ms-preferences-title" tabindex="-1"> <span class="sr-only">Step 2 of 3:</span>Preferences</h2> <p class="m(0) fg-text-muted">How Atlas reaches you, and where it builds.</p> </div> <fieldset class="fieldset gap-sm"> <legend class="fieldset-legend">Where should deployment alerts go?</legend> <div class="auto-grid auto-grid-fit gap-sm" style="--auto-grid-min: 11rem"> <label class="choice"> <input type="radio" class="radio" name="alerts" value="email" checked> <span class="choice-body"> <span class="choice-title">Email</span> <span class="choice-description">To the contact address, as each deployment fails.</span> </span> </label> <label class="choice"> <input type="radio" class="radio" name="alerts" value="phone"> <span class="choice-body"> <span class="choice-title">Phone</span> <span class="choice-description">A text message, for production only.</span> </span> </label> <label class="choice"> <input type="radio" class="radio" name="alerts" value="none"> <span class="choice-body"> <span class="choice-title">None</span> <span class="choice-description">Nothing is sent. Failures show in the dashboard.</span> </span> </label> </div> </fieldset> <div data-ms-phone> <div class="field"> <label for="ms-phone">Phone number</label> <input class="input" id="ms-phone" type="tel" name="phone" autocomplete="tel" pattern="\+?[0-9][0-9 \-]{6,}" aria-describedby="ms-phone-hint" data-error="ms-phone-error"> <span class="field-hint" id="ms-phone-hint">Needed only when alerts go to a phone. Include the country code.</span> <span class="field-error" id="ms-phone-error">Enter a phone number with its country code, such as +886 912 345 678.</span> </div> </div> <div class="field"> <label for="ms-region">Default region</label> <select class="select" id="ms-region" name="region" aria-describedby="ms-region-hint"> <option class="select-option" value="Tokyo (hnd1)">Tokyo (hnd1)</option> <option class="select-option" value="Singapore (sin1)">Singapore (sin1)</option> <option class="select-option" value="Frankfurt (fra1)">Frankfurt (fra1)</option> <option class="select-option" value="Washington, D.C. (iad1)">Washington, D.C. (iad1)</option> </select> <span class="field-hint" id="ms-region-hint">Where new projects are built and served.</span> </div> </div> </section> <section id="ms-review" data-ms-step data-ms-review aria-labelledby="ms-review-title" hidden> <div class="form-fields"> <div class="flex flex-col gap-3xs"> <h2 class="heading scroll-mt(72)" id="ms-review-title" tabindex="-1"> <span class="sr-only">Step 3 of 3:</span>Review</h2> <p class="m(0) fg-text-muted">Check what you entered, then create the workspace.</p> </div> <div class="flex flex-col gap-2xs"> <div class="flex items-center justify-between gap-sm"> <h3 class="heading heading-xs">Basic details</h3> <button type="button" class="btn btn-quiet btn-sm btn-hang-end" data-ms-edit="0">Edit <span class="sr-only">basic details</span> </button> </div> <dl class="data-list"> <div class="data-list-item"> <dt class="data-list-term min-w(128)">Workspace name</dt> <dd class="data-list-value" data-ms-value="name"></dd> </div> <div class="data-list-item"> <dt class="data-list-term">Address</dt> <dd class="data-list-value" data-ms-value="address"></dd> </div> <div class="data-list-item"> <dt class="data-list-term">Contact email</dt> <dd class="data-list-value" data-ms-value="email"></dd> </div> </dl> </div> <div class="flex flex-col gap-2xs"> <div class="flex items-center justify-between gap-sm"> <h3 class="heading heading-xs">Preferences</h3> <button type="button" class="btn btn-quiet btn-sm btn-hang-end" data-ms-edit="1">Edit <span class="sr-only">preferences</span> </button> </div> <dl class="data-list"> <div class="data-list-item"> <dt class="data-list-term min-w(128)">Deployment alerts</dt> <dd class="data-list-value" data-ms-value="alerts"></dd> </div> <div class="data-list-item"> <dt class="data-list-term">Default region</dt> <dd class="data-list-value" data-ms-value="region"></dd> </div> </dl> </div> </div> </section> <div class="form-actions"> <button type="button" class="btn hidden" data-ms-back>Back</button> <button class="btn btn-primary" data-ms-next>Create workspace</button> </div> </form> </div> <div data-ms-done hidden> <div class="flex flex-col items-start gap-md"> <span class="icon-frame icon-frame-success" aria-hidden="true"> <svg class="icon" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M3.5 10L7.8545 14.3545A0.2 0.2 0 0 0 8.1413 14.3504L16.5 5.5" /> </svg> </span> <div class="flex flex-col gap-3xs"> <h2 class="heading scroll-mt(72)" tabindex="-1" data-ms-done-title>Workspace created</h2> <p class="m(0) fg-text-muted"> <span class="fg-text-strong" data-ms-value="name"></span>is ready at <span class="fg-text-strong" data-ms-value="address"></span>. This example keeps what you typed in memory only: nothing was sent.</p> </div> <button type="button" class="btn" data-ms-restart>Start over</button> </div> </div> </div> </div> </main></div>/** * A workspace set up in three steps, with nowhere to send it. The markup is one whole form in order, which is * what a browser without this module shows. The module divides it: it shows one step at a time, moves * aria-current along the progress, checks the step in hand before going on, and at the end swaps the form * for the result. What was typed stays in the fields, and where the reader is stays in `state`; nothing is * stored and nothing leaves the page. In a product each step is a route and the server keeps the draft. * Returns the function that stops it and puts the whole form back. */export function mount(root) { const controller = new AbortController() const { signal } = controller const task = root.querySelector('[data-ms-task]') const form = task.querySelector('.form') const steps = [...form.querySelectorAll('[data-ms-step]')] const review = form.querySelector('[data-ms-review]') const back = form.querySelector('[data-ms-back]') const next = form.querySelector('[data-ms-next]') const done = root.querySelector('[data-ms-done]') const phone = form.querySelector('[data-ms-phone]') // The same three steps twice: the vertical list of a wide page and the short row of a narrow one. const lists = [...root.querySelectorAll('[data-ms-progress]')].map(list => ({ list, short: list.dataset.msProgress === 'short', items: [...list.querySelectorAll('.steps-item')] })) const last = steps.length - 1 const submitLabel = next.textContent // Where the reader is, the furthest step they have reached, and whether the task is finished. const state = { step: 0, reached: 0, done: false } /** * A step's name in the progress is a link while the step can be opened and plain words while it cannot, as * the steps component asks: the element is replaced only when that changes. */ const name = (item, index, open) => { const old = item.querySelector('.steps-title') if ((old.localName === 'a') === open) return old const title = document.createElement(open ? 'a' : 'span') title.className = open ? 'steps-title link link-quiet' : 'steps-title' title.textContent = old.textContent if (open) title.href = `#${steps[index].id}` old.replaceWith(title) return title } const headingOf = (step) => steps[step].querySelector('.heading') const controlsOf = (step) => [...steps[step].querySelectorAll('input, select, textarea')].filter(control => control.willValidate) /** * A field's error is read with the field only while it shows: its id joins aria-describedby, after the hint, * while the field is marked or the browser reports it, and leaves when the value is valid again. */ const describe = (control) => { if (!control.dataset?.error) return const invalid = !control.validity.valid && (control.getAttribute('aria-invalid') === 'true' || control.matches(':user-invalid')) if (control.validity.valid) control.removeAttribute('aria-invalid') const ids = (control.getAttribute('aria-describedby') ?? '').split(' ').filter(id => id && id !== control.dataset.error) if (invalid) ids.push(control.dataset.error) if (ids.length) control.setAttribute('aria-describedby', ids.join(' ')) else control.removeAttribute('aria-describedby') } /** * The browser holds the rules (required, type, pattern) and shows a field's error once the reader has edited * it. A field never touched has to be marked here, with aria-invalid, when Next is pressed: a submit would mark * every field of the form as tried, the ones in steps not reached yet among them. Focus goes to the first. */ const check = (step) => { const invalid = controlsOf(step).filter(control => !control.validity.valid) for (const control of invalid) { control.setAttribute('aria-invalid', 'true') describe(control) } if (!invalid.length) return true if (state.step !== step) { state.step = step render() } invalid[0].focus() return false } // The phone number is asked for, and required, only while alerts go to a phone. const askPhone = () => { const field = phone.querySelector('.input') const wanted = form.elements.alerts.value === 'phone' phone.hidden = !wanted field.disabled = !wanted field.required = wanted if (!wanted) field.removeAttribute('aria-invalid') // An error that no longer shows is no longer read with the field when it comes back. describe(field) } const values = () => { const written = new FormData(form) const text = (name) => String(written.get(name) ?? '').trim() const alerts = { email: `Email to ${text('email')}`, phone: `Text message to ${text('phone')}`, none: 'None' } return { name: text('name'), address: `atlas.dev/${text('slug')}`, email: text('email'), alerts: alerts[text('alerts')], region: text('region') } } const render = () => { task.hidden = state.done done.hidden = !state.done steps.forEach((step, index) => { step.hidden = index !== state.step }) // A button's own display outranks the hidden attribute, so Back leaves with the utility of that name. back.classList.toggle('hidden', state.step === 0) next.textContent = state.step === last ? submitLabel : 'Next' for (const { list, short, items } of lists) { list.classList.toggle('steps-complete', state.done) items.forEach((item, index) => { const current = !state.done && index === state.step // A step already reached is a link back to it; the current one and the ones ahead are plain words. const open = !state.done && !current && index <= state.reached if (current) item.setAttribute('aria-current', 'step') else item.removeAttribute('aria-current') // In the short row the other steps' names are not drawn, and a link nobody can see is not one to tab to or // to tap: there a step already reached is words, and Back is the way to it. const title = name(item, index, open && !short) // The short row shows the current step's name; the others keep theirs for assistive technology. if (short) title.classList.toggle('sr-only', !current) }) } // What was typed is set as text, never as markup. if (state.done || state.step === last) { const written = values() for (const slot of root.querySelectorAll('[data-ms-value]')) slot.textContent = written[slot.dataset.msValue] } } /** * Going on checks every step passed on the way and stops at the first that fails. Going back checks nothing: * a reader may leave a step half written and find it as they left it. */ const go = (target) => { for (let step = state.step; step < target; step++) if (!check(step)) return state.step = target state.reached = Math.max(state.reached, target) render() headingOf(target).focus() } const advance = () => { if (state.step < last) return go(state.step + 1) for (let step = 0; step < last; step++) if (!check(step)) return state.done = true render() done.querySelector('[data-ms-done-title]').focus() } next.addEventListener('click', advance, { signal }) back.addEventListener('click', () => go(state.step - 1), { signal }) // Next is not a submit button, so Enter in a field is given the same meaning here. form.addEventListener('keydown', (event) => { if (event.key !== 'Enter' || event.isComposing || !event.target.matches('input')) return event.preventDefault() advance() }, { signal }) form.addEventListener('submit', event => event.preventDefault(), { signal }) for (const type of ['input', 'change', 'focusout']) { form.addEventListener(type, event => describe(event.target), { signal }) } form.addEventListener('change', (event) => { if (event.target.name === 'alerts') askPhone() }, { signal }) // A step already reached is opened from the progress, and from Edit in the review. for (const { list, items } of lists) { list.addEventListener('click', (event) => { const title = event.target.closest('a.steps-title') if (!title) return event.preventDefault() go(items.indexOf(title.closest('.steps-item'))) }, { signal }) } for (const edit of form.querySelectorAll('[data-ms-edit]')) { edit.addEventListener('click', () => go(Number(edit.dataset.msEdit)), { signal }) } const clear = () => { form.reset() for (const control of form.querySelectorAll('[data-error]')) { control.removeAttribute('aria-invalid') describe(control) } Object.assign(state, { step: 0, reached: 0, done: false }) } root.querySelector('[data-ms-restart]').addEventListener('click', () => { clear() askPhone() render() headingOf(0).focus() }, { signal }) next.type = 'button' askPhone() render() return () => { controller.abort() clear() // The whole form again, in order, as the markup has it. task.hidden = false done.hidden = true steps.forEach((step) => { step.hidden = step === review }) back.classList.add('hidden') next.type = 'submit' next.textContent = submitLabel phone.hidden = false phone.querySelector('.input').disabled = false phone.querySelector('.input').required = false for (const { list, items } of lists) { list.classList.remove('steps-complete') items.forEach((item, index) => { item.removeAttribute('aria-current') // The review holds no field, so the whole form has nothing to link its step to. name(item, index, steps[index] !== review).classList.remove('sr-only') }) } }}留空一个字段并按 Next,然后填完这一步并继续。按 Back:之前输入的内容仍在。在第二步选择 Phone。在平板和手机宽度下,进度是表单上方的一行。
#实现方式
- 带任务页眉的页面框架。 导航栏中只有品牌和一个出口:低调的“Save and exit”,通过
ml-auto推到最末端。任务没有主导航:其他任何链接都可能让读者丢失已完成的工作。 - 任务共用一个内容宽度。 主区域为
max-w(880) mx-auto px-lg,同时是尺寸容器container-inline。这样可用宽度为 832px:w(224)的进度列、48px 的gap-2xl,以及max-w(560)的表单,这是单列字段易于阅读的宽度。 - 用步骤条显示进度。 只有当前项带有
aria-current="step";样式表把它之前的步骤绘制为已完成,之后的步骤绘制为待完成。可以打开的步骤,其名称是低调的链接,其他步骤的名称是纯文字。 - 整个任务使用一个表单。 每个步骤是一个以标题命名的
<section>,字段放在form-fields中,因此保持表单 1.25rem 的间距。第二步的选项采用选择卡片区块:一个以问题为 legend 的<fieldset>,以及由选项卡片组成的自动网格,在表单列中每行三个,在手机上逐个纵向排列。 form-actions位于表单末尾。 在源码中,Back 在前,确认按钮在后。表单宽度低于 24rem 时(手机即属此列),它们以全宽纵向堆叠,确认按钮在前。没有任何内容固定在视口底部:键盘弹出后,固定在那里的操作栏会遮住上方的字段。- 复核部分为每个步骤提供一个数据列表,位于步骤名称和用于打开该步骤的 Edit 按钮下方。按钮采用低调样式并带有
btn-hang-end,使其文字的末端与各项值所到的边缘对齐。
#各宽度下的进度
页面中有两份进度,只显示其中一份。
- 主区域达到 48rem 时,它是表单旁边的
steps steps-vertical列表:每个步骤都有名称和一行说明,写明这一步要填什么。列表为sticky top(72),位于 56px 的导航栏下方 16px 处,因此较长的步骤滚动时,它始终可见。 - 低于 48rem 时,它是表单上方的一行
steps。这一行只显示当前步骤的名称;另外两个步骤的名称为sr-only,因此位置由标记和连线表示,每个名称仍会被读出。
这一行带有 hidden@container(--3xl),这一列带有 hidden block@container(--3xl)。未显示的那一份为 display: none,因此辅助技术和键盘只会遇到一份进度。
显示全部三个名称的一行步骤在手机上放不下:组件会用省略号截断放不下的名称。只显示一个名称时,这一行在 390px 宽度下可以完整显示。行中的每一项都是 basis-auto,因此当前步骤占据其名称所需的空间,另外两个步骤平分剩余空间。在文字放大到两倍的手机上,连这一个名称也会被截断;行下方的标题会完整显示它。
#脚本决定的内容
标记是按顺序排列的完整表单:两个步骤的字段,然后是一个提交按钮。把它划分成步骤的是示例的模块;模块很短,因为大部分工作由浏览器和样式表完成。
- 规则由浏览器掌握。
required、type="email"和pattern定义了什么是有效值,模块只读取validity.valid。每个字段的错误信息都在field-error中,输入框的样式表在字段无效时显示它,有效后再次隐藏。 - 读者编辑过字段后,
:user-invalid才显示错误。 这不需要脚本。从未碰过的字段则是另一回事:Next 会在当前步骤中每个未通过校验的字段上设置aria-invalid="true",绘制出相同的状态,并在各字段的值变为有效时将其移除。 - Next 是普通按钮,不是提交按钮。 一次提交尝试会把表单中的每个字段都标记为已尝试,包括尚未到达的步骤中的字段,这些字段一打开就会处于错误状态。因此模块自行校验当前步骤,并让在字段中按 Enter 与按 Next 效果相同。
- 焦点跟随读者。 步骤未通过校验时,焦点移到其中第一个无效字段。步骤切换时,焦点移到新步骤的标题,标题说明了步骤及其位置:“Step 2 of 3: Preferences”。
- 返回时不做任何校验。 Back、进度中的步骤名称和复核部分的 Edit 都让当前步骤保持原样,哪怕只填了一半;每个字段都保留其值,因为它从未离开文档。前进时会依次校验途经的每个步骤,并停在第一个未通过的步骤。尚未到达的步骤不是链接,因此无法跳转过去。
- 取决于某个回答的字段。 只有提醒发送到手机时,电话号码字段才会显示,并且必填。隐藏期间它处于
disabled状态,因此既不校验,也不提交。
在产品中,其中大部分工作属于路由器和服务器:
- 每个步骤一个路由,例如
/setup/details和/setup/preferences。这样每个步骤都是独立的表单,Next 是它的提交按钮,浏览器的后退和重新加载都符合读者的预期。进度中的链接是指向这些路由的真实链接。 - 服务器会再次校验每个步骤,并返回它发现的错误。用同样的方式显示这些错误:在字段上设置
aria-invalid="true",并把信息放入其field-error。 - 草稿由服务器保存。 每次按 Next 都会保存该步骤的内容,“Save and exit”保存后离开,复核部分则从草稿而不是字段读回内容。已到达的最远步骤是草稿的一部分,服务器会拒绝超出它的路由。
#何时使用
顺序重要时使用分步:后面的步骤取决于前面的回答,或者全部内容一次呈现会让人难以消化。三到五步比较合适;步骤更多时,考虑其中一些能否留到任务完成之后。
- 各组设置相互独立,读者会回来修改其中一组时,使用设置页。它的导航让读者能以任意顺序打开任意一组。
- 所有内容能放在一屏内时,使用单个表单。分步会让读者失去全局视图,每个部分还要多按一次。
- 只有一项简短的任务,前后没有其他步骤时(例如登录),使用居中布局。
#无障碍
- 页面地标包括页眉、主区域和一个名为“Progress”的导航。当前步骤是以标题命名的
<section>。 - 进度是一个
<ol>,因此列表会报出步骤总数,当前步骤带有aria-current="step"。在较短的那一行中,未显示的名称仍在列表中。 - 步骤切换后,焦点位于其标题上;标题带有
tabindex="-1"和scroll-mt(72),不会被粘性导航栏遮住。屏幕阅读器从这里读出步骤的位置和名称,按 Tab 可前往其第一个字段。 - 步骤未通过校验时,焦点位于第一个无效字段。字段的
field-error显示期间会加入其aria-describedby,因此信息会随标签一起读出。 - 结束时,焦点移到结果的标题;“Start over”清空字段并回到第一步的标题。
- 没有脚本时,页面是一个长表单:两个步骤的字段都在标记中,且都没有
hidden;电话号码字段会说明何时需要填写;按钮一次提交全部内容。只有不含字段的 Back、复核部分和结果在开始时隐藏。
#相关内容
- 步骤条用编号列表标出短流程中的当前步骤,例如结账或设置流程。
- 表单表单的行、分区和操作区随栏宽重排。
- 输入框嵌入表面的输入框,支持标签、提示、错误信息和输入框组。
- 选项卡片使用单选按钮或复选框的选项卡片,留有足够空间说明选项。
- 单选按钮用小圆形凹槽表示选项,供用户从多项中选择一项,基于原生单选按钮。
- 下拉选择框原生下拉选择框,选项列表与控件使用同一套材质。
- 自动网格根据可用宽度自动安排尽可能多的等宽列。
- 数据列表用名称和值逐项展示一个对象的信息,以细线分隔,例如一次部署、一个订单或一份个人资料。
- 导航栏位于页面顶部,内容滚过栏下方时呈现磨砂玻璃背景。
- 按钮凸起的控件,悬停时抬升,按下时下沉。
- 链接正文中的跳转文字,沿用所在句子的前景色。
- 标题沿用页面文本色的标题,可搭配上方的引题和下方的导语。
- 图标框标题旁的小型凹面图标框,让图标保持原有尺寸。