CSSCounterStyleRule: system 属性

Baseline 2023
新推出

自 2023 年 9 月起,此功能可在最新的设备和浏览器版本上使用。此功能可能无法在较旧的设备或浏览器上使用。

CSSCounterStyleRule 接口的 system 属性用于获取和设置 system 描述符的值。如果该描述符没有设置值,则此属性返回一个空字符串。

字符串。

示例

下面的示例展示了一个 @counter-style 规则。在 JavaScript 中,myRules[0] 是这个 @counter-style 规则,返回 system 会得到值 "fixed"。

css
@counter-style box-corner {
  system: fixed;
  symbols: ◰ ◳ ◲ ◱;
  suffix: ": ";
}
js
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].system); // "fixed"

规范

规范
CSS Counter Styles Level 3
# dom-csscounterstylerule-system

浏览器兼容性