@@ -6963,13 +6963,14 @@ as well as the colored versions.
6963
6963
6964
6964
<pre class="propdef">
6965
6965
Name : font-palette
6966
- Value : normal | light | dark | <<palette-identifier>>
6966
+ Value : normal | light | dark | <<palette-identifier>> | <<palette-mix()>>
6967
6967
Initial : normal
6968
6968
Applies to : all elements and text
6969
6969
Inherited : yes
6970
6970
Percentages : N/a
6971
- Computed value : specified keyword or identifier
6972
- Animation type : discrete
6971
+ Computed value : specified keyword, identifier or <<palette-mix()>> function.
6972
+ <<palette-mix>> must be simplified to a single keyword or identifier if resulting palette is equivalent.
6973
+ Animation type : by computed value
6973
6974
</pre>
6974
6975
6975
6976
<wpt>
@@ -7022,6 +7023,12 @@ Animation type: discrete
7022
7023
parsing/font-palette-valid.html
7023
7024
</wpt>
7024
7025
7026
+ With the <code> palette-mix()</code> function defined as follows:
7027
+
7028
+ <pre class="prod def" nohighlight>
7029
+ <dfn>palette-mix()</dfn> = palette-mix(<<color-interpolation-method>> , [ [normal | light | dark | <<palette-identifier>> | <<palette-mix()>> ] && <<percentage [0,100]>> ? ]#{2})
7030
+ </pre>
7031
+
7025
7032
<dl dfn-for=font-palette dfn-type=value>
7026
7033
<dt> <dfn>normal</dfn>
7027
7034
<dd>
@@ -7073,6 +7080,25 @@ Animation type: discrete
7073
7080
be a modification of an existing palette already present in the font,
7074
7081
or be an entirely new palette.
7075
7082
7083
+ <dt> <dfn type><<palette-mix()>></dfn>
7084
+ <dd>
7085
+ This value defines a position in the interpolation between two palette values,
7086
+ identified by <<palette-identifier>> , by the palette keywords
7087
+ ''font-palette/normal'' , ''font-palette/light'' , ''font-palette/dark'' ,
7088
+ or by another <<palette-mix()>> value.
7089
+
7090
+ The glyphs of the font must be rendered with a palette that is created by
7091
+ interpolating for each palette color index between the matching color indices
7092
+ of the first and second palette specified as arguments,
7093
+ recursively resolving <<palette-mix()>> functions if needed.
7094
+
7095
+ For each palette color, the interpolation follows
7096
+ the rules of the <<color-mix()>> function.
7097
+
7098
+ When not specified otherwise the <<color-interpolation-method>> is
7099
+ <code> in ''oklab'' </code> as recommended by [[css-color-5#interpolation-space]] .
7100
+
7101
+ Percentages are normalized according to [[css-color-5#color-mix-percent-norm]] .
7076
7102
</dl>
7077
7103
7078
7104
Note: The names 'light' and 'dark' describe the <i> background</i> the color palette is usable on,
@@ -7083,7 +7109,39 @@ Note: The names 'light' and 'dark' describe the <i>background</i> the color pale
7083
7109
.banner {font-palette: dark;
7084
7110
}
7085
7111
}
7086
- </pre>
7112
+ </pre>
7113
+ </div>
7114
+
7115
+ <div class="example" id="ex-bixa-palette">
7116
+ Animate between palettes.
7117
+
7118
+ <pre>
7119
+ @font-palette-values --pink {
7120
+ font-family: Nabla;
7121
+ base-palette: 1;
7122
+ }
7123
+ @font-palette-values --yellow {
7124
+ font-family: Nabla;
7125
+ base-palette: 7;
7126
+ }
7127
+ @keyframes animate-palette {
7128
+ from {
7129
+ font-palette: --yellow;
7130
+ }
7131
+ to {
7132
+ font-palette: --pink;
7133
+ }
7134
+ }
7135
+ p {
7136
+ font-family: Nabla;
7137
+ animation: animate-palette 1.4s infinite alternate linear;
7138
+ }
7139
+ </pre>
7140
+
7141
+ <figure>
7142
+ <img src="images/nabla-animated.webp" alt="The word Animate animated between a pink and a yellow palette."/>
7143
+ <figcaption> Nabla Color by typearture.com - animating between palettes 1 and 7 in the font.</figcaption>
7144
+ </figure>
7087
7145
</div>
7088
7146
7089
7147
0 commit comments