Open anjia opened 5 years ago
3118, [css-text-decor-4] Rethinking text-underline-offset
涉及规范:CSS Text Decoration Module Level 4
text-underline-offset
定义了下划线从它 initial position 的 offset
text-underline-position
,有对应关系 auto
时才会由UA自行决定auto | from-font | <length>
from-font
是 Level 4 新增的,它可让author决定UA是否用字体本身带的下划线信息
text-underline-position
auto | under | left | right
under
在元素的 text content 之下。此时下划线不会超过descender。也叫accounting下划线under
Chrome 33+ 已经支持了该提议里提到的问题:
text-underline-offset:from-font
和text-underline-position:under
用同一元素时似乎无意义
from-font
可以解析成0;或者算出字体下划线的最佳位置和baseline的距离-用它作为offset的值text-underline-offset
让它的值可以是个百分比,这样就能根据字体大小而响应式了
一个包含了很多Web组件的网页,可能同一个组件用了多次。但是每个组件却分别有个样式表<style>
或者<link>
,实在是有点 redundant,也不利于渲染引擎优化内存,也不利于组件构造的速度
大多数组件都用 Shadow DOM,目前是必须向 shadow root 指定一个<style>
。问题就是:
之前的解决方案 Shadow Piercing,虽然避免了在每一个 Shadow DOM 里都要一个 style 元素,但是封装性不好了。它现在已经从规范里移除了。
所以本次提议了这个。
Constructable Stylesheet Objects 定义了CSSOM的附加功能,使 StyleSheet 对象可以直接构造,也提供了对应的方法和API,以便在自定义元素、相似元素的上下文中,更容易处理样式表。
它提供了一个API,可以在脚本里创建样式表对象,而不需要 style 元素。脚本可以选择 add/remove 规则,从一个 stylesheet object。每一个 stylesheet object 可以被添加到同文档中的任意多个 shadow roots。
使用:
CSSStylesheet
都被绑到了它构建的Document
,需要是同一个document tree。DocumentOrShadowRoot
也会自动生效adoptedStyleSheets
位置后点,所以优先级高点,和DocumentOrShadowRoot
的style sheets相比。https://discourse.wicg.io/t/proposal-constructable-stylesheet-objects/2572 https://github.com/WICG/construct-stylesheets/blob/gh-pages/explainer.md
1月底2月初正式提了一次。Blink 和 Mozilla 很感兴趣
2017年chromium有个bug说 shadow tree 里的StyleElement::processStyleSheet()
还可以更快。
https://bugs.chromium.org/p/chromium/issues/detail?id=712080
2016年11月4日,(二者的具体区别,未细看) https://tabatkins.github.io/specs/construct-stylesheets/
2016.3.30 在 w3c/webcomponents 报了个 Issue:给自定义元素提供一种轻量的机制来添加样式 Provide a lightweight mechanism to add styles to a custom element #468
空间导航,使用箭头键移动焦点。不是单纯地用Tab键按顺序导航,而是根据位置来。
目的是将Web技术适普到其它领域,eg.TV, IVI, game console, smart devices, a11y下的PC和mobile。
规范目前是
ED
,Editors 是:
- Jihye Hong (LG Electronics)
- Florian Rivoal (Invited Expert)
它能:
grid
布局, float
这会让Tab键的顺序导航变得会不可预测其它:
CSS Environment Variables 允许获取和使用 browser- 和 author- 定义的全局变量,比如 typography, color, notch 和其它 specific layout/device 的值。它用在 Media Queries 里。
有人提到说它算是从 cascade 里独立出来 CSS variables,好处是:
与 CSS 的自定义属性和
var()
类似
CSS Custom Properties 不能和 media queries 和 selectors 一起工作的原因,据说是因为它是 cascade 的,会导致一些很奇怪的无线循环的逻辑。
所以,不能用于MQ的真正原因是什么
另,The Notch 缺口,凹槽。就是iphone的刘海。
<meta name="viewport" content="viewport-fit=cover">
。
如果想解决 the notch 的问题是
evn()
提出来的最初原因,那...
- 设计本身...
- 设备特定的问题。在其它浏览器上也有类似的问题吗?
详见: https://drafts.csswg.org/css-env-1/ https://css-tricks.com/the-notch-and-css/
p.s.
var()
增加个参数什么的
Schedule 见 TPAC 2018 / CSS WG
Proposed Agenda
src:local()
font 唯一名字匹配 ambiguous & restricts matched localeIdea
<style>/<link>
里使用 CSSStyleSheets 吗?ED
text-spacing
属性FPWD
ED
共4个