操作
連結
沿用句子的文字顏色,帶使用者前往其他位置。
本頁內容
連結帶使用者前往其他位置,並沿用所在句子的文字顏色。在單色介面中,連結以底線辨識。平時底線較淡,指標移上時會加深至文字的顏色。將 .link 加在 <a> 上。
連結
<p class="m(0) text-sm fg-text-body leading-md"> Master UI reads Master CSS tokens. Start with the <a class="link" href="#installation">installation guide</a>, then read how the <a class="link" href="#theme">theme</a> is built.</p><p className="m(0) text-sm fg-text-body leading-md"> Master UI reads Master CSS tokens. Start with the <a className="link" href="#installation">installation guide</a>, then read how the <a className="link" href="#theme">theme</a> is built.</p><p class="m(0) text-sm fg-text-body leading-md"> Master UI reads Master CSS tokens. Start with the <a class="link" href="#installation">installation guide</a>, then read how the <a class="link" href="#theme">theme</a> is built.</p><template> <p class="m(0) text-sm fg-text-body leading-md"> Master UI reads Master CSS tokens. Start with the <a class="link" href="#installation">installation guide</a>, then read how the <a class="link" href="#theme">theme</a> is built. </p></template>#低調樣式
link-quiet 沿用周圍的文字顏色,互動時才顯示底線。適合用在頁尾、中繼資料或導覽清單,避免一整排連結讓頁面布滿底線。連結的位置或措辭仍須讓使用者看得出它是連結。
低調樣式
<nav class="flex gap-md text-sm fg-text-muted" aria-label="Footer"> <a class="link link-quiet" href="#docs">Docs</a> <a class="link link-quiet" href="#changelog">Changelog</a> <a class="link link-quiet" href="#license">License</a></nav><nav className="flex gap-md text-sm fg-text-muted" aria-label="Footer"> <a className="link link-quiet" href="#docs">Docs</a> <a className="link link-quiet" href="#changelog">Changelog</a> <a className="link link-quiet" href="#license">License</a></nav><nav class="flex gap-md text-sm fg-text-muted" aria-label="Footer"> <a class="link link-quiet" href="#docs">Docs</a> <a class="link link-quiet" href="#changelog">Changelog</a> <a class="link link-quiet" href="#license">License</a></nav><template> <nav class="flex gap-md text-sm fg-text-muted" aria-label="Footer"> <a class="link link-quiet" href="#docs">Docs</a> <a class="link link-quiet" href="#changelog">Changelog</a> <a class="link link-quiet" href="#license">License</a> </nav></template>#新分頁
帶有 target="_blank" 的連結會顯示一個向外的小箭頭,提示使用者即將開啟新分頁。箭頭屬於裝飾,請在連結的無障礙名稱或可見文字中寫明「在新分頁開啟」,讓看不到箭頭的使用者也能得知。
新分頁
<p class="m(0) text-sm fg-text-body leading-md"> The corner shape follows the <a class="link" href="#spec" target="_blank" rel="noopener"> CSS Borders specification<span class="sr-only">(opens in a new tab)</span> </a>.</p><p className="m(0) text-sm fg-text-body leading-md"> The corner shape follows the <a className="link" href="#spec" target="_blank" rel="noopener"> CSS Borders specification<span className="sr-only">(opens in a new tab)</span> </a>.</p><p class="m(0) text-sm fg-text-body leading-md"> The corner shape follows the <a class="link" href="#spec" target="_blank" rel="noopener"> CSS Borders specification<span class="sr-only">(opens in a new tab)</span> </a>.</p><template> <p class="m(0) text-sm fg-text-body leading-md"> The corner shape follows the <a class="link" href="#spec" target="_blank" rel="noopener"> CSS Borders specification<span class="sr-only">(opens in a new tab)</span> </a>. </p></template>#連結或按鈕
連結用來導覽,按鈕用來執行動作。要讓導覽連結看起來像控制項,請在 <a> 上加上 btn。要在句子中提供「復原」之類的操作,請在 <button type="button"> 上加上 link,以保留按鈕的鍵盤操作方式與語意。
句子中的按鈕
<p class="m(0) text-sm fg-text-body"> The project was archived. <button type="button" class="link">Undo</button></p><p className="m(0) text-sm fg-text-body"> The project was archived. <button type="button" className="link">Undo</button></p><p class="m(0) text-sm fg-text-body"> The project was archived. <button type="button" class="link">Undo</button></p><template> <p class="m(0) text-sm fg-text-body"> The project was archived. <button type="button" class="link">Undo</button> </p></template>#類別
| 類別 | 說明 |
|---|---|
link | 帶底線的連結,使用醒目的文字色。指標移入時,底線會以與文字相同的顏色顯示 |
link-quiet | 沿用繼承的文字色,互動時才顯示底線,適合頁尾、中繼資料和導覽清單搭配 link 使用 |