Path: blob/main/files/en-us/web/css/@font-palette-values/index.md
6519 views
------{{CSSRef}}
The @font-palette-values CSS at-rule allows you to customize the default values of font-palette created by the font-maker.
Syntax
The <dashed-ident> is a user defined identifier, that while it looks like a CSS custom property behaves in a different way and is not wrapped in a CSS var() function.
Descriptors
: Specifies the name of the font family that this palette can be applied to.
: Specifies the name or index of the base-palette, created by the font-maker, to use.
: Specifies the colors in the base palette to override.
Formal definition
{{cssinfo}}
Formal syntax
{{csssyntax}}
Examples
Overriding colors in an existing palette
This example shows how you can change some or all of the colors in a color font.
HTML
CSS
Result
When overriding colors of the normal or base-palette at index 0 you do not need to declare which base-palette to use. This should only be done when overriding a different base-palette. If you are overriding all the colors then there is also no need to specify the base-palette to use.
{{EmbedLiveSample("Overriding colors in an existing palette")}}
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
{{cssxref("font-palette", "font-palette")}} property
{{cssxref("@font-palette-values/font-family", "font-family")}} descriptor
{{cssxref("@font-palette-values/base-palette", "base-palette")}} descriptor
{{cssxref("@font-palette-values/override-colors", "override-colors")}} descriptor