语法
css
@font-palette-values --one {
base-palette: 1;
}
base-palette 描述符使用字体制造商创建的调色板的零基索引来指定。
值
<index>-
指定要使用的预定义调色板的索引。
正式定义
| 相关的 at-rule | @font-palette-values |
|---|---|
| 初始值 | n/a(必需) |
| 计算值 | 同指定值 |
正式语法
base-palette =
light |
dark |
<integer [0,∞]>
示例
更改字体中的默认调色板
使用 Rocher Color Font,此示例显示了两次将字体中的默认调色板切换到字体制造商创建的备用调色板。
HTML
html
<h2>default base-palette</h2>
<h2 class="two">base-palette at index 2</h2>
<h2 class="five">base-palette at index 5</h2>
CSS
css
@font-face {
font-family: "Rocher";
src: url("[path-to-font]/RocherColorGX.woff2") format("woff2");
}
h2 {
font-family: "Rocher", fantasy;
}
@font-palette-values --two {
font-family: "Rocher";
base-palette: 2;
}
@font-palette-values --five {
font-family: "Rocher";
base-palette: 5;
}
.two {
font-palette: --two;
}
.five {
font-palette: --five;
}
结果

规范
| 规范 |
|---|
| CSS 字体模块第 4 级 # base-palette-desc |
浏览器兼容性
加载中…