語法
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 |
瀏覽器相容性
載入中…