排版
提及
句子中被点名的个人、团队或事物。
本页内容
提及用于在句中点出某个人、团队或事物,例如 @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 一同使用 |