文字排版
醒目標記
像螢光筆一樣標出值得留意的文字。
本頁內容
醒目標記像螢光筆一樣,標出值得留意的文字,例如搜尋結果中相符的部分,或審閱者指出的詞句。它以低不透明度的文字色作為底色,讓標出的文字在各種背景上都清楚可讀,也不會干擾狀態色的辨識。請將 .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 | 用淡淡的品牌色凸顯整頁的核心詞句。搭配 mark 使用 |
mark-underline | 用文字底部的粗線取代淡色底。搭配 mark 使用 |