Skip to content

Multi-Flavor Mode

Running Whiskers without the --flavor/-f flag causes it to run in multi-flavor mode. In this mode, all flavors are placed into the template context as a map of flavor identifiers to their respective Flavor objects.

This map can be iterated like so:

{% for id, flavor in flavors %}
{{id}} is one of "latte", "frappe", "macchiato", or "mocha".
{{flavor}} is an object containing the flavor's properties and colors.
{% endfor %}

For example, a template generating a single JSON file with all flavors:

example.tera
---
whiskers:
version: "^X.Y.Z"
filename: "example.json"
---
{
"themes": [
{%- for id, flavor in flavors %}
{
"id": "catppuccin-{{id}}",
"name": "Catppuccin {{flavor.name}}",
"fg": "{{css_rgb(color=flavor.colors.text)}}",
"bg": "{{css_rgb(color=flavor.colors.base)}}",
"invert": {{flavor.dark}},
"dark-mode": {{flavor.dark}}
}{% if not loop.last %},{% endif %}
{%- endfor %}
]
}