文字排版
提及
句子中被點名的人、團隊或事物。
本頁內容
提及用於在句子裡點名某個人、團隊或事物,例如 @Ada、#design 或議題編號。它沿用句子的字型和文字顏色,採用控制項的字重,並以淡淡的同色底襯托。提及沒有外框,因此可和行內程式碼區分。
提及
<div class="flex flex-col max-w(440) mx-auto"> <div class="message"> <div class="message-bubble"> <a class="mention" href="#">@Ada Lovelace</a> the build for <a class="mention" href="#">#412</a> is green. Can <a class="mention mention-self" href="#">@you</a> review it before <span class="mention">Friday</span>? </div> </div> <div class="message message-sent"> <div class="message-bubble"> On it. I will loop in <a class="mention" href="#">@design</a> for the corners. </div> </div></div><div className="flex flex-col max-w(440) mx-auto"> <div className="message"> <div className="message-bubble"> <a className="mention" href="#">@Ada Lovelace</a> the build for <a className="mention" href="#">#412</a> is green. Can <a className="mention mention-self" href="#">@you</a> review it before <span className="mention">Friday</span>? </div> </div> <div className="message message-sent"> <div className="message-bubble"> On it. I will loop in <a className="mention" href="#">@design</a> for the corners. </div> </div></div><div class="flex flex-col max-w(440) mx-auto"> <div class="message"> <div class="message-bubble"> <a class="mention" href="#">@Ada Lovelace</a> the build for <a class="mention" href="#">#412</a> is green. Can <a class="mention mention-self" href="#">@you</a> review it before <span class="mention">Friday</span>? </div> </div> <div class="message message-sent"> <div class="message-bubble"> On it. I will loop in <a class="mention" href="#">@design</a> for the corners. </div> </div></div><template> <div class="flex flex-col max-w(440) mx-auto"> <div class="message"> <div class="message-bubble"> <a class="mention" href="#">@Ada Lovelace</a> the build for <a class="mention" href="#">#412</a> is green. Can <a class="mention mention-self" href="#">@you</a> review it before <span class="mention">Friday</span>? </div> </div> <div class="message message-sent"> <div class="message-bubble"> On it. I will loop in <a class="mention" href="#">@design</a> for the corners. </div> </div> </div></template>#連結或文字
用在 <a> 上時,提及可連到個人資料或議題,指標移到上方時底色會加深。用在 <span> 上時,提及只會凸顯一段文字,例如剖析器辨識出的日期。樣式表用 :any-link 區分兩者,讓連結樣式只出現在可開啟的項目上。
#讀者自己的名字
mention-self 會以稍深的底色和細邊框標出讀者本人,讓讀者在長串對話中一眼找到自己的名字。它和其他提及一樣沿用文字色,色調差異刻意做得很細微,因此請在文字中直接寫出「你」或讀者的名字。
#在文字中使用
提及不會在中間換行。底色和細邊框都以目前的文字顏色調配,因此在句子清楚可讀的地方,提及也同樣清楚。例如在使用深色底的已傳送訊息裡,名字會沿用氣泡內的淺色文字,並襯上淡淡的淺色底。
#無障礙
- 符號是文字的一部分。請直接把
@或#寫在元素內,讓複製或朗讀時都保留完整的提及文字。 - 可開啟個人資料的提及使用連結即可,無須額外設定角色。
#類別
| 類別 | 說明 |
|---|---|
mention | 名稱沿用所在句子的字體樣式和文字色,字重採用控制項的設定,背景則使用同色系的淡色。名稱會維持在同一行,若為連結,指標移入時背景色會加深。 |
mention-self | 讀者自己的名稱以較濃的底色和細線標示。搭配 mention 使用 |