탐색

v2.1.0
폼

입력 필드

표면을 파낸 듯한 텍스트 입력 필드와 레이블, 힌트, 오류, 입력 그룹.

이 페이지의 내용

텍스트 입력 필드는 표면을 파낸 듯한 오목한 영역으로, 0.5px 두께의 윤곽선으로 둘러싸입니다. 포커스를 받으면 주변 표면과 같은 높이로 올라오고, 전경색 윤곽선 하나와 은은한 후광이 나타납니다. <input>과 <textarea>에는 .input을, 필드를 감싸는 <label>에는 .field를 사용하세요.

입력 필드

<label class="field">  Email <input class="input" type="email" autocomplete="email" placeholder="you@example.com"></label>
<label className="field">  Email <input className="input" type="email" autoComplete="email" placeholder="you@example.com" /></label>
<label class="field">  Email <input class="input" type="email" autocomplete="email" placeholder="you@example.com"></label>
<template>  <label class="field">    Email <input class="input" type="email" autocomplete="email" placeholder="you@example.com">  </label></template>

#힌트와 오류

aria-describedby로 힌트나 오류를 해당 필드에 연결하고, 유효하지 않은 값은 aria-invalid="true"로 표시하세요. field-error는 필드가 유효하지 않을 때만 힌트 대신 표시되므로, 처음부터 둘 다 마크업에 넣어 둘 수 있습니다.

힌트와 오류

<div class="field">  <label for="project-name">Project name</label>  <input class="input" id="project-name" value="atlas" aria-describedby="name-hint">  <span class="field-hint" id="name-hint">Lowercase letters, numbers and dashes.</span></div><div class="field">  <label for="project-domain">Domain</label>  <input class="input" id="project-domain" value="atlas" aria-invalid="true" aria-describedby="domain-error">  <span class="field-error" id="domain-error">Enter a full domain, such as atlas.dev.</span></div>
<>  <div className="field">    <label htmlFor="project-name">Project name</label>    <input className="input" id="project-name" defaultValue="atlas" aria-describedby="name-hint" />    <span className="field-hint" id="name-hint">Lowercase letters, numbers and dashes.</span>  </div>  <div className="field">    <label htmlFor="project-domain">Domain</label>    <input className="input" id="project-domain" defaultValue="atlas" aria-invalid="true" aria-describedby="domain-error" />    <span className="field-error" id="domain-error">Enter a full domain, such as atlas.dev.</span>  </div></>
<div class="field">  <label for="project-name">Project name</label>  <input class="input" id="project-name" value="atlas" aria-describedby="name-hint">  <span class="field-hint" id="name-hint">Lowercase letters, numbers and dashes.</span></div><div class="field">  <label for="project-domain">Domain</label>  <input class="input" id="project-domain" value="atlas" aria-invalid="true" aria-describedby="domain-error">  <span class="field-error" id="domain-error">Enter a full domain, such as atlas.dev.</span></div>
<template>  <div class="field">    <label for="project-name">Project name</label>    <input class="input" id="project-name" value="atlas" aria-describedby="name-hint">    <span class="field-hint" id="name-hint">Lowercase letters, numbers and dashes.</span>  </div>  <div class="field">    <label for="project-domain">Domain</label>    <input class="input" id="project-domain" value="atlas" aria-invalid="true" aria-describedby="domain-error">    <span class="field-error" id="domain-error">Enter a full domain, such as atlas.dev.</span>  </div></template>

#브라우저 기본 유효성 검사

스크립트 없이도 브라우저 자체의 제약 조건에 따라 같은 상태가 표시됩니다. required, type, pattern 중 하나가 지정된 필드에는 :user-invalid를 통해 오류 윤곽선이 표시됩니다. 이 선택자는 사용자가 필드를 편집하거나 폼 제출을 시도한 뒤에만 유효하지 않은 필드에 적용되며, 폼을 처음 열었을 때는 적용되지 않습니다. 이때 field-error도 함께 표시됩니다.

브라우저 기본 유효성 검사

<form class="flex flex-col gap-md">  <div class="field">    <label for="work-email">Work email</label>    <input class="input" id="work-email" type="email" autocomplete="work email" required placeholder="you@company.com" aria-describedby="work-email-hint work-email-error">    <span class="field-hint" id="work-email-hint">      Type something that is not an email, then leave the field.    </span>    <span class="field-error" id="work-email-error">      Enter an email address, such as ada@example.com.    </span>  </div>  <button type="submit" class="btn btn-primary self-start">Continue</button></form>
<form className="flex flex-col gap-md">  <div className="field">    <label htmlFor="work-email">Work email</label>    <input className="input" id="work-email" type="email" autoComplete="work email" required placeholder="you@company.com" aria-describedby="work-email-hint work-email-error" />    <span className="field-hint" id="work-email-hint">      Type something that is not an email, then leave the field.    </span>    <span className="field-error" id="work-email-error">      Enter an email address, such as ada@example.com.    </span>  </div>  <button type="submit" className="btn btn-primary self-start">Continue</button></form>
<form class="flex flex-col gap-md">  <div class="field">    <label for="work-email">Work email</label>    <input class="input" id="work-email" type="email" autocomplete="work email" required placeholder="you@company.com" aria-describedby="work-email-hint work-email-error">    <span class="field-hint" id="work-email-hint">      Type something that is not an email, then leave the field.    </span>    <span class="field-error" id="work-email-error">      Enter an email address, such as ada@example.com.    </span>  </div>  <button type="submit" class="btn btn-primary self-start">Continue</button></form>
<template>  <form class="flex flex-col gap-md">    <div class="field">      <label for="work-email">Work email</label>      <input class="input" id="work-email" type="email" autocomplete="work email" required placeholder="you@company.com" aria-describedby="work-email-hint work-email-error">      <span class="field-hint" id="work-email-hint">        Type something that is not an email, then leave the field.      </span>      <span class="field-error" id="work-email-error">        Enter an email address, such as ada@example.com.      </span>    </div>    <button type="submit" class="btn btn-primary self-start">Continue</button>  </form></template>

#크기

필드 높이는 32px, 38px, 44px입니다. 버튼, 선택 상자, 세그먼트 컨트롤도 같은 높이를 사용하므로 같은 크기끼리 한 줄에 놓으면 마우스를 쓰든 손가락을 쓰든 높이 차이 없이 나란히 정렬됩니다. 터치 화면에서도 필드는 높이와 글자 크기를 유지하며, 포커스를 받을 때 iOS가 페이지를 확대하지 않도록 페이지의 뷰포트에서 막습니다.

크기

<input class="input input-sm" placeholder="Small" aria-label="Small"><input class="input" placeholder="Medium" aria-label="Medium"><input class="input input-lg" placeholder="Large" aria-label="Large">
<>  <input className="input input-sm" placeholder="Small" aria-label="Small" />  <input className="input" placeholder="Medium" aria-label="Medium" />  <input className="input input-lg" placeholder="Large" aria-label="Large" /></>
<input class="input input-sm" placeholder="Small" aria-label="Small"><input class="input" placeholder="Medium" aria-label="Medium"><input class="input input-lg" placeholder="Large" aria-label="Large">
<template>  <input class="input input-sm" placeholder="Small" aria-label="Small">  <input class="input" placeholder="Medium" aria-label="Medium">  <input class="input input-lg" placeholder="Large" aria-label="Large"></template>

#여러 줄 입력

.input을 지정한 <textarea>는 지정한 줄 수와 세로 크기 조절 손잡이를 유지합니다. 내용에 맞춰 높이가 늘어나게 하려면 input-auto를 추가하세요. field-sizing: content는 높이를 3줄에서 최대 12줄까지 조절하며, 그 이상은 스크롤로 볼 수 있습니다. 범위를 바꾸려면 --input-rows와 --input-max-rows를 설정하세요. field-sizing을 지원하지 않는 브라우저에서는 최소 높이와 손잡이가 유지됩니다.

여러 줄 입력

<label class="field">  Message <textarea class="input" rows="3" placeholder="A fixed height with a resize handle"></textarea></label><label class="field">  Notes <textarea class="input input-auto" placeholder="Keep typing: this one grows with its content"></textarea></label>
<>  <label className="field">    Message <textarea className="input" rows={3} placeholder="A fixed height with a resize handle">{``}</textarea>  </label>  <label className="field">    Notes <textarea className="input input-auto" placeholder="Keep typing: this one grows with its content">{``}</textarea>  </label></>
<label class="field">  Message <textarea class="input" rows="3" placeholder="A fixed height with a resize handle"></textarea></label><label class="field">  Notes <textarea class="input input-auto" placeholder="Keep typing: this one grows with its content"></textarea></label>
<template>  <label class="field">    Message <textarea class="input" rows="3" placeholder="A fixed height with a resize handle"></textarea>  </label>  <label class="field">    Notes <textarea class="input input-auto" placeholder="Keep typing: this one grows with its content"></textarea>  </label></template>

#입력 그룹

input-group은 별도 스타일이 없는 필드와 그에 딸린 아이콘, 단위, 단축키 또는 버튼을 하나의 오목한 영역으로 감쌉니다. 그룹은 :has()를 통해 내부 필드의 호버, 포커스, 유효하지 않음, 비활성화 상태를 표시합니다. input-group-field는 입력 요소 자체의 의미론과 텍스트 커서를 유지합니다. 오목한 영역 어디를 눌러도 필드에 포커스가 가도록 그룹을 <label>로 만드세요.

입력 그룹

<label class="input-group">  <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>  <input class="input-group-field" type="search" placeholder="Search projects" aria-label="Search projects">  <kbd class="kbd">⌘K</kbd></label><label class="input-group">  <span class="input-group-addon">https://</span>  <input class="input-group-field" value="atlas" aria-label="Subdomain">  <span class="input-group-addon">.master.co</span></label><label class="input-group">  <input class="input-group-field" type="number" value="24" aria-label="Timeout">  <span class="input-group-addon">seconds</span></label>
import SearchIcon from '@master/icons-react/native/16/soft/search'<>  <label className="input-group">    <SearchIcon className="icon" />    <input className="input-group-field" type="search" placeholder="Search projects" aria-label="Search projects" />    <kbd className="kbd">⌘K</kbd>  </label>  <label className="input-group">    <span className="input-group-addon">https://</span>    <input className="input-group-field" defaultValue="atlas" aria-label="Subdomain" />    <span className="input-group-addon">.master.co</span>  </label>  <label className="input-group">    <input className="input-group-field" type="number" defaultValue="24" aria-label="Timeout" />    <span className="input-group-addon">seconds</span>  </label></>
<script>  import SearchIcon from '@master/icons-svelte/native/16/soft/search'</script><label class="input-group">  <SearchIcon class="icon" />  <input class="input-group-field" type="search" placeholder="Search projects" aria-label="Search projects">  <kbd class="kbd">⌘K</kbd></label><label class="input-group">  <span class="input-group-addon">https://</span>  <input class="input-group-field" value="atlas" aria-label="Subdomain">  <span class="input-group-addon">.master.co</span></label><label class="input-group">  <input class="input-group-field" type="number" value="24" aria-label="Timeout">  <span class="input-group-addon">seconds</span></label>
<script setup>import SearchIcon from '@master/icons-vue/native/16/soft/search'</script><template>  <label class="input-group">    <SearchIcon class="icon" />    <input class="input-group-field" type="search" placeholder="Search projects" aria-label="Search projects">    <kbd class="kbd">⌘K</kbd>  </label>  <label class="input-group">    <span class="input-group-addon">https://</span>    <input class="input-group-field" value="atlas" aria-label="Subdomain">    <span class="input-group-addon">.master.co</span>  </label>  <label class="input-group">    <input class="input-group-field" type="number" value="24" aria-label="Timeout">    <span class="input-group-addon">seconds</span>  </label></template>

그룹 안의 버튼은 오목한 영역의 가장자리에서 4px 안쪽에 놓이고, 모서리 반경은 오목한 영역의 모서리 반경보다 4px 작습니다. 따라서 어느 크기에서든 두 모서리의 중심이 일치합니다. 그룹에 버튼이 들어갈 때는 그룹에 <div>를 사용하세요.

버튼이 있는 입력 그룹

<form class="input-group">  <input class="input-group-field" type="email" autocomplete="email" placeholder="you@example.com" aria-label="Email">  <button type="submit" class="btn btn-primary">Subscribe</button></form><div class="input-group input-group-sm">  <input class="input-group-field" value="https://atlas.dev/p/9f2c" readonly aria-label="Share link">  <button type="button" class="btn">Copy</button></div>
<>  <form className="input-group">    <input className="input-group-field" type="email" autoComplete="email" placeholder="you@example.com" aria-label="Email" />    <button type="submit" className="btn btn-primary">Subscribe</button>  </form>  <div className="input-group input-group-sm">    <input className="input-group-field" defaultValue="https://atlas.dev/p/9f2c" readOnly aria-label="Share link" />    <button type="button" className="btn">Copy</button>  </div></>
<form class="input-group">  <input class="input-group-field" type="email" autocomplete="email" placeholder="you@example.com" aria-label="Email">  <button type="submit" class="btn btn-primary">Subscribe</button></form><div class="input-group input-group-sm">  <input class="input-group-field" value="https://atlas.dev/p/9f2c" readonly aria-label="Share link">  <button type="button" class="btn">Copy</button></div>
<template>  <form class="input-group">    <input class="input-group-field" type="email" autocomplete="email" placeholder="you@example.com" aria-label="Email">    <button type="submit" class="btn btn-primary">Subscribe</button>  </form>  <div class="input-group input-group-sm">    <input class="input-group-field" value="https://atlas.dev/p/9f2c" readonly aria-label="Share link">    <button type="button" class="btn">Copy</button>  </div></template>

필드와 버튼을 분리해 배치하려면 <form class="flex gap-xs">로 플렉스 행에 넣으세요.

#여러 값 입력

input-group-wrap을 사용하면 그룹에서 수신자, 태그, 필터처럼 여러 값을 입력받을 수 있습니다. 각 값은 오목한 영역 안에 칩으로 표시되고, 필드는 마지막 줄의 남은 공간을 차지합니다. 값을 더 배치할 공간이 마지막 줄에 부족하면 영역이 한 줄 늘어납니다. 칩은 영역의 가장자리에서 6px 안쪽에 놓이며, 칩과 영역의 둥근 모서리는 중심이 일치합니다.

값의 배치는 스타일시트가 처리합니다. 태그 입력은 Enter로 값을 추가하며, 빈 필드에서 Backspace를 누르면 마지막 값으로 이동하고 한 번 더 누르면 그 값을 제거합니다. 여러 값을 선택하는 콤보박스는 목록에서 값을 고릅니다.

여러 값 입력

<div class="field max-w(420) mx-auto">  <label for="input-teams">Teams</label>  <div class="input-group input-group-wrap">    <span class="chip">      Design<button type="button" class="chip-remove" aria-label="Remove Design">        <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>    </span>    <span class="chip">      Research<button type="button" class="chip-remove" aria-label="Remove Research">        <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>    </span>    <span class="chip">      Engineering<button type="button" class="chip-remove" aria-label="Remove Engineering">        <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>    </span>    <span class="chip">      Operations<button type="button" class="chip-remove" aria-label="Remove Operations">        <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>    </span>    <input class="input-group-field" id="input-teams" placeholder="Add a team">  </div></div>
import XIcon from '@master/icons-react/native/16/soft/x'<div className="field max-w(420) mx-auto">  <label htmlFor="input-teams">Teams</label>  <div className="input-group input-group-wrap">    <span className="chip">      Design<button type="button" className="chip-remove" aria-label="Remove Design">        <XIcon className="icon" />      </button>    </span>    <span className="chip">      Research<button type="button" className="chip-remove" aria-label="Remove Research">        <XIcon className="icon" />      </button>    </span>    <span className="chip">      Engineering<button type="button" className="chip-remove" aria-label="Remove Engineering">        <XIcon className="icon" />      </button>    </span>    <span className="chip">      Operations<button type="button" className="chip-remove" aria-label="Remove Operations">        <XIcon className="icon" />      </button>    </span>    <input className="input-group-field" id="input-teams" placeholder="Add a team" />  </div></div>
<script>  import XIcon from '@master/icons-svelte/native/16/soft/x'</script><div class="field max-w(420) mx-auto">  <label for="input-teams">Teams</label>  <div class="input-group input-group-wrap">    <span class="chip">      Design<button type="button" class="chip-remove" aria-label="Remove Design">        <XIcon class="icon" />      </button>    </span>    <span class="chip">      Research<button type="button" class="chip-remove" aria-label="Remove Research">        <XIcon class="icon" />      </button>    </span>    <span class="chip">      Engineering<button type="button" class="chip-remove" aria-label="Remove Engineering">        <XIcon class="icon" />      </button>    </span>    <span class="chip">      Operations<button type="button" class="chip-remove" aria-label="Remove Operations">        <XIcon class="icon" />      </button>    </span>    <input class="input-group-field" id="input-teams" placeholder="Add a team">  </div></div>
<script setup>import XIcon from '@master/icons-vue/native/16/soft/x'</script><template>  <div class="field max-w(420) mx-auto">    <label for="input-teams">Teams</label>    <div class="input-group input-group-wrap">      <span class="chip">        Design<button type="button" class="chip-remove" aria-label="Remove Design">          <XIcon class="icon" />        </button>      </span>      <span class="chip">        Research<button type="button" class="chip-remove" aria-label="Remove Research">          <XIcon class="icon" />        </button>      </span>      <span class="chip">        Engineering<button type="button" class="chip-remove" aria-label="Remove Engineering">          <XIcon class="icon" />        </button>      </span>      <span class="chip">        Operations<button type="button" class="chip-remove" aria-label="Remove Operations">          <XIcon class="icon" />        </button>      </span>      <input class="input-group-field" id="input-teams" placeholder="Add a team">    </div>  </div></template>

#검색과 자동 채우기

type="search" 필드는 브라우저의 지우기 버튼을 유지하며, 버튼 모양은 아이콘 전경색의 가는 ×로 바뀝니다. 브라우저가 필드를 자동으로 채우면 브라우저 엔진의 기본 노란색이나 파란색 대신 정보 색상이 오목한 영역에 옅게 적용되어 폼 전체의 모양이 일관되게 유지됩니다.

검색

<input class="input max-w(360) mx-auto" type="search" value="moonstone" aria-label="Search">
<input className="input max-w(360) mx-auto" type="search" defaultValue="moonstone" aria-label="Search" />
<input class="input max-w(360) mx-auto" type="search" value="moonstone" aria-label="Search">
<template>  <input class="input max-w(360) mx-auto" type="search" value="moonstone" aria-label="Search"></template>
Chromium과 Safari에서는 필드에 마우스를 올리거나 포커스를 주면 지우기 버튼이 표시됩니다.

#파일

<input type="file">에서 브라우저 기본 버튼은 세그먼트 트랙의 옵션처럼 오목한 영역 안에 놓인 작은 볼록한 컨트롤로 표시됩니다.

파일

<label class="field">Attachment <input class="input" type="file"></label>
<label className="field">Attachment <input className="input" type="file" /></label>
<label class="field">Attachment <input class="input" type="file"></label>
<template>  <label class="field">Attachment <input class="input" type="file"></label></template>

#날짜, 시간, 숫자, 색상

.input은 브라우저 기본 날짜, 시간, 숫자, 색상 필드에도 같은 오목한 영역 스타일을 적용합니다. 선택 도구는 사용자가 기기에서 익숙하게 쓰는 플랫폼 기본 도구를 그대로 사용합니다. 색상 필드는 정사각형이며, 색상 견본은 가장자리에서 4px 안쪽에 놓이고 필드와 견본의 둥근 모서리는 중심이 일치합니다.

브라우저가 이 필드에 표시하는 작은 기호는 아이콘과 같은 선 굵기와 전경색으로 표시됩니다. 달력이나 시계 아이콘은 선택 도구를 열고, 숫자 필드의 위쪽 꺾쇠는 값을 늘리며 아래쪽 꺾쇠는 값을 줄입니다. Chromium과 Safari에서는 이 요소에 스타일을 적용할 수 있으며, Firefox에서는 기본 모양이 유지됩니다. 사용자가 값을 자주 증감해야 한다면 스테퍼를 사용하세요.

날짜, 시간, 숫자, 색상

<label class="field">Starts <input class="input" type="date" value="2026-11-11"></label><label class="field">At <input class="input" type="time" value="09:30"></label><label class="field">  Timeout in seconds <input class="input" type="number" min="0" step="5" value="30"></label><label class="field">Accent <input class="input" type="color" value="#5b4fe0"></label>
<>  <label className="field">    Starts <input className="input" type="date" defaultValue="2026-11-11" />  </label>  <label className="field">At <input className="input" type="time" defaultValue="09:30" /></label>  <label className="field">    Timeout in seconds <input className="input" type="number" min="0" step="5" defaultValue="30" />  </label>  <label className="field">    Accent <input className="input" type="color" defaultValue="#5b4fe0" />  </label></>
<label class="field">Starts <input class="input" type="date" value="2026-11-11"></label><label class="field">At <input class="input" type="time" value="09:30"></label><label class="field">  Timeout in seconds <input class="input" type="number" min="0" step="5" value="30"></label><label class="field">Accent <input class="input" type="color" value="#5b4fe0"></label>
<template>  <label class="field">Starts <input class="input" type="date" value="2026-11-11"></label>  <label class="field">At <input class="input" type="time" value="09:30"></label>  <label class="field">    Timeout in seconds <input class="input" type="number" min="0" step="5" value="30">  </label>  <label class="field">Accent <input class="input" type="color" value="#5b4fe0"></label></template>

#필드 그룹

<fieldset>에 fieldset을 적용하면 관련 컨트롤을 하나의 제목 아래 묶고 브라우저 기본 홈 모양 테두리를 없앱니다. fieldset-legend 클래스는 <legend>에 필드 레이블과 같은 스타일을 적용합니다. 체크박스, 라디오 버튼, 선택 옵션을 이 구조로 감싸 그룹에 이름을 지정하세요.

필드 그룹

<fieldset class="fieldset">  <legend class="fieldset-legend">Notify me about</legend>  <label class="check"><input type="checkbox" class="checkbox" checked> Failed deployments</label>  <label class="check">    <input type="checkbox" class="checkbox" checked> Expiring certificates  </label>  <label class="check"><input type="checkbox" class="checkbox"> Product news</label></fieldset>
<fieldset className="fieldset">  <legend className="fieldset-legend">Notify me about</legend>  <label className="check">    <input type="checkbox" className="checkbox" defaultChecked /> Failed deployments  </label>  <label className="check">    <input type="checkbox" className="checkbox" defaultChecked /> Expiring certificates  </label>  <label className="check"><input type="checkbox" className="checkbox" /> Product news</label></fieldset>
<fieldset class="fieldset">  <legend class="fieldset-legend">Notify me about</legend>  <label class="check"><input type="checkbox" class="checkbox" checked> Failed deployments</label>  <label class="check">    <input type="checkbox" class="checkbox" checked> Expiring certificates  </label>  <label class="check"><input type="checkbox" class="checkbox"> Product news</label></fieldset>
<template>  <fieldset class="fieldset">    <legend class="fieldset-legend">Notify me about</legend>    <label class="check"><input type="checkbox" class="checkbox" checked> Failed deployments</label>    <label class="check">      <input type="checkbox" class="checkbox" checked> Expiring certificates    </label>    <label class="check"><input type="checkbox" class="checkbox"> Product news</label>  </fieldset></template>

#비활성화

비활성화

<div class="field">  <label for="custom-domain">Custom domain</label>  <input class="input" id="custom-domain" value="atlas.dev" disabled aria-describedby="custom-domain-reason">  <span class="field-hint" id="custom-domain-reason">Custom domains come with the Team plan.</span></div>
<div className="field">  <label htmlFor="custom-domain">Custom domain</label>  <input className="input" id="custom-domain" defaultValue="atlas.dev" disabled aria-describedby="custom-domain-reason" />  <span className="field-hint" id="custom-domain-reason">    Custom domains come with the Team plan.  </span></div>
<div class="field">  <label for="custom-domain">Custom domain</label>  <input class="input" id="custom-domain" value="atlas.dev" disabled aria-describedby="custom-domain-reason">  <span class="field-hint" id="custom-domain-reason">Custom domains come with the Team plan.</span></div>
<template>  <div class="field">    <label for="custom-domain">Custom domain</label>    <input class="input" id="custom-domain" value="atlas.dev" disabled aria-describedby="custom-domain-reason">    <span class="field-hint" id="custom-domain-reason">      Custom domains come with the Team plan.    </span>  </div></template>

#React, Svelte, Vue

field 컴포넌트는 레이블, 컨트롤, 힌트, 오류를 각각의 ID로 연결합니다. 컨트롤은 페이지에서 작성한 마크업을 그대로 사용하며, 이 페이지의 나머지 구성 요소도 모두 마크업으로 구현합니다. npx master-ui add field로 컴포넌트를 프로젝트에 복사하세요. 컴포넌트의 구성과 사용법은 React, Svelte, Vue에서 확인할 수 있습니다.

ui/field.tsx
import { useId, type ComponentProps, type ReactNode } from 'react'export interface FieldProps extends Omit<ComponentProps<'div'>, 'children'> {  label: ReactNode  /** Guidance under the control. */  hint?: ReactNode  /** What is wrong with the value. The stylesheet shows it while the control is invalid. */  error?: ReactNode  /** The control: spread what it is given on an input, a select, a textarea or a component that takes them. */  children: (control: { id: string, 'aria-describedby'?: string, 'aria-invalid'?: true }) => ReactNode}/** A label, its control, a hint and an error, joined by their ids. */export function Field({ label, hint, error, className, children, ...root }: FieldProps) {  const id = useId()  const described = [hint !== undefined && `${id}hint`, error !== undefined && `${id}error`].filter(Boolean).join(' ')  return (    <div className={className ? `field ${className}` : 'field'} {...root}>      <label htmlFor={id}>{label}</label>      {children({ id, 'aria-describedby': described || undefined, 'aria-invalid': error !== undefined && error !== false && error !== null ? true : undefined })}      {hint !== undefined && <span className="field-hint" id={`${id}hint`}>{hint}</span>}      {error !== undefined && <span className="field-error" id={`${id}error`}>{error}</span>}    </div>  )}
ui/Field.svelte
<script lang="ts" module>  import type { Snippet } from 'svelte'  import type { HTMLAttributes } from 'svelte/elements'  export interface FieldControl {    id: string    'aria-describedby'?: string    'aria-invalid'?: true  }  export interface FieldProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {    label: string    /** Guidance under the control. */    hint?: string    /** What is wrong with the value. The stylesheet shows it while the control is invalid. */    error?: string | null    /** The control: spread what it is given on an input, a select, a textarea or a component that takes them. */    children: Snippet<[FieldControl]>  }</script><script lang="ts">  let { label, hint, error, class: className, children, ...root }: FieldProps = $props()  const id = $props.id()  const described = $derived([hint !== undefined && `${id}hint`, error !== undefined && `${id}error`].filter(Boolean).join(' '))</script><!--  @component  A label, its control, a hint and an error, joined by their ids.--><div class={['field', className]} {...root}>  <label for={id}>{label}</label>  {@render children({ id, 'aria-describedby': described || undefined, 'aria-invalid': error !== undefined && error !== null ? true : undefined })}  {#if hint !== undefined}<span class="field-hint" id="{id}hint">{hint}</span>{/if}  {#if error !== undefined}<span class="field-error" id="{id}error">{error}</span>{/if}</div>
ui/Field.vue
<script setup lang="ts">import { computed, useId } from 'vue'defineOptions({ inheritAttrs: false })const { hint, error } = defineProps<{  label: string  /** Guidance under the control. */  hint?: string  /** What is wrong with the value. The stylesheet shows it while the control is invalid. */  error?: string | null}>()defineSlots<{  /** The control: bind what it is given on an input, a select, a textarea or a component that takes them. */  default: (control: { 'id': string, 'aria-describedby'?: string, 'aria-invalid'?: true }) => unknown}>()/* A label, its control, a hint and an error, joined by their ids. */const id = useId()const control = computed(() => ({  'id': id,  'aria-describedby': [hint !== undefined && `${id}-hint`, error !== undefined && `${id}-error`].filter(Boolean).join(' ') || undefined,  'aria-invalid': error !== undefined && error !== null ? true as const : undefined,}))</script><template>  <div class="field" v-bind="$attrs">    <label :for="id">{{ label }}</label>    <slot v-bind="control" />    <span v-if="hint !== undefined" class="field-hint" :id="`${id}-hint`">{{ hint }}</span>    <span v-if="error !== undefined" class="field-error" :id="`${id}-error`">{{ error }}</span>  </div></template>

#클래스

클래스설명
input텍스트 입력, 파일 입력 또는 textarea를 오목한 영역으로 표시합니다. 브라우저의 날짜, 시간, 숫자, 검색, 색상 입력 필드에도 같은 스타일을 적용합니다
input-sm높이는 32px이며 기본값은 버튼 높이인 38px입니다.적용할 클래스는 input입니다
input-lg높이는 44px이며 기본값은 버튼 높이인 38px입니다.적용할 클래스는 input입니다
input-auto내용에 맞춰 --input-rows 줄에서 --input-max-rows 줄까지 늘어나는 textarea입니다. 최대 줄 수를 넘으면 스크롤됩니다.적용할 클래스는 input입니다
input-group별도 표면이 없는 필드와 그에 딸린 아이콘, 애드온 또는 버튼을 하나의 오목한 영역으로 감쌉니다. 이 영역에 내부 필드의 호버, 포커스, 유효하지 않음, 비활성화 상태가 표시됩니다
input-group-sm높이 32px인 그룹입니다. 기본 높이는 38px입니다.적용할 클래스는 input-group입니다
input-group-lg높이 44px인 그룹입니다. 기본 높이는 38px입니다.적용할 클래스는 input-group입니다
input-group-wrap여러 값을 칩으로 모으고, 칩이 줄을 넘으면 다음 줄로 늘어나는 그룹입니다. 값 추가와 제거는 페이지 자체 스크립트나 서버 요청과 응답으로 처리합니다.적용할 클래스는 input-group입니다
input-group-field그룹 안에서 별도의 표면 스타일 없이 쓰는 네이티브 입력 필드입니다. 입력 필드의 시맨틱과 텍스트 커서를 유지합니다.
input-group-addon프로토콜, 단위, 도메인처럼 값 옆에 붙는 고정 텍스트
field컨트롤 위에 레이블을 쌓고, 필요하면 아래에 안내를 둡니다. 텍스트와 컨트롤만 담을 때는 label 요소를 쓰고, 힌트나 오류가 있을 때는 for가 있는 label을 담은 div를 씁니다. 안내가 컨트롤 이름의 일부가 아니라 설명이 되도록 하기 위해서입니다.
field-hint컨트롤 아래에 옅은 색으로 표시하는 안내 문구입니다. 필드 안에서는 오류 메시지가 표시되는 동안 숨겨집니다.
field-error오류 메시지입니다. 필드 안의 컨트롤이 유효하지 않은 동안에만 표시됩니다.
field-help레이블 뒤에 두는 물음표입니다. 차분한 글자색에 점선 밑줄을 긋고 툴팁을 표시합니다. interestfor와 popovertarget으로 해당 툴팁을 가리키는 버튼입니다. 레이블과 같은 행에 나란히 두며 레이블 안에는 두지 않습니다
fieldset관련 컨트롤을 하나의 제목 아래 묶는 fieldset으로, 브라우저 기본의 오목한 테두리는 표시하지 않습니다.
fieldset-legend범례는 그룹의 제목이며, 필드 레이블과 같은 스타일로 표시합니다.

#사용자 지정 속성

속성기본값설명
--input-height2.375rem포인터 종류와 관계없이 적용되는 입력 필드 또는 입력 그룹의 최소 블록 크기
--input-padding-x.75rem입력 필드 또는 입력 그룹의 인라인 방향 패딩
--input-font-size.875rem텍스트 크기
--input-radiusvar(--radius-control)모서리 반경은 10px이며, 작은 크기는 8px, 큰 크기는 12px입니다.
--input-rows3input-auto가 적용된 textarea에 표시되는 최소 줄 수input-auto에 설정합니다
--input-max-rows12input-auto textarea가 스크롤되기 전까지 늘어날 수 있는 최대 줄 수input-auto에 설정합니다

#소스

@master/ui/components/input.css
/* * Input and field: a text field is a well cut into its surface, edged by a half-pixel contour. * On focus the well rises to the sheet and takes one ink contour with a soft halo. * A field is as tall as the button beside it: 32, 38 and 44px. * A textarea can grow with its content, and an input group holds an icon, an addon or a button in the same well. */@layer components.ui {  .input {    --input-height: 2.375rem;    --input-padding-x: .75rem;    /* A line of 14px text is 20.3px; 8px over and under keeps it inside the 38px the field shares with a button. */    --input-padding-y: .5rem;    --input-font-size: .875rem;    --input-radius: var(--radius-control);    width: 100%;    min-width: 0;    min-height: var(--input-height);    margin: 0;    padding: var(--input-padding-y) var(--input-padding-x);    border: 0;    border-radius: calc(var(--input-radius) * var(--corner-scale));    corner-shape: var(--corner-shape);    background: var(--color-surface-inset);    color: var(--color-text-strong);    scrollbar-width: thin;    scrollbar-color: var(--color-line-strong) transparent;    /* One contour and a soft inner shade: the well's tone does the rest of the work of being found. */    box-shadow: var(--shadow-pressed);    font: 400 var(--input-font-size)/1.45 var(--font-family-sans);    font-feature-settings: inherit;    caret-color: var(--color-text-strong);    resize: vertical;    appearance: none;    transition-property: box-shadow, background-color;    transition-duration: var(--duration-quick);    transition-timing-function: var(--easing-glide);    &::placeholder {      color: var(--color-text-muted);      opacity: 1;    }    @media (hover: hover) {      &:hover:not(:focus, :disabled, [readonly]) {        background: var(--color-surface-inset-hover);      }    }    /*     * Read only: the value can be read and copied, not changed, so the well rests flat and the caret is gone, as a     * read-only editor's does. It is as light as the base rule and comes before focus, so a reader who tabs into it     * still sees where the keys are, and an error after it still draws its edge.     */    &:where([readonly]:not(:disabled)) {      background: transparent;      box-shadow: var(--shadow-flat);      caret-color: transparent;    }    &:focus {      outline: none;      background: var(--color-surface-raised);      box-shadow: inset 0 0 0 .5px var(--color-line-mark), 0 0 0 .5px var(--color-line-mark), 0 0 0 3.5px var(--color-focus-halo);    }    /*     * Filled in by the browser: the engine paints its own background and does not let a page replace it, so the     * well is laid over it as an inset shadow, tinted just enough to say the value was not typed.     */    &:autofill {      box-shadow: var(--shadow-pressed), inset 0 0 0 100vmax color-mix(in oklab, var(--color-info) 7%, var(--color-surface-inset));      &:focus {        box-shadow: inset 0 0 0 .5px var(--color-line-mark), 0 0 0 .5px var(--color-line-mark), 0 0 0 3.5px var(--color-focus-halo), inset 0 0 0 100vmax color-mix(in oklab, var(--color-info) 7%, var(--color-surface-raised));      }    }    /*     * An error keeps its boundary while focused; the focus halo takes the danger tone.     * :user-invalid reports native constraints (required, type, pattern) once the reader has tried, without script.     * It comes after the browser's fill, so a filled value that is wrong still shows that it is.     */    &:is([aria-invalid="true"], :user-invalid) {      box-shadow: var(--shadow-pressed), inset 0 0 0 .5px var(--color-danger), 0 0 0 .5px color-mix(in oklab, var(--color-danger) 45%, transparent);      &:focus {        box-shadow: inset 0 0 0 .5px var(--color-danger), 0 0 0 .5px var(--color-danger), 0 0 0 3.5px color-mix(in oklab, var(--color-danger) 15%, transparent);      }    }    &:disabled {      color: var(--color-text-disabled);      /* Safari paints a disabled field's text with its own fill and fades the field; the ink above is the whole state. */      -webkit-text-fill-color: currentColor;      opacity: 1;      cursor: not-allowed;      &::placeholder {        color: var(--color-text-disabled);      }    }    /* A search field's clear button, redrawn as a fine cross in the ink of an icon. */    &::-webkit-search-cancel-button {      width: 14px;      height: 14px;      margin-inline: .5rem -.125rem;      background: var(--color-text-muted);      mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4L12 12'/%3E%3Cpath d='M4 12L12 4'/%3E%3C/svg%3E") center / contain no-repeat;      appearance: none;      cursor: pointer;    }    /*     * The marks a browser puts in a date, a time or a number field, redrawn at the weight of an icon and in its     * ink: a calendar or a clock that opens the picker, and a pair of chevrons that step the number. Chromium and     * Safari expose these parts; Firefox keeps its own.     */    &::-webkit-calendar-picker-indicator {      box-sizing: border-box;      width: 1rem;      height: 1rem;      margin-inline: .5rem -.125rem;      padding: 0;      background: var(--color-text-muted);      mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='3.5' width='11' height='10.5' rx='1'/%3E%3Cpath d='M2.5 6.5L13.5 6.5'/%3E%3Cpath d='M5.5 2L5.5 4.5'/%3E%3Cpath d='M10.5 2L10.5 4.5'/%3E%3Ccircle cx='6' cy='9.5' r='0.625' fill='currentColor' stroke='none'/%3E%3Ccircle cx='10' cy='9.5' r='0.625' fill='currentColor' stroke='none'/%3E%3Ccircle cx='6' cy='12' r='0.625' fill='currentColor' stroke='none'/%3E%3C/svg%3E") center / contain no-repeat;      opacity: 1;      cursor: pointer;    }    /* The engine pads each part of a date by a pixel, which would make the field taller than its neighbors. */    &::-webkit-datetime-edit {      margin-block: -1px;    }    &[type="time"]::-webkit-calendar-picker-indicator {      mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='M8 4.3333L8 7.8892A0.2 0.2 0 0 0 8.094 8.0588L10.6667 9.6667'/%3E%3C/svg%3E");    }    /* The upper half of the mark steps up and the lower half steps down, as the browser's own does. */    &::-webkit-inner-spin-button {      width: 1rem;      margin-inline: .5rem -.125rem;      background: var(--color-text-muted);      mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.25 5L13.1086 7.8586A0.2 0.2 0 0 1 13.1086 8.1414L10.25 11' transform='rotate(-90 8 8)'/%3E%3Cpath d='M10.25 5L13.1086 7.8586A0.2 0.2 0 0 1 13.1086 8.1414L10.25 11' transform='rotate(90 8 8)'/%3E%3C/svg%3E") center / 1rem no-repeat;      opacity: 1;      appearance: none;      cursor: pointer;    }    &:disabled::-webkit-calendar-picker-indicator {      background: var(--color-text-disabled);      cursor: not-allowed;    }    &:disabled::-webkit-inner-spin-button {      background: var(--color-text-disabled);      cursor: not-allowed;    }    @media (forced-colors: active) {      &::-webkit-search-cancel-button {        background: FieldText;        forced-color-adjust: none;      }      &::-webkit-calendar-picker-indicator {        background: FieldText;        forced-color-adjust: none;      }      &::-webkit-inner-spin-button {        background: FieldText;        forced-color-adjust: none;      }      /* The file button's face is drawn with shadows, which forced colors drop: an outline keeps it a button. */      &::file-selector-button {        outline: 1px solid ButtonText;        outline-offset: -1px;      }    }    &.input-sm {      --input-height: 2rem;      --input-padding-x: .625rem;      --input-padding-y: .3125rem;      --input-font-size: .8125rem;      --input-radius: var(--radius-control-sm);    }    &.input-lg {      --input-height: 2.75rem;      --input-padding-x: .875rem;      --input-padding-y: .625rem;      --input-font-size: 1rem;      --input-radius: var(--radius-control-lg);    }    /*     * A textarea that grows with its content, from --input-rows to --input-max-rows lines, then scrolls.     * Without field-sizing it keeps its minimum height and the resize handle.     */    &.input-auto {      --input-rows: 3;      --input-max-rows: 12;      min-height: max(var(--input-height), calc(var(--input-rows) * 1lh + var(--input-padding-y) * 2));      @supports (field-sizing: content) {        max-height: calc(var(--input-max-rows) * 1lh + var(--input-padding-y) * 2);        field-sizing: content;        resize: none;      }    }    /* A file input holds its button like a segmented track holds an option: 4px in, with a concentric corner. */    &[type="file"] {      padding-block: 4px;      padding-inline: 4px var(--input-padding-x);      color: var(--color-text-muted);      line-height: calc(var(--input-height) - 8px);      cursor: pointer;      &::file-selector-button {        height: calc(var(--input-height) - 8px);        margin-block: 0;        margin-inline: 0 .75rem;        padding: 0 .625rem;        border: 0;        border-radius: calc(var(--input-radius) * var(--corner-scale) - 4px);        corner-shape: var(--corner-shape);        @apply --surface-sheet;        color: var(--color-text-strong);        box-shadow: var(--shadow-raised);        font: var(--font-weight-control) .78125rem/1 var(--font-family-sans);        font-feature-settings: inherit;        /* On the baseline the button would push its line, and the field, a fraction taller than a button's 38px. */        vertical-align: top;        cursor: pointer;      }      /* The button answers as a button in a group's well does: it lifts under the pointer and sinks when pressed. */      @media (hover: hover) {        &:hover:not(:disabled)::file-selector-button {          box-shadow: var(--shadow-raised-hover);        }      }      &:active:not(:disabled)::file-selector-button {        background: var(--color-surface-inset);        box-shadow: var(--shadow-pressed);      }      /* As heavy as the muted words above, which would otherwise keep their ink in a disabled field. */      &:disabled {        color: var(--color-text-disabled);        cursor: not-allowed;      }      &:disabled::file-selector-button {        background: transparent;        color: var(--color-text-disabled);        box-shadow: var(--shadow-flat);        cursor: not-allowed;      }    }    /* A color: the swatch fills the well, 4px in, with a concentric corner. */    &[type="color"] {      width: var(--input-height);      padding: 4px;      cursor: pointer;      &::-webkit-color-swatch-wrapper {        padding: 0;      }      &::-webkit-color-swatch {        border: 0;        border-radius: calc(var(--input-radius) * var(--corner-scale) - 4px);        corner-shape: var(--corner-shape);        box-shadow: inset 0 0 0 .5px var(--color-line-on-color);      }      &::-moz-color-swatch {        border: 0;        border-radius: calc(var(--input-radius) * var(--corner-scale) - 4px);        corner-shape: var(--corner-shape);        box-shadow: inset 0 0 0 .5px var(--color-line-on-color);      }      /* Disabled, the swatch fades as a disabled slider does, so the color no longer reads as one to change. */      &:disabled {        cursor: not-allowed;        &::-webkit-color-swatch {          opacity: .5;        }        &::-moz-color-swatch {          opacity: .5;        }      }    }    @media (forced-colors: active) {      outline: 1px solid FieldText;      outline-offset: -1px;      &:focus {        outline: 2px solid Highlight;        outline-offset: -2px;      }      /* The danger edge and the halo are shadows, which forced colors drop: the outline says it instead, as an editor's does. */      &:is([aria-invalid="true"], :user-invalid) {        outline-color: Mark;      }      &:disabled {        outline-color: GrayText;      }    }  }  /*   * Input group: one well around a bare field and what belongs to it: an icon, a unit, a shortcut or a button.   * The group draws the field's states; the field inside keeps the semantics and the caret.   */  .input-group {    --input-height: 2.375rem;    --input-padding-x: .75rem;    --input-font-size: .875rem;    --input-radius: var(--radius-control);    --icon-size: 1rem;    --icon-offset: -.125rem;    display: flex;    align-items: center;    gap: .5rem;    min-width: 0;    min-height: var(--input-height);    padding: 0 var(--input-padding-x);    border-radius: calc(var(--input-radius) * var(--corner-scale));    corner-shape: var(--corner-shape);    background: var(--color-surface-inset);    color: var(--color-text-muted);    box-shadow: var(--shadow-pressed);    font: 400 var(--input-font-size)/1.45 var(--font-family-sans);    font-feature-settings: inherit;    cursor: text;    transition-property: box-shadow, background-color;    transition-duration: var(--duration-quick);    transition-timing-function: var(--easing-glide);    @media (hover: hover) {      &:hover:not(:has(.input-group-field:is(:focus, :disabled, [readonly]))) {        background: var(--color-surface-inset-hover);      }    }    /* A read-only field rests flat, as a lone one does, and rises when it has focus, since focus is heavier. */    &:has(.input-group-field:where([readonly]:not(:disabled))) {      background: transparent;      box-shadow: var(--shadow-flat);    }    &:has(.input-group-field:focus) {      background: var(--color-surface-raised);      box-shadow: inset 0 0 0 .5px var(--color-line-mark), 0 0 0 .5px var(--color-line-mark), 0 0 0 3.5px var(--color-focus-halo);    }    &:has(.input-group-field:is([aria-invalid="true"], :user-invalid)) {      box-shadow: var(--shadow-pressed), inset 0 0 0 .5px var(--color-danger), 0 0 0 .5px color-mix(in oklab, var(--color-danger) 45%, transparent);      &:has(.input-group-field:focus) {        box-shadow: inset 0 0 0 .5px var(--color-danger), 0 0 0 .5px var(--color-danger), 0 0 0 3.5px color-mix(in oklab, var(--color-danger) 15%, transparent);      }    }    &:has(.input-group-field:disabled) {      color: var(--color-text-disabled);      cursor: not-allowed;      /* Everything in the group takes the disabled ink, the fixed text beside the value too. */      .input-group-addon {        color: inherit;      }    }    &.input-group-sm {      --input-height: 2rem;      --input-padding-x: .625rem;      --input-font-size: .8125rem;      --input-radius: var(--radius-control-sm);      --icon-size: .875rem;      --icon-offset: -.0625rem;      gap: .375rem;    }    &.input-group-lg {      --input-height: 2.75rem;      --input-padding-x: .875rem;      --input-font-size: 1rem;      --input-radius: var(--radius-control-lg);      --icon-size: 1.125rem;    }    /* The browser filled the field in: the whole well takes the tint, not a box inside it. */    &:has(.input-group-field:autofill) {      background: color-mix(in oklab, var(--color-info) 7%, var(--color-surface-inset));      /* Focused, it rises to the sheet as any field does, and keeps the tint, as a lone field does. */      &:has(.input-group-field:focus) {        background: color-mix(in oklab, var(--color-info) 7%, var(--color-surface-raised));      }    }    /*     * Wrap: a field that collects several values. Each value is a chip in the well, the field takes what is     * left of the last line, and the well grows by a line when the values need one. A chip sits --input-inset     * in from the well's edge and takes the concentric corner.     */    &.input-group-wrap {      --input-inset: 6px;      flex-wrap: wrap;      gap: 4px;      padding-block: var(--input-inset);      &:has(.chip:first-child) {        padding-inline-start: var(--input-inset);      }      /* An end is what the group draws: a hidden part before the first chip does not take the inset from it. */      &:has(.chip:nth-child(1 of :not([popover], [hidden], [type="hidden"]))) {        padding-inline-start: var(--input-inset);      }      &.input-group-sm {        --input-inset: 4px;      }      /*       * A value longer than the well wraps inside its chip instead of running out of the well with its remove       * button. The line is set apart only past one line, so a chip of one line keeps its drawing.       */      .chip {        --chip-height: calc(var(--input-height) - var(--input-inset) * 2);        --chip-padding-x: .5rem;        max-width: 100%;        padding-block: .1875rem;        border-radius: calc(var(--input-radius) * var(--corner-scale) - var(--input-inset));        corner-shape: var(--corner-shape);        line-height: 1.2;        white-space: normal;        overflow-wrap: anywhere;      }      /*       * A button in a wrapping well stands where a chip does, --input-inset in from every edge it meets, so the       * well keeps its height and the button its concentric corner.       */      .btn {        --btn-height: calc(var(--input-height) - var(--input-inset) * 2);        --btn-radius: calc(var(--input-radius) - var(--input-inset) / var(--corner-scale));        &:first-child {          margin-inline-start: calc(var(--input-inset) - var(--input-padding-x));        }        &:last-child {          margin-inline-end: calc(var(--input-inset) - var(--input-padding-x));        }        &:nth-child(1 of :not([popover], [hidden])) {          margin-inline-start: calc(var(--input-inset) - var(--input-padding-x));        }        &:nth-last-child(1 of :not([popover], [hidden])) {          margin-inline-end: calc(var(--input-inset) - var(--input-padding-x));        }      }      .input-group-field {        flex: 1 1 5rem;        align-self: auto;        min-height: calc(var(--input-height) - var(--input-inset) * 2);      }      .chip + .input-group-field {        margin-inline-start: .25rem;      }    }    /* A button in the well sits 4px in, so its corner is the well's corner minus that inset. */    .btn {      --btn-height: calc(var(--input-height) - 8px);      --btn-padding-x: .625rem;      --btn-font-size: .78125rem;      /* The button multiplies its radius by the corner scale itself, so the inset is divided by it here. */      --btn-radius: calc(var(--input-radius) - 4px / var(--corner-scale));      --btn-lift: 0px;      --icon-size: .875rem;      --icon-offset: -.0625rem;      &:first-child {        margin-inline-start: calc(4px - var(--input-padding-x));      }      &:last-child {        margin-inline-end: calc(4px - var(--input-padding-x));      }      /*       * An end is the first or last part the group draws, not the first or last node: a popover the button opens       * (a date picker's calendar) or a hidden part may follow it and takes no room in the row. Where the browser       * can count only what is drawn, it does; elsewhere the rules above hold.       */      &:nth-child(1 of :not([popover], [hidden])) {        margin-inline-start: calc(4px - var(--input-padding-x));      }      &:nth-last-child(1 of :not([popover], [hidden])) {        margin-inline-end: calc(4px - var(--input-padding-x));      }    }    @media (forced-colors: active) {      outline: 1px solid FieldText;      outline-offset: -1px;      &:has(.input-group-field:focus) {        outline: 2px solid Highlight;        outline-offset: -2px;      }      &:has(.input-group-field:is([aria-invalid="true"], :user-invalid)) {        outline-color: Mark;      }      &:has(.input-group-field:disabled) {        outline-color: GrayText;      }    }  }  /* The native field inside a group: no material of its own, it fills the well. */  .input-group-field {    flex: 1 1 0;    align-self: stretch;    min-width: 0;    margin: 0;    padding: 0;    border: 0;    border-radius: 0;    outline: none;    background: transparent;    color: var(--color-text-strong);    box-shadow: none;    font: inherit;    font-feature-settings: inherit;    caret-color: var(--color-text-strong);    appearance: none;    &::placeholder {      color: var(--color-text-muted);      opacity: 1;    }    /* The engine's autofill color never arrives, so the well under the field keeps drawing it. */    &:autofill {      transition: background-color 0s 600000s;    }    /* Read only: no caret, as on a lone read-only field. */    &:where([readonly]:not(:disabled)) {      caret-color: transparent;    }    &::-webkit-search-cancel-button {      width: 14px;      height: 14px;      margin-inline-start: .5rem;      background: var(--color-text-muted);      mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4L12 12'/%3E%3Cpath d='M4 12L12 4'/%3E%3C/svg%3E") center / contain no-repeat;      appearance: none;      cursor: pointer;    }    /* The same marks as a plain field draws for a date, a time or a number. */    &::-webkit-calendar-picker-indicator {      box-sizing: border-box;      width: 1rem;      height: 1rem;      margin-inline: .5rem 0;      padding: 0;      background: var(--color-text-muted);      mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='3.5' width='11' height='10.5' rx='1'/%3E%3Cpath d='M2.5 6.5L13.5 6.5'/%3E%3Cpath d='M5.5 2L5.5 4.5'/%3E%3Cpath d='M10.5 2L10.5 4.5'/%3E%3Ccircle cx='6' cy='9.5' r='0.625' fill='currentColor' stroke='none'/%3E%3Ccircle cx='10' cy='9.5' r='0.625' fill='currentColor' stroke='none'/%3E%3Ccircle cx='6' cy='12' r='0.625' fill='currentColor' stroke='none'/%3E%3C/svg%3E") center / contain no-repeat;      opacity: 1;      cursor: pointer;    }    /* The engine pads each part of a date by a pixel, which would make the field taller than its neighbors. */    &::-webkit-datetime-edit {      margin-block: -1px;    }    &[type="time"]::-webkit-calendar-picker-indicator {      mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='M8 4.3333L8 7.8892A0.2 0.2 0 0 0 8.094 8.0588L10.6667 9.6667'/%3E%3C/svg%3E");    }    /* The upper half of the mark steps up and the lower half steps down, as the browser's own does. */    &::-webkit-inner-spin-button {      width: 1rem;      margin-inline: .5rem 0;      background: var(--color-text-muted);      mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.25 5L13.1086 7.8586A0.2 0.2 0 0 1 13.1086 8.1414L10.25 11' transform='rotate(-90 8 8)'/%3E%3Cpath d='M10.25 5L13.1086 7.8586A0.2 0.2 0 0 1 13.1086 8.1414L10.25 11' transform='rotate(90 8 8)'/%3E%3C/svg%3E") center / 1rem no-repeat;      opacity: 1;      appearance: none;      cursor: pointer;    }    &:disabled::-webkit-calendar-picker-indicator {      background: var(--color-text-disabled);      cursor: not-allowed;    }    &:disabled::-webkit-inner-spin-button {      background: var(--color-text-disabled);      cursor: not-allowed;    }    @media (forced-colors: active) {      &::-webkit-search-cancel-button {        background: FieldText;        forced-color-adjust: none;      }      &::-webkit-calendar-picker-indicator {        background: FieldText;        forced-color-adjust: none;      }      &::-webkit-inner-spin-button {        background: FieldText;        forced-color-adjust: none;      }    }    &:disabled {      color: var(--color-text-disabled);      -webkit-text-fill-color: currentColor;      opacity: 1;      cursor: not-allowed;      &::placeholder {        color: var(--color-text-disabled);      }    }  }  /* Fixed text beside the value, such as a protocol, a unit or a domain. */  .input-group-addon {    flex: none;    color: var(--color-text-muted);    white-space: nowrap;    user-select: none;    -webkit-user-select: none;  }  /* A <fieldset> that groups related controls under one caption, without the browser's groove. */  .fieldset {    display: flex;    flex-direction: column;    gap: .75rem;    min-width: 0;    margin: 0;    padding: 0;    border: 0;  }  /* Its <legend>: the group's label, in the same voice as a field's. */  .fieldset-legend {    margin-bottom: .75rem;    padding: 0;    color: var(--color-text-strong);    font-size: .875rem;    font-weight: var(--font-weight-control);    line-height: 1.4;    /* A long caption, or one in a language without spaces, wraps in the group's column instead of widening it. */    text-wrap: pretty;    overflow-wrap: anywhere;    /* A disabled group's caption takes disabled ink with the controls it names, as a signature's label does. */    .fieldset:disabled & {      color: var(--color-text-disabled);      @media (forced-colors: active) {        color: GrayText;      }    }  }  /* A label stacked over its control, with optional guidance below, all on one edge. */  .field {    display: grid;    gap: .5rem;    min-width: 0;    color: var(--color-text-strong);    font-size: .875rem;    font-weight: var(--font-weight-control);    line-height: 1.4;    /* A label with a long word, an address or a URL wraps in its column instead of running past it. */    overflow-wrap: anywhere;  }  /*   * Guidance sits closer to its control than the label does: 6px below against 8px above. An error often quotes   * what was typed, an address or a link, so it breaks anywhere rather than widen the form.   */  .field-hint, .field-error {    margin: -.125rem 0 0;    font-size: .75rem;    font-weight: 400;    line-height: 1.5;    text-wrap: pretty;    overflow-wrap: anywhere;  }  .field-hint {    color: var(--color-text-muted);  }  /*   * Help beside a label: a question mark in muted ink over a dotted line, the mark of a word that has more to   * say. It is a button that stands after the label, never inside it, and shows a tooltip on hover, focus and   * a tap. It draws no face: the glyph takes the label's size and line, so the two share a baseline, and the   * place a pointer lands reaches a little past the glyph.   */  .field-help {    position: relative;    flex: none;    margin: 0;    padding: 0 .125em;    border: 0;    border-radius: calc(var(--radius-chip) * var(--corner-scale));    corner-shape: var(--corner-shape);    background: transparent;    color: var(--color-text-muted);    font: inherit;    font-weight: 400;    text-decoration: underline dotted;    text-decoration-thickness: 1px;    text-underline-offset: .25em;    cursor: help;    appearance: none;    transition: color var(--duration-quick) var(--easing-glide);    &::after {      content: '';      position: absolute;      inset: -.25rem -.375rem;    }    @media (hover: hover) {      &:hover {        color: var(--color-text-strong);      }    }    &:focus-visible {      color: var(--color-text-strong);      @apply --focus-ring;    }    @media (pointer: coarse) {      &::after {        @apply --touch-target;      }    }    @media (forced-colors: active) {      color: ButtonText;    }  }  /* The error appears with the invalid state it explains, and steps aside while the value is valid. */  .field-error {    color: var(--color-danger);  }  .field:not(:has([aria-invalid="true"], :user-invalid)) .field-error {    display: none;  }  /* While an error shows, it replaces the hint instead of stacking under it. */  .field:has([aria-invalid="true"], :user-invalid):has(.field-error) .field-hint {    display: none;  }}