탐색

v2.1.0
피드백

진행률

작업이 진행될수록 전경색으로 채워지는 얇은 오목한 영역입니다.

이 페이지의 내용

진행률은 작업이 얼마나 완료되었는지 보여 줍니다. 기본 HTML 요소인 <progress>에 .progress를 적용하세요. 브라우저는 값을 보조 기술에 전달하고, 클래스는 전경색으로 채워지는 얇은 오목한 영역을 그립니다. 컨트롤 안에서 소요 시간을 알 수 없는 작업을 표시하려면 스피너를 사용하세요.

진행률

<label class="field">  Uploading 3 of 5 files <progress class="progress" value="62" max="100">62%</progress></label>
<label className="field">  Uploading 3 of 5 files <progress className="progress" value="62" max="100">62%</progress></label>
<label class="field">  Uploading 3 of 5 files <progress class="progress" value="62" max="100">62%</progress></label>
<template>  <label class="field">    Uploading 3 of 5 files <progress class="progress" value="62" max="100">62%</progress>  </label></template>

#진행률 미정

진행률을 알 수 없는 동안에는 value를 생략하세요. 전경색 띠가 트랙을 따라 이동합니다. 동작 줄이기가 설정되어 있으면 트랙 전체가 균일한 중간 톤으로 고정됩니다.

진행률 미정

<label class="field">Preparing the build <progress class="progress"></progress></label>
<label className="field">Preparing the build <progress className="progress"></progress></label>
<label class="field">Preparing the build <progress class="progress"></progress></label>
<template>  <label class="field">Preparing the build <progress class="progress"></progress></label></template>

#크기

트랙의 기본 두께는 6px입니다. 목록의 행에 쓰는 progress-sm은 4px이고, progress-lg는 8px입니다.

크기

<progress class="progress progress-sm" value="30" max="100" aria-label="Small">30%</progress><progress class="progress" value="55" max="100" aria-label="Medium">55%</progress><progress class="progress progress-lg" value="80" max="100" aria-label="Large">80%</progress>
<>  <progress className="progress progress-sm" value="30" max="100" aria-label="Small">30%</progress>  <progress className="progress" value="55" max="100" aria-label="Medium">55%</progress>  <progress className="progress progress-lg" value="80" max="100" aria-label="Large">80%</progress></>
<progress class="progress progress-sm" value="30" max="100" aria-label="Small">30%</progress><progress class="progress" value="55" max="100" aria-label="Medium">55%</progress><progress class="progress progress-lg" value="80" max="100" aria-label="Large">80%</progress>
<template>  <progress class="progress progress-sm" value="30" max="100" aria-label="Small">30%</progress>  <progress class="progress" value="55" max="100" aria-label="Medium">55%</progress>  <progress class="progress progress-lg" value="80" max="100" aria-label="Large">80%</progress></template>

#구간 분할

progress-segmented는 트랙을 같은 크기의 구간으로 나눕니다. 전체 5단계 중 3단계나 업로드 8건 중 4건처럼 개수로 진행률을 나타낼 때 사용합니다. 한 구간이 한 단계에 해당하도록 --progress-steps를 max와 같은 값으로 설정하세요. 오목한 영역과 채워진 부분에 같은 마스크를 적용하므로 구간이 진행률 값에 맞춰 채워집니다.

구간 분할

<label class="field">  Step 3 of 5 <progress class="progress progress-segmented" max="5" value="3">Step 3 of 5</progress></label><label class="field">  5 of 8 files uploaded <progress class="progress progress-segmented progress-lg" style="--progress-steps: 8" max="8" value="5">    5 of 8  </progress></label>
<>  <label className="field">    Step 3 of 5 <progress className="progress progress-segmented" max="5" value="3">Step 3 of 5</progress>  </label>  <label className="field">    5 of 8 files uploaded <progress className="progress progress-segmented progress-lg" style={{ '--progress-steps': '8' } as React.CSSProperties} max="8" value="5">      5 of 8    </progress>  </label></>
<label class="field">  Step 3 of 5 <progress class="progress progress-segmented" max="5" value="3">Step 3 of 5</progress></label><label class="field">  5 of 8 files uploaded <progress class="progress progress-segmented progress-lg" style="--progress-steps: 8" max="8" value="5">    5 of 8  </progress></label>
<template>  <label class="field">    Step 3 of 5 <progress class="progress progress-segmented" max="5" value="3">Step 3 of 5</progress>  </label>  <label class="field">    5 of 8 files uploaded <progress class="progress progress-segmented progress-lg" style="--progress-steps: 8" max="8" value="5">      5 of 8    </progress>  </label></template>

#원형 진행률

progress-ring은 같은 진행률을 원형으로 표시하며 타일, 행 또는 카드 모서리에 배치할 수 있습니다. role="progressbar"가 지정된 요소입니다. 브라우저가 타입이 지정된 attr()를 지원하면 원형 진행률이 aria-valuenow와 aria-valuemax를 직접 읽습니다. 진행률을 사용자에게 전달하고 화면에 그리는 데 같은 값을 쓰므로 한 번만 지정하면 되며, 호는 새 값으로 부드럽게 전환됩니다. 그 외의 브라우저를 위해서는 style 속성에 --progress-ring-value도 설정하세요.

요소의 콘텐츠가 중앙에 레이블로 표시됩니다. 호의 양 끝은 둥글며, 채워진 부분이 없으면 빈 트랙만 표시됩니다.

원형 진행률

<div class="progress-ring progress-ring-sm" role="progressbar" aria-label="Upload" aria-valuenow="40"></div><div class="progress-ring" role="progressbar" aria-label="Storage used" aria-valuenow="64">64</div><div class="progress-ring progress-ring-lg" role="progressbar" aria-label="Steps done" aria-valuenow="3" aria-valuemax="8" aria-valuetext="3 of 8">  3/8</div><div class="progress-ring progress-ring-xl" role="progressbar" aria-label="Coverage" aria-valuenow="86">  86%</div>
<>  <div className="progress-ring progress-ring-sm" role="progressbar" aria-label="Upload" aria-valuenow={40}></div>  <div className="progress-ring" role="progressbar" aria-label="Storage used" aria-valuenow={64}>    64  </div>  <div className="progress-ring progress-ring-lg" role="progressbar" aria-label="Steps done" aria-valuenow={3} aria-valuemax={8} aria-valuetext="3 of 8">    3/8  </div>  <div className="progress-ring progress-ring-xl" role="progressbar" aria-label="Coverage" aria-valuenow={86}>    86%  </div></>
<div class="progress-ring progress-ring-sm" role="progressbar" aria-label="Upload" aria-valuenow="40"></div><div class="progress-ring" role="progressbar" aria-label="Storage used" aria-valuenow="64">64</div><div class="progress-ring progress-ring-lg" role="progressbar" aria-label="Steps done" aria-valuenow="3" aria-valuemax="8" aria-valuetext="3 of 8">  3/8</div><div class="progress-ring progress-ring-xl" role="progressbar" aria-label="Coverage" aria-valuenow="86">  86%</div>
<template>  <div class="progress-ring progress-ring-sm" role="progressbar" aria-label="Upload" aria-valuenow="40"></div>  <div class="progress-ring" role="progressbar" aria-label="Storage used" aria-valuenow="64">    64  </div>  <div class="progress-ring progress-ring-lg" role="progressbar" aria-label="Steps done" aria-valuenow="3" aria-valuemax="8" aria-valuetext="3 of 8">    3/8  </div>  <div class="progress-ring progress-ring-xl" role="progressbar" aria-label="Coverage" aria-valuenow="86">    86%  </div></template>

aria-valuenow가 없으면 진행률을 알 수 없는 상태이며, 원의 4분의 1 길이인 호가 트랙을 따라 움직입니다. 원형 진행률로 상태를 나타낼 때는 --progress-ring-color를 상태 색상으로 설정하고, 옆에 상태를 텍스트로 표시하세요.

원형 진행률 상태

<div class="progress-ring" role="progressbar" aria-label="Preparing"></div><div class="progress-ring progress-ring-lg" role="progressbar" aria-label="Checks passed" aria-valuenow="100" style="--progress-ring-color: var(--color-success)">  100</div><div class="progress-ring progress-ring-lg" role="progressbar" aria-label="Quota used" aria-valuenow="92" style="--progress-ring-color: var(--color-danger)">  92</div>
<>  <div className="progress-ring" role="progressbar" aria-label="Preparing"></div>  <div className="progress-ring progress-ring-lg" role="progressbar" aria-label="Checks passed" aria-valuenow={100} style={{ '--progress-ring-color': 'var(--color-success)' } as React.CSSProperties}>    100  </div>  <div className="progress-ring progress-ring-lg" role="progressbar" aria-label="Quota used" aria-valuenow={92} style={{ '--progress-ring-color': 'var(--color-danger)' } as React.CSSProperties}>    92  </div></>
<div class="progress-ring" role="progressbar" aria-label="Preparing"></div><div class="progress-ring progress-ring-lg" role="progressbar" aria-label="Checks passed" aria-valuenow="100" style="--progress-ring-color: var(--color-success)">  100</div><div class="progress-ring progress-ring-lg" role="progressbar" aria-label="Quota used" aria-valuenow="92" style="--progress-ring-color: var(--color-danger)">  92</div>
<template>  <div class="progress-ring" role="progressbar" aria-label="Preparing"></div>  <div class="progress-ring progress-ring-lg" role="progressbar" aria-label="Checks passed" aria-valuenow="100" style="--progress-ring-color: var(--color-success)">    100  </div>  <div class="progress-ring progress-ring-lg" role="progressbar" aria-label="Quota used" aria-valuenow="92" style="--progress-ring-color: var(--color-danger)">    92  </div></template>

#진행률 값 표시

진행률 표시줄 자체에는 숫자가 표시되지 않습니다. 값이 바뀌어도 위치가 흔들리지 않도록 레이블 옆에 고정 폭 숫자로 표시하세요.

진행률 값 표시

<div class="flex flex-col gap-xs">  <div class="flex items-baseline justify-between text-sm">    <span class="fg-text-strong" id="backup-label">Uploading the backup</span>    <span class="fg-text-muted">7.4 of 10 GB</span>  </div>  <progress class="progress" value="7.4" max="10" aria-labelledby="backup-label">74%</progress></div>
<div className="flex flex-col gap-xs">  <div className="flex items-baseline justify-between text-sm">    <span className="fg-text-strong" id="backup-label">Uploading the backup</span>    <span className="fg-text-muted">7.4 of 10 GB</span>  </div>  <progress className="progress" value="7.4" max="10" aria-labelledby="backup-label">74%</progress></div>
<div class="flex flex-col gap-xs">  <div class="flex items-baseline justify-between text-sm">    <span class="fg-text-strong" id="backup-label">Uploading the backup</span>    <span class="fg-text-muted">7.4 of 10 GB</span>  </div>  <progress class="progress" value="7.4" max="10" aria-labelledby="backup-label">74%</progress></div>
<template>  <div class="flex flex-col gap-xs">    <div class="flex items-baseline justify-between text-sm">      <span class="fg-text-strong" id="backup-label">Uploading the backup</span>      <span class="fg-text-muted">7.4 of 10 GB</span>    </div>    <progress class="progress" value="7.4" max="10" aria-labelledby="backup-label">74%</progress>  </div></template>

#끝 지점 위의 표시

progress-label은 진행률 막대와 progress-marker를 담습니다. 표시는 채워진 부분의 끝을 따라 이동합니다. 작은 표시판에 수치가 표시되고, 표시판의 뾰족한 끝은 채워진 부분의 끝에 닿습니다. 뾰족한 끝이 막대 위에서 가리키는 비율에 맞춰 표시판 본체가 그 아래에서 옆으로 이동하므로, 0%와 100%에서도 막대 범위 안에 머물러 컨테이너를 벗어나지 않습니다. 막대 위에 표시를 위한 공간이 확보되며, progress-label-below를 지정하면 막대 아래에 공간이 확보됩니다.

끝 지점 위의 표시

<div class="progress-label" style="--progress-value: 62">  <progress class="progress" value="62" max="100" aria-label="Uploading the archive">62%</progress>  <span class="progress-marker" aria-hidden="true">62%</span></div><div class="progress-label progress-label-below" style="--progress-value: 96">  <progress class="progress" value="96" max="100" aria-label="Indexing">96%</progress>  <span class="progress-marker" aria-hidden="true">96%</span></div>
<>  <div className="progress-label" style={{ '--progress-value': '62' } as React.CSSProperties}>    <progress className="progress" value="62" max="100" aria-label="Uploading the archive">      62%    </progress>    <span className="progress-marker" aria-hidden="true">62%</span>  </div>  <div className="progress-label progress-label-below" style={{ '--progress-value': '96' } as React.CSSProperties}>    <progress className="progress" value="96" max="100" aria-label="Indexing">96%</progress>    <span className="progress-marker" aria-hidden="true">96%</span>  </div></>
<div class="progress-label" style="--progress-value: 62">  <progress class="progress" value="62" max="100" aria-label="Uploading the archive">62%</progress>  <span class="progress-marker" aria-hidden="true">62%</span></div><div class="progress-label progress-label-below" style="--progress-value: 96">  <progress class="progress" value="96" max="100" aria-label="Indexing">96%</progress>  <span class="progress-marker" aria-hidden="true">96%</span></div>
<template>  <div class="progress-label" style="--progress-value: 62">    <progress class="progress" value="62" max="100" aria-label="Uploading the archive">      62%    </progress>    <span class="progress-marker" aria-hidden="true">62%</span>  </div>  <div class="progress-label progress-label-below" style="--progress-value: 96">    <progress class="progress" value="96" max="100" aria-label="Indexing">96%</progress>    <span class="progress-marker" aria-hidden="true">96%</span>  </div></template>

의미는 막대가 전달하고 표시에는 aria-hidden을 지정합니다. --progress-value에는 막대의 값을 백분율로 설정하고 value 옆에 함께 작성하세요. 렌더러는 두 값을 한 번에 작성합니다. 진행률 미정 막대에는 값이 없으므로 표시가 나타나지 않습니다. 표시는 채워진 부분과 함께 부드럽게 이동하며, 동작 줄이기 설정에서는 즉시 이동합니다.

#반원형 진행률

progress-ring-half는 원형 진행률의 위쪽 절반인 아치를 따라 값을 그리고, 그 안에 수치를 표시합니다. 점수, 할당량, 목표 달성률 등에 사용합니다. 아치의 양 끝과 채워진 호의 끝은 둥글게 표시됩니다. aria-valuenow가 없으면 값을 알 수 없는 상태가 되어, 아치 길이의 4분의 1에 해당하는 호가 한쪽 끝에서 다른 쪽 끝으로 이동합니다.

반원형 진행률

<div class="progress-ring progress-ring-half progress-ring-xl" role="progressbar" aria-label="Storage used" aria-valuenow="72" style="--progress-ring-value: 72">  72%</div><div class="progress-ring progress-ring-half progress-ring-lg" role="progressbar" aria-label="Seats taken" aria-valuenow="18" aria-valuemax="40" style="--progress-ring-value: 18; --progress-ring-max: 40">  18</div><div class="progress-ring progress-ring-half progress-ring-lg" role="progressbar" aria-label="Estimating"></div>
<>  <div className="progress-ring progress-ring-half progress-ring-xl" role="progressbar" aria-label="Storage used" aria-valuenow={72} style={{ '--progress-ring-value': '72' } as React.CSSProperties}>    72%  </div>  <div className="progress-ring progress-ring-half progress-ring-lg" role="progressbar" aria-label="Seats taken" aria-valuenow={18} aria-valuemax={40} style={{ '--progress-ring-value': '18', '--progress-ring-max': '40' } as React.CSSProperties}>    18  </div>  <div className="progress-ring progress-ring-half progress-ring-lg" role="progressbar" aria-label="Estimating"></div></>
<div class="progress-ring progress-ring-half progress-ring-xl" role="progressbar" aria-label="Storage used" aria-valuenow="72" style="--progress-ring-value: 72">  72%</div><div class="progress-ring progress-ring-half progress-ring-lg" role="progressbar" aria-label="Seats taken" aria-valuenow="18" aria-valuemax="40" style="--progress-ring-value: 18; --progress-ring-max: 40">  18</div><div class="progress-ring progress-ring-half progress-ring-lg" role="progressbar" aria-label="Estimating"></div>
<template>  <div class="progress-ring progress-ring-half progress-ring-xl" role="progressbar" aria-label="Storage used" aria-valuenow="72" style="--progress-ring-value: 72">    72%  </div>  <div class="progress-ring progress-ring-half progress-ring-lg" role="progressbar" aria-label="Seats taken" aria-valuenow="18" aria-valuemax="40" style="--progress-ring-value: 18; --progress-ring-max: 40">    18  </div>  <div class="progress-ring progress-ring-half progress-ring-lg" role="progressbar" aria-label="Estimating"></div></template>

#접근성

  • field 레이블, aria-label 또는 aria-labelledby를 사용해 진행률 표시줄에 레이블을 지정하세요.
  • <progress> 안의 텍스트는 해당 요소를 렌더링하지 않는 브라우저를 위한 폴백입니다.
  • 진행률 표시줄이 로딩 중인 영역의 진행 상황을 나타내면, 로딩이 끝날 때까지 해당 영역에 aria-busy="true"를 설정하세요.

#클래스

클래스설명
progress레이블이 있는 네이티브 progress 요소로 표시하는 진행 표시줄입니다. 6px 높이의 트랙을 전경색으로 채우며, 값이 바뀔 때마다 채워진 길이가 부드럽게 변합니다. 요소 내부의 텍스트는 폴백입니다.
progress-sm목록의 한 행에 쓰는 4px 트랙입니다. 기본값은 6px입니다.적용할 클래스는 progress입니다
progress-lg8px 트랙입니다. 기본값은 6px입니다.적용할 클래스는 progress입니다
progress-segmented개수를 표시할 때 트랙을 --progress-steps에 지정한 수만큼 같은 크기로 나눕니다. 기본값은 5입니다. --progress-steps를 max와 같은 값으로 설정하세요적용할 클래스는 progress입니다
progress-label진행률 막대와 채워진 부분의 끝 위에 놓이는 progress-marker를 담으며, 막대 위에 표시를 위한 공간을 확보합니다. --progress-value에 막대의 값을 백분율로 설정하세요.
progress-label-below표시를 막대 위가 아니라 아래에 둡니다적용할 클래스는 progress-label입니다
progress-marker끝이 뾰족한 작은 시트 위의 수치로, 뾰족한 끝이 채워진 부분의 끝에 닿습니다. 시트가 뾰족한 끝 아래에서 미끄러지므로 막대의 양 끝 안에 머뭅니다. 값은 막대가 전달하므로 aria-hidden으로 숨기세요. 진행률 미정 막대에서는 표시되지 않습니다.
progress-ringrole="progressbar"가 지정된 요소에 표시하는 지름 40px의 링입니다. 요소에 접근 가능한 이름을 지정하고 진행 값은 aria-valuenow에 넣습니다. 요소 자체의 콘텐츠는 링 가운데에 레이블로 표시됩니다
progress-ring-half원형의 위쪽 절반인 아치를 따라 값을 그리며, 양 끝이 둥글고 아치 안에 수치가 놓입니다. aria-valuenow가 없으면 아치의 4분의 1 길이가 한쪽 끝에서 다른 쪽 끝으로 이동합니다.적용할 클래스는 progress-ring입니다
progress-ring-sm지름 20px의 링입니다. 기본값은 40px입니다.적용할 클래스는 progress-ring입니다
progress-ring-lg지름 64px의 링입니다. 기본값은 40px입니다.적용할 클래스는 progress-ring입니다
progress-ring-xl가운데에 더 큰 숫자를 표시하는 지름 96px의 링입니다. 기본값은 40px입니다.적용할 클래스는 progress-ring입니다

#사용자 지정 속성

속성기본값설명
--progress-height.375rem트랙 두께progress에 설정합니다
--progress-colorvar(--color-surface-inverse)채움 색상progress에 설정합니다
--progress-steps5트랙을 나누는 구간 수입니다. max와 같은 값으로 설정하세요.progress-segmented에 설정합니다
--progress-value0표시에 사용할 막대의 값을 최댓값 대비 백분율로 나타낸 값으로, 페이지가 막대의 value 옆에 함께 작성합니다progress-label에 설정합니다
--progress-ring-value링이 나타내는 값입니다. 타입을 지정하는 attr()을 지원하는 환경에서는 aria-valuenow에서 가져오며, 그 외에는 직접 설정하세요.progress-ring에 설정합니다
--progress-ring-max100링이 한 바퀴를 채울 때의 값입니다. 타입을 지정한 attr()을 지원하는 환경에서는 aria-valuemax에서 가져오며, 그 밖의 환경에서는 직접 설정하세요.progress-ring에 설정합니다
--progress-ring-size2.5rem링의 지름progress-ring에 설정합니다
--progress-ring-widthmax(2px, calc(var(--progress-ring-size) / 10))링의 두께는 크기의 10분의 1이며, 최소 2px입니다.progress-ring에 설정합니다
--progress-ring-colorvar(--color-surface-inverse)원호의 색상입니다. 링이 상태를 나타낼 때는 해당 상태의 색상으로 설정하세요.progress-ring에 설정합니다

#소스

@master/ui/components/progress.css
/* * Progress: a native <progress> drawn as a thin well that fills with ink. * Without a value it is indeterminate: a band of ink travels along the track. * A ring draws the same amount around a circle, for a tile, a row or the corner of a card; a half ring draws * it along an arch, with the figure standing in the arch. * * progress-label holds a bar and a marker that rides the end of its fill: a small sheet with the figure and a * point that touches the end. The marker slides along under the point, as far as the point is along the bar, * so at 0 and at 100 it stays inside the bar's ends and never leaves its container. The bar is still the * semantics; the marker is aria-hidden and reads --progress-value, the same amount, which the page writes * beside the bar's value. An indeterminate bar has no amount, so its marker is not shown. */@property --progress-ring-value {  syntax: '<number>';  inherits: true;  initial-value: 0;}@property --progress-ring-from {  syntax: '<number>';  inherits: true;  initial-value: 0;}@layer components.ui {  .progress {    --progress-height: .375rem;    --progress-color: var(--color-surface-inverse);    display: block;    width: 100%;    height: var(--progress-height);    margin: 0;    border: 0;    border-radius: 999px;    overflow: hidden;    background: var(--color-surface-inset);    box-shadow: var(--shadow-pressed);    vertical-align: middle;    appearance: none;    &::-webkit-progress-bar {      background: transparent;    }    /* The fill keeps a round end and eases to each new value. */    &::-webkit-progress-value {      border-radius: 999px;      background: var(--progress-color);      transition: inline-size var(--duration-base) var(--easing-glide);    }    &::-moz-progress-bar {      border-radius: 999px;      background: var(--progress-color);    }    &:indeterminate {      background:        linear-gradient(90deg, transparent, var(--progress-color) 30%, var(--progress-color) 70%, transparent) 0 0 / 40% 100% no-repeat,        var(--color-surface-inset);      /* Linear: an eased loop would rest at its ends, where the band is outside the track. */      animation: progress-travel 1.2s linear infinite;    }    &:indeterminate::-webkit-progress-value {      background: transparent;    }    &:indeterminate::-moz-progress-bar {      background: transparent;    }    /* Right to left, the band travels the way the bar fills. */    &:indeterminate:dir(rtl) {      animation-direction: reverse;    }    &.progress-sm { --progress-height: .25rem; }    &.progress-lg { --progress-height: .5rem; }    /*     * Segmented: the track is cut into --progress-steps equal pieces, for a count of things: four of five     * steps, three of four checks. The cut is a mask over the well and its fill alike, so the pieces stay     * in step with each other; their ends are square and the track's own corner is small to match.     */    &.progress-segmented {      --progress-steps: 5;      --progress-gap: 3px;      border-radius: 1.5px;      /* A piece that is still empty is counted too, so the well takes a tint of the fill and holds on any surface. */      background: color-mix(in oklab, var(--progress-color) 20%, var(--color-surface-inset));      mask: linear-gradient(90deg, black calc(100% - var(--progress-gap)), transparent 0) 0 0 / calc((100% + var(--progress-gap)) / var(--progress-steps)) 100%;      &::-webkit-progress-value {        border-radius: 0;      }      &::-moz-progress-bar {        border-radius: 0;      }    }    @media (prefers-reduced-motion: reduce) {      &::-webkit-progress-value {        transition: none;      }      /* Without travel, an even half tone says the amount is unknown. */      &:indeterminate {        background: color-mix(in oklab, var(--progress-color) 30%, var(--color-surface-inset));        animation: none;      }    }    @media (forced-colors: active) {      --progress-color: Highlight;      outline: 1px solid CanvasText;      outline-offset: -1px;      forced-color-adjust: none;      background: Canvas;      /* A piece not yet reached is the system's gray, as a ring's track is; the inset tint would be an author color. */      &.progress-segmented {        background-color: GrayText;      }      /* The band travels over the canvas, not over the author's well, which the rule above it would otherwise keep. */      &:indeterminate {        background-color: Canvas;      }      @media (prefers-reduced-motion: reduce) {        &:indeterminate {          background: GrayText;        }      }    }  }  /*   * A bar with a marker over its end, or under it with progress-label-below. The room for the marker is kept   * above or below the bar, so the marker never covers what stands next to it.   */  .progress-label {    --progress-value: 0;    --progress-marker-height: 1.5rem;    --progress-marker-gap: .5rem;    position: relative;    display: block;    min-width: 0;    padding-block-start: calc(var(--progress-marker-height) + var(--progress-marker-gap));    &.progress-label-below {      padding-block: 0 calc(var(--progress-marker-height) + var(--progress-marker-gap));    }    /* No amount, no figure. */    &:has(.progress:indeterminate) {      padding-block: 0;      .progress-marker {        display: none;      }    }  }  /*   * The figure over the end of the fill: a small sheet whose point touches the end. The point sits as far along   * the sheet as the end is along the bar, so the sheet slides under it and stays inside the bar's ends.   */  .progress-marker {    --progress-marker-at: clamp(0, var(--progress-value), 100);    position: absolute;    inset-block-start: 0;    inset-inline-start: calc(var(--progress-marker-at) * 1%);    display: inline-grid;    place-items: center;    box-sizing: border-box;    height: var(--progress-marker-height);    padding: 0 .5rem;    translate: calc(var(--progress-marker-at) * -1%) 0;    border-radius: calc(var(--radius-control-sm) * var(--corner-scale));    corner-shape: var(--corner-shape);    @apply --surface-sheet;    color: var(--color-text-strong);    box-shadow: var(--shadow-raised);    font: var(--font-weight-control) .75rem/1 var(--font-family-sans);    font-feature-settings: inherit;    font-variant-numeric: tabular-nums;    white-space: nowrap;    transition-property: inset-inline-start, translate;    transition-duration: var(--duration-base);    transition-timing-function: var(--easing-glide);    &:dir(rtl) {      translate: calc(var(--progress-marker-at) * 1%) 0;    }    /*     * The point: a small square turned on its corner, the sheet's own face, with a contour on its two lower     * sides only, so it grows out of the sheet without a seam. It stays a point's width in from the corners.     */    &::after {      content: '';      position: absolute;      inset-block-start: calc(100% - .25rem);      inset-inline-start: clamp(.5rem, calc(var(--progress-marker-at) * 1%), calc(100% - .5rem));      width: .5rem;      height: .5rem;      translate: -50% 0;      rotate: 45deg;      background: var(--color-surface-raised-low);      box-shadow: inset -.5px -.5px 0 var(--color-line-contour);    }    &:dir(rtl)::after {      translate: 50% 0;    }    .progress-label-below & {      inset-block: auto 0;      &::after {        inset-block: auto calc(100% - .25rem);        background: var(--color-surface-raised);        box-shadow: inset .5px .5px 0 var(--color-line-contour);      }    }    @media (prefers-reduced-motion: reduce) {      transition: none;    }    @media (forced-colors: active) {      outline: 1px solid CanvasText;      outline-offset: -1px;      &::after {        display: none;      }    }  }  /*   * Ring: an element with role="progressbar". Where the browser supports typed attr(), the ring reads   * aria-valuenow and aria-valuemax itself, so the amount is written once, for people and for the drawing;   * elsewhere set --progress-ring-value. Both ends of the arc are round, and the arc eases to each new value.   * Without aria-valuenow the amount is unknown: a quarter arc travels the track.   * The element's own content is the label in the middle.   */  .progress-ring {    --progress-ring-size: 2.5rem;    --progress-ring-width: max(2px, calc(var(--progress-ring-size) / 10));    --progress-ring-color: var(--color-surface-inverse);    --progress-ring-track: color-mix(in oklab, var(--progress-ring-color) 11%, transparent);    --progress-ring-max: 100;    /* As far round as the amount is of the whole, held between nothing and all of it, as a gauge's share is. */    --progress-ring-turn: clamp(0, calc(var(--progress-ring-value) / var(--progress-ring-max)), 1);    position: relative;    display: inline-grid;    flex: none;    place-items: center;    width: var(--progress-ring-size);    height: var(--progress-ring-size);    color: var(--color-text-strong);    font: var(--font-weight-control) calc(var(--progress-ring-size) * .27)/1 var(--font-family-sans);    font-feature-settings: inherit;    font-variant-numeric: tabular-nums;    letter-spacing: -.01em;    vertical-align: middle;    transition: --progress-ring-value var(--duration-base) var(--easing-glide);    @supports (x: attr(x type(*))) {      &[aria-valuenow] {        --progress-ring-value: attr(aria-valuenow type(<number>), 0);      }      &[aria-valuemax] {        --progress-ring-max: attr(aria-valuemax type(<number>), 100);      }    }    /*     * The drawing: an arc from a conic gradient, a dot at each end to round it, and a mask that keeps the ring.     * The dots have no radius at zero, so an empty ring is an empty track.     */    &::before {      --progress-ring-radius: calc((var(--progress-ring-size) - var(--progress-ring-width)) / 2);      --progress-ring-cap: calc(var(--progress-ring-width) / 2 * min(1, var(--progress-ring-turn) * 200));      content: '';      position: absolute;      inset: 0;      border-radius: 999px;      background:        radial-gradient(circle at 50% calc(var(--progress-ring-width) / 2), var(--progress-ring-color) calc(var(--progress-ring-cap) - .5px), transparent var(--progress-ring-cap)),        radial-gradient(circle at calc(50% + var(--progress-ring-radius) * sin(var(--progress-ring-turn) * 360deg)) calc(50% - var(--progress-ring-radius) * cos(var(--progress-ring-turn) * 360deg)), var(--progress-ring-color) calc(var(--progress-ring-cap) - .5px), transparent var(--progress-ring-cap)),        conic-gradient(var(--progress-ring-color) calc(var(--progress-ring-turn) * 360deg), var(--progress-ring-track) 0);      mask: radial-gradient(farthest-side, transparent calc(100% - var(--progress-ring-width) - .5px), black calc(100% - var(--progress-ring-width)), black calc(100% - .5px), transparent);    }    &:not([aria-valuenow]) {      --progress-ring-value: 25;      --progress-ring-max: 100;      &::before {        animation: progress-ring-travel .9s linear infinite;      }    }    /*     * Half: the amount along an arch, from its start to its end, with the figure standing in the arch. The arch     * is the top half of the ring; its two ends and the end of the arc are round. The track's start takes the     * arc's color while the arc begins there and holds any amount, so the arc begins with a round end too.     */    &.progress-ring-half {      height: calc(var(--progress-ring-size) / 2 + var(--progress-ring-width) / 2);      place-items: end center;      font-size: calc(var(--progress-ring-size) * .2);      &::before {        --progress-ring-radius: calc((var(--progress-ring-size) - var(--progress-ring-width)) / 2);        --progress-ring-from-angle: calc(var(--progress-ring-from) * 180deg - 90deg);        --progress-ring-to-angle: calc((var(--progress-ring-from) + var(--progress-ring-turn)) * 180deg - 90deg);        --progress-ring-start: color-mix(in oklab, var(--progress-ring-color) calc(min(1, var(--progress-ring-turn) * 1000) * (1 - min(1, var(--progress-ring-from) * 1000)) * 100%), var(--progress-ring-track));        inset: 0 0 auto;        height: var(--progress-ring-size);        background:          radial-gradient(circle at calc(50% + var(--progress-ring-radius) * sin(var(--progress-ring-from-angle))) calc(50% - var(--progress-ring-radius) * cos(var(--progress-ring-from-angle))), var(--progress-ring-color) calc(var(--progress-ring-cap) - .5px), transparent var(--progress-ring-cap)),          radial-gradient(circle at calc(50% + var(--progress-ring-radius) * sin(var(--progress-ring-to-angle))) calc(50% - var(--progress-ring-radius) * cos(var(--progress-ring-to-angle))), var(--progress-ring-color) calc(var(--progress-ring-cap) - .5px), transparent var(--progress-ring-cap)),          conic-gradient(from -90deg,            var(--progress-ring-track) 0 calc(var(--progress-ring-from) * 180deg),            var(--progress-ring-color) 0 calc((var(--progress-ring-from) + var(--progress-ring-turn)) * 180deg),            var(--progress-ring-track) 0 200deg,            transparent 0 340deg,            var(--progress-ring-start) 0);        mask:          radial-gradient(circle at 50% 100%, transparent calc(var(--progress-ring-radius) - var(--progress-ring-width) / 2 - .5px), black calc(var(--progress-ring-radius) - var(--progress-ring-width) / 2), black calc(var(--progress-ring-radius) + var(--progress-ring-width) / 2 - .5px), transparent calc(var(--progress-ring-radius) + var(--progress-ring-width) / 2)) top / 100% 50% no-repeat,          radial-gradient(circle at calc(var(--progress-ring-width) / 2) 50%, black calc(var(--progress-ring-width) / 2 - .5px), transparent calc(var(--progress-ring-width) / 2)),          radial-gradient(circle at calc(100% - var(--progress-ring-width) / 2) 50%, black calc(var(--progress-ring-width) / 2 - .5px), transparent calc(var(--progress-ring-width) / 2));        border-radius: 0;      }      /* No amount: a quarter of the arch travels from one end to the other and back. */      &:not([aria-valuenow])::before {        animation: progress-half-travel 1.4s var(--easing-glide) infinite alternate;      }    }    &.progress-ring-sm {      --progress-ring-size: 1.25rem;      --progress-ring-width: 2.5px;    }    &.progress-ring-lg {      --progress-ring-size: 4rem;      --progress-ring-width: 5px;    }    &.progress-ring-xl {      --progress-ring-size: 6rem;      --progress-ring-width: 6px;      font-size: 1.375rem;      letter-spacing: -.02em;    }    @media (prefers-reduced-motion: reduce) {      transition: none;      &:not([aria-valuenow])::before,      &.progress-ring-half:not([aria-valuenow])::before {        animation-duration: 2.4s;      }    }    /* Kept out of forced colors for the drawing, so the figure in the middle takes the system's text color itself. */    @media (forced-colors: active) {      --progress-ring-color: Highlight;      --progress-ring-track: GrayText;      forced-color-adjust: none;      color: CanvasText;    }  }}@keyframes progress-half-travel {  from {    --progress-ring-from: 0;  }  to {    --progress-ring-from: .75;  }}@keyframes progress-ring-travel {  to {    rotate: 360deg;  }}@keyframes progress-travel {  from {    background-position: -67% 0, 0 0;  }  to {    background-position: 167% 0, 0 0;  }}