發布日期:2025 年 9 月 2 日
Chrome 140 現已推出,這篇文章將介紹這個版本的部分主要功能。請參閱完整的 Chrome 140 版本資訊。
這個版本的重要功能包括:
- 瞭解是哪個元素觸發
ToggleEvent
。 - 在
content
屬性的替代文字中使用counter()
和counters()
。 - 在
@font-face
規則中找出對font-variation-settings
描述元的支援。
瞭解觸發 ToggleEvent
的元素
ToggleEvent
的 source
屬性包含觸發 ToggleEvent
觸發的元素 (如適用)。
舉例來說,如果使用者點選 popovertarget
或 commandfor
屬性設為開啟快顯視窗的 <button>
元素,快顯視窗上觸發的 ToggleEvent
來源屬性會設為叫用 <button>
。
在 content
屬性的替代文字中使用 counter()
和 counters()
這項功能可讓您在 content
屬性的替代文字中使用 counter()
和 counters()
。提供更有意義的資訊,提升無障礙功能。
@font-face
規則現已支援 font-variation-settings
描述元
您可以使用個別元素的 font-variation-settings
屬性,透過 CSS 調整字型的粗細、寬度、傾斜度和其他軸。@font-face
中的 font-variation-settings
CSS 描述元可讓您在 @font-face
at 規則中執行相同操作。這個描述元的屬性值與 font-variation-settings
屬性相同,但全域關鍵字值除外。
@font-face {
font-family: "OpenTypeFont";
src: url("open_type_font.woff2") format("woff2");
font-variation-settings:
"wght" 400,
"wdth" 300;
}
延伸閱讀
這份文件僅涵蓋部分重點。如要瞭解 Chrome 140 的其他變更,請參閱下列連結。
訂閱
如要掌握最新資訊,請訂閱 Chrome 開發人員 YouTube 頻道,這樣每當我們發布新影片,您就會收到電子郵件通知。你也可以在 X 或 LinkedIn 上追蹤我們,查看新文章和網誌貼文。
Chrome 141 版發布後,我們會立即在此說明 Chrome 的新功能!