# @font-palette-values

> The `@font-palette-values` CSS directive allows the definition of font palette values to control the color palette used by a font.

## How do I change the colors of a color font with CSS?

The directive that defines a custom color palette for a color font, overriding chosen colors of its built-in palettes. The palette is applied with the `font-palette` property, letting multi-color icon or emoji fonts match a site's colors.

- Topic: Directives
- Type: directive
- Browser support: Chrome 101+, Chrome Android 101+, Edge 101+, Firefox 107+, Firefox Android 107+, Safari 15.4+, Safari iOS 15.4+

## Example

Wrong:

```css
.title {
  font-family: "Bungee Spice";
  color: crimson;
}
```

Right:

```css
@font-palette-values --warm {
  font-family: "Bungee Spice";
  override-colors: 0 crimson, 1 gold;
}
.title {
  font-family: "Bungee Spice";
  font-palette: --warm;
}
```

`color` does not recolor a color font; a custom palette overrides its built-in colors by index.

## Common mistakes

- Applying a palette to a regular font, which has no color layers.
- Using a palette name without `--`, which is invalid.

## Key points

- The rule names `font-family` exactly as declared in `@font-face`.
- The palette name starts with `--` and is applied through `font-palette`.

## Interview questions

### What does `base-palette` do?

It picks one of the palettes built into the font as the starting point, by index, before `override-colors` applies.

### Can I switch font palettes for dark mode?

Yes, set a different `font-palette` inside a `prefers-color-scheme: dark` media query.

## Related cards

- [@font-face](https://wonderium.dev/css/font-face.md)
- [font-family](https://wonderium.dev/css/font-family.md)
- [color-scheme](https://wonderium.dev/css/color-scheme.md)
- [color()](https://wonderium.dev/css/color.md)

---

- Level: [CSS](https://wonderium.dev/css.md)
- HTML version: https://wonderium.dev/css/font-palette-values
- Last updated: 2026-11-25
