タイポグラフィ
出典参照
文中で出典を示す、小さな番号付きマーカー。
このページの内容
出典参照は、記述の末尾からその出典を参照できる、小さな番号付きマーカーです。リンクをチップと同じ色のカプセル形で表示し、文字より少し小さく、ベースラインよりわずかに上に配置します。ポインターを重ねたときと出典の表示中は、インク色で塗りつぶされます。
出典参照
<div class="max-w(480) mx-auto text-sm fg-text-body leading-md"> <p class="m(0)"> Corners are drawn as squircles where the browser has <code class="code">corner-shape</code><button type="button" class="citation" popovertarget="source-1" aria-label="Source 1">1</button><span class="popover" id="source-1" popover> <span class="flex flex-col gap-xs"> <span class="fg-text-strong font-medium"> CSS Borders and Box Decorations Module Level 4 </span><span class="fg-text-muted text-xs">W3C Working Draft · w3.org</span> </span> </span> and as circles elsewhere, with the radius scaled so both look equally round.<a class="citation" href="#ref-2" aria-label="Source 2">2</a><a class="citation" href="#ref-3" aria-label="Source 3">3</a> </p> <ol class="mt-md pl-md text-xs fg-text-muted"> <li>CSS Borders and Box Decorations Module Level 4</li> <li id="ref-2">Master UI theme guide, “Continuous corners”</li> <li id="ref-3">Figma, “Desperately seeking squircles”</li> </ol></div><div className="max-w(480) mx-auto text-sm fg-text-body leading-md"> <p className="m(0)"> Corners are drawn as squircles where the browser has <code className="code">corner-shape</code><button type="button" className="citation" popoverTarget="source-1" aria-label="Source 1"> 1 </button><span className="popover" id="source-1" popover=""> <span className="flex flex-col gap-xs"> <span className="fg-text-strong font-medium"> CSS Borders and Box Decorations Module Level 4 </span><span className="fg-text-muted text-xs">W3C Working Draft · w3.org</span> </span> </span> and as circles elsewhere, with the radius scaled so both look equally round.<a className="citation" href="#ref-2" aria-label="Source 2">2</a><a className="citation" href="#ref-3" aria-label="Source 3">3</a> </p> <ol className="mt-md pl-md text-xs fg-text-muted"> <li>CSS Borders and Box Decorations Module Level 4</li> <li id="ref-2">Master UI theme guide, “Continuous corners”</li> <li id="ref-3">Figma, “Desperately seeking squircles”</li> </ol></div><div class="max-w(480) mx-auto text-sm fg-text-body leading-md"> <p class="m(0)"> Corners are drawn as squircles where the browser has <code class="code">corner-shape</code><button type="button" class="citation" popovertarget="source-1" aria-label="Source 1">1</button><span class="popover" id="source-1" popover> <span class="flex flex-col gap-xs"> <span class="fg-text-strong font-medium"> CSS Borders and Box Decorations Module Level 4 </span><span class="fg-text-muted text-xs">W3C Working Draft · w3.org</span> </span> </span> and as circles elsewhere, with the radius scaled so both look equally round.<a class="citation" href="#ref-2" aria-label="Source 2">2</a><a class="citation" href="#ref-3" aria-label="Source 3">3</a> </p> <ol class="mt-md pl-md text-xs fg-text-muted"> <li>CSS Borders and Box Decorations Module Level 4</li> <li id="ref-2">Master UI theme guide, “Continuous corners”</li> <li id="ref-3">Figma, “Desperately seeking squircles”</li> </ol></div><template> <div class="max-w(480) mx-auto text-sm fg-text-body leading-md"> <p class="m(0)"> Corners are drawn as squircles where the browser has <code class="code">corner-shape</code><button type="button" class="citation" popovertarget="source-1" aria-label="Source 1"> 1 </button><span class="popover" id="source-1" popover> <span class="flex flex-col gap-xs"> <span class="fg-text-strong font-medium"> CSS Borders and Box Decorations Module Level 4 </span><span class="fg-text-muted text-xs">W3C Working Draft · w3.org</span> </span> </span> and as circles elsewhere, with the radius scaled so both look equally round.<a class="citation" href="#ref-2" aria-label="Source 2">2</a><a class="citation" href="#ref-3" aria-label="Source 3">3</a> </p> <ol class="mt-md pl-md text-xs fg-text-muted"> <li>CSS Borders and Box Decorations Module Level 4</li> <li id="ref-2">Master UI theme guide, “Continuous corners”</li> <li id="ref-3">Figma, “Desperately seeking squircles”</li> </ol> </div></template>最初のマーカーはポップオーバーで出典を開き、残りは出典一覧へ移動します。
#参照先
出典の参照先は2通りあり、どちらもスクリプトなしで使えます。
- 出典一覧は、通常、回答や記事の末尾に置きます。マーカーには
<a>を使い、そのhrefに一覧項目のIDを指すフラグメントを指定します。 - ポップオーバー に出典のタイトルと掲載元を表示します。マーカーには
popovertargetを指定した<button>を使い、ポップオーバーの直前に置きます。ポップオーバーを開いている間は、マーカーが塗りつぶされたままになります。段落内に<div>は置けないため、段落内のポップオーバーには<span>を使います。
マーカーの前には空白を入れません。インライン要素なので、直前の語と一緒に折り返され、マーカーだけが行頭に来ることはありません。
#アクセシビリティ
- 各マーカーには、番号だけでなく、参照先がわかるアクセシブルな名前が必要です。各マーカーに「出典2」や出典のタイトルなどを
aria-labelで指定します。 - マーカーを使わずに出典を確認できるようにします。ポップオーバーをいくつも開くより、一覧でひと目で確認できるほうが便利です。
- マーカーは小さく、番号にはコントロールと同じ文字の太さで等幅数字を使います。操作領域は、マーカーを含むテキストのサイズに合わせて広がります。
#クラス
| クラス | 説明 |
|---|---|
citation | マークには、href が出典の id を指す<a>、または対応するポップオーバーの直前に記述した popovertarget 付きの<button>を使います。「出典 2」などのaria-labelを付けます。 |