ナビゲーション

v2.1.0
フィードバック

進捗

作業の進み具合に応じて色が伸びる細いバー。

このページの内容

進捗バーは、タスクがどこまで完了したかを示します。ネイティブの<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です。リストの行には4pxのprogress-smを使えます。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と同じ値に設定すると、各区画が1ステップに対応します。トラックと塗りの両方に同じマスクで区切りを入れるため、区画と進捗値が対応します。

区切り付き

<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-sm4pxのトラック。リストの行向け。既定は6pxprogress と併用します
progress-lg8px のトラック。既定は 6pxprogress と併用します
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-ring直径 40px のリング。要素に role="progressbar" とアクセシブルな名前を指定し、進捗値を aria-valuenow に設定します。要素の内容が中央のラベルになります。
progress-ring-halfリングの上半分のアーチに沿って進捗量を描画し、両端を丸め、数値をアーチの中に表示します。aria-valuenow がない場合は、アーチの 4 分の 1 の長さの円弧が端から端へ移動しますprogress-ring と併用します
progress-ring-sm20pxのリング。既定は40pxprogress-ring と併用します
progress-ring-lg64pxのリング。既定は40pxprogress-ring と併用します
progress-ring-xl中央の数字を大きくした96pxのリング。既定は40pxprogress-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リング 1 周分の値。型付き 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;  }}