palette-mix() CSS Function
The palette-mix() function creates a new font palette by blending two palettes of a color font, used with font-palette.
Description
The palette-mix() CSS function creates a new font palette by blending two existing palettes of a color font. It is used as a value of the font-palette property. Color fonts, such as many emoji and display fonts, can contain several built-in palettes, and authors can define their own with @font-palette-values; palette-mix() interpolates between two of them.
The first argument is a <color-interpolation-method>, such as in oklab, which sets the color space used for blending. It is followed by two palettes, each of which can be normal, light, dark, the name of a palette defined with @font-palette-values, or another palette-mix(). Each palette can have a percentage that sets how much of it is used; like color-mix(), missing percentages are filled in so the total is 100%.
The main use of palette-mix() is animation: because font-palette can be transitioned, browsers interpolate between palettes using palette-mix() internally, and you can also set intermediate palettes directly. It is supported in Chromium-based browsers only.
@font-palette-values --warm {
font-family: "Bungee Spice";
base-palette: 0;
}
@font-palette-values --cool {
font-family: "Bungee Spice";
override-colors: 0 #2563eb, 1 #06b6d4;
}
h1 {
font-family: "Bungee Spice";
font-palette: palette-mix(in oklab, --warm 60%, --cool);
}
Syntax
palette-mix() = palette-mix( <color-interpolation-method>, [ [ normal | light | dark | <palette-identifier> | <palette-mix()> ] && <percentage [0,100]>? ]#{2} )Values
- <color-interpolation-method>The color space used to blend the palette colors, for example in oklab or in srgb.
- paletteEach of the two palettes to mix: normal, light, dark, a <dashed-ident> defined with @font-palette-values, or another palette-mix().
- <percentage>Optional. How much of each palette to use. Missing percentages are calculated so the total is 100%.
Example
Browser Support
The following information will show you the current browser support for the CSS palette-mix() function. Hover over a browser icon to see the version that first introduced support for this CSS function.
Desktop





Tablets & Mobile





