原创 Google 2025-03-21 17:31 北京
Chrome 133 带来了多项更新,包括 CSS 高级 attr() 函数、CSS 滚动状态容器查询以及更精细的文本垂直对齐控制,提升了网页开发的灵活性和控制力。
CSS 高级 attr() 函数
<div data-foo="blue">test</div>
div {
color: attr(data-foo type(<color>), red);
}
CSS 滚动状态容器查询
{
scroll-state; :
position: sticky;
top: 0px;
nav {
scroll-state(stuck: top) {
background: Highlight;
color: HighlightText;
}
}
}
CSS text-box、text-box-trim 以及 text-box-edge
h1 {
/* trim both sides to the capital letters */
text-box: trim-both cap alphabetic;
/* trim both sides to the lowercase letter x */
text-box: trim-both ex alphabetic;
}
更多内容
Animation.overallProgress 为您提供一种便捷且一致的方式,用以表示动画在其迭代过程中的进度,且不受时间线类型的影响。
Node.prototype.moveBefore 允许您在 DOM 树中移动元素,而无需重置元素的状态。
FileSystemObserver 接口会向网站通知文件系统的更改。
PublicKeyCredential getClientCapabilities() 方法让您可以确定用户的客户端支持哪些 WebAuthn 功能。
持续关注