Skip to content

Context Variables Reference

These are all of the context variables available to use in your templates, alongside all of the existing Tera built-ins.

VariableDescription
flavor (Flavor)The flavor being templated.
rosewater, flamingo, pink, etc. (Color)All colors of the flavor being templated.
Any FrontmatterAll frontmatter variables as described in the Frontmatter Reference.
VariableDescription
flavors
(Map<String, Flavor>)
An array containing all of the named flavors, with every other context variable.
Any FrontmatterAll frontmatter variables as described in the Frontmatter Reference.

These types are designed to closely match the palette.json.

  • Description: The name of the flavor.
  • Type: String
  • Examples: "Latte", "Frappé", "Macchiato", "Mocha"
  • Description: The identifier of the flavor.
  • Type: String
  • Examples: "latte", "frappe", "macchiato", "mocha"
  • Description: Emoji associated with the flavor.
  • Type: char
  • Examples: '🌻', '🪴', '🌺', '🌿'
  • Description: Order of the flavor in the palette spec.
  • Type: u32
  • Examples: 0 to 3
  • Description: Whether the flavor is dark.
  • Type: bool
  • Examples: false for Latte, true for others
  • Description: Whether the flavor is light.
  • Type: bool
  • Examples: true for Latte, false for others
  • Description: A map of color identifiers to their respective values.
  • Type: Map<String,Color>
  • Description: The name of the color.
  • Type: String
  • Examples: "Rosewater", "Surface 0", "Base"
  • Description: The identifier of the color.
  • Type: String
  • Examples: "rosewater", "surface0", "base"
  • Description: Order of the color in the palette spec.
  • Type: u32
  • Examples: 0 to 25
  • Description: Whether the color is an accent color.
  • Type: bool
  • Description: The color in hexadecimal format.
  • Type: String
  • Examples: "1e1e2e"
  • Description: Big-endian 24-bit color in RGB order.
  • Type: u32
  • Examples: 1973806
  • Description: Big-endian unsigned 32-bit color in ARGB order.
  • Type: u32
  • Examples: 4280163886
  • Description: Big-endian signed 32-bit color in ARGB order.
  • Type: i32
  • Examples: -14803410
  • Description: The color in RGB format.
  • Type: RGB
  • Description: The color in HSL format.
  • Type: HSL
  • Description: The opacity of the color.
  • Type: u8
  • Examples: 0 to 255
  • Description: The red channel of the color.
  • Type: u8
  • Description: The green channel of the color.
  • Type: u8
  • Description: The blue channel of the color.
  • Type: u8
  • Description: The hue of the color.
  • Type: u16
  • Description: The saturation of the color.
  • Type: u8
  • Description: The lightness of the color.
  • Type: u8