@adobe/focus-ring-polyfill 中文文档教程
Focus Ring Polyfill
:focus-ring
规范的 polyfill。
Usage
它类似于 WICG polyfill,但增加了对处理在箭头键或 Esc 之后以编程方式设置的焦点的支持,这是选项卡列表或对话框等控件所需要的。
应该与 postcss-focus-ring 插件一起使用,将 this: 转换
button:focus-ring {
/* focus-ring only stuff */
}
为 this:
button.focus-ring {
/* focus-ring only stuff */
}
This polyfill can then添加和删除此 .focus-ring
以模仿 :focus-ring
规范。
Contributing
Focus Ring Polyfill
A polyfill for the :focus-ring
spec.
Usage
It is similar to the WICG polyfill, but adds support for dealing with focus programmatically set after an Arrow key or Esc, which is needed for controls like tab lists or dialogs.
Should be used with the postcss-focus-ring plugin to convert this:
button:focus-ring {
/* focus-ring only stuff */
}
to this:
button.focus-ring {
/* focus-ring only stuff */
}
This polyfill can then add and remove this .focus-ring
to mimic the :focus-ring
spec.
Contributing
Sign the CLA, follow the contributing guidelines, and ask any questions that might arise.