タイポグラフィ
マーク
注目してほしい語句をハイライトします。
このページの内容
マークは、検索結果の一致箇所やレビューで指摘された語句など、その場で注目すべきテキストをハイライトします。専用の色は使わず、文字色を薄く敷くため、どの背景でも読みやすく、ステータス色の視認性も損ないません。ネイティブの<mark>に.markを指定します。
マーク
<ul class="flex flex-col gap-xs m(0) p(0) text-sm fg-text-body"> <li class="flex"><span><mark class="mark">Moon</mark>stone palette</span></li> <li class="flex"><span>Half-<mark class="mark">moon</mark> icon</span></li> <li class="flex"><span>Phases of the <mark class="mark">moon</mark>, a field guide</span></li></ul><ul className="flex flex-col gap-xs m(0) p(0) text-sm fg-text-body"> <li className="flex"><span><mark className="mark">Moon</mark>stone palette</span></li> <li className="flex"><span>Half-<mark className="mark">moon</mark> icon</span></li> <li className="flex"> <span>Phases of the <mark className="mark">moon</mark>, a field guide</span> </li></ul><ul class="flex flex-col gap-xs m(0) p(0) text-sm fg-text-body"> <li class="flex"><span><mark class="mark">Moon</mark>stone palette</span></li> <li class="flex"><span>Half-<mark class="mark">moon</mark> icon</span></li> <li class="flex"><span>Phases of the <mark class="mark">moon</mark>, a field guide</span></li></ul><template> <ul class="flex flex-col gap-xs m(0) p(0) text-sm fg-text-body"> <li class="flex"><span><mark class="mark">Moon</mark>stone palette</span></li> <li class="flex"><span>Half-<mark class="mark">moon</mark> icon</span></li> <li class="flex"><span>Phases of the <mark class="mark">moon</mark>, a field guide</span></li> </ul></template>リストボックス、コンボボックス、コマンドパレットでは、入力に合わせて各選択肢の一致箇所をマークで囲みます。
#現在の一致箇所
ページ内検索のように一致箇所を順にたどる場合は、現在の箇所にaria-current="true"を指定します。背景が文字色で塗りつぶされます。
現在の一致箇所
<p class="m(0) max-w(420) text-sm leading-md fg-text-body"> Corners nest by their <mark class="mark">inset</mark>: a container's radius is its content's radius plus the <mark class="mark" aria-current="true">inset</mark> between them, so the gap keeps one width around the bend. A button 4px inside a well takes the well's radius minus that <mark class="mark">inset</mark>.</p><p className="m(0) max-w(420) text-sm leading-md fg-text-body"> Corners nest by their <mark className="mark">inset</mark>: a container's radius is its content's radius plus the <mark className="mark" aria-current="true">inset</mark> between them, so the gap keeps one width around the bend. A button 4px inside a well takes the well's radius minus that <mark className="mark">inset</mark>.</p><p class="m(0) max-w(420) text-sm leading-md fg-text-body"> Corners nest by their <mark class="mark">inset</mark>: a container's radius is its content's radius plus the <mark class="mark" aria-current="true">inset</mark> between them, so the gap keeps one width around the bend. A button 4px inside a well takes the well's radius minus that <mark class="mark">inset</mark>.</p><template> <p class="m(0) max-w(420) text-sm leading-md fg-text-body"> Corners nest by their <mark class="mark">inset</mark>: a container's radius is its content's radius plus the <mark class="mark" aria-current="true">inset</mark> between them, so the gap keeps one width around the bend. A button 4px inside a well takes the well's radius minus that <mark class="mark">inset</mark>. </p></template>#ブランドカラーと下線
mark-brandはブランドカラーを薄く敷き、ページの主題となるひとつの語句を強調します。mark-underlineは文字の下に太い下線を引きます。ブラウザーが文字の背面に描画し、折り返した先の行にも下線が付きます。
ブランドカラーと下線
<p class="m(0) max-w(420) text-md leading-md fg-text-strong"> Native HTML and CSS components with <mark class="mark mark-brand">no runtime</mark>, built on the platform and <mark class="mark mark-underline">finished by hand, one component at a time</mark>.</p><p className="m(0) max-w(420) text-md leading-md fg-text-strong"> Native HTML and CSS components with <mark className="mark mark-brand">no runtime</mark>, built on the platform and <mark className="mark mark-underline">finished by hand, one component at a time</mark>.</p><p class="m(0) max-w(420) text-md leading-md fg-text-strong"> Native HTML and CSS components with <mark class="mark mark-brand">no runtime</mark>, built on the platform and <mark class="mark mark-underline">finished by hand, one component at a time</mark>.</p><template> <p class="m(0) max-w(420) text-md leading-md fg-text-strong"> Native HTML and CSS components with <mark class="mark mark-brand">no runtime</mark>, built on the platform and <mark class="mark mark-underline">finished by hand, one component at a time</mark>. </p></template>#アクセシビリティ
<mark>は「この文脈に関連する」ことを示します。重要性を示すには<strong>を使います。ほとんどのスクリーンリーダーはマークを読み上げないため、結果の意味がハイライトだけに頼らず伝わるようにします。- マークは元の文字色を維持し、その色を不透明度約10%で背景に敷くため、コントラストを保てます。強制カラーモードでは、システムの
MarkとMarkTextを使います。 - マークが折り返されても、各行のパディングと角丸は維持されます。
#クラス
| クラス | 説明 |
|---|---|
mark | 周囲のテキストと同じ色を語句の背景に淡く適用 |
mark-brand | ページの主題を表す 1 つの語句に使う、淡いブランド色の背景mark と併用します |
mark-underline | 語句の背景を塗る代わりに、語句の下端に引く太い線mark と併用します |