### Install via AUR helpers
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/getting-started/installation.mdx
Installs the binary package from the Arch User Repository.
```console
yay -S catppuccin-whiskers-bin
```
```console
paru -S catppuccin-whiskers-bin
```
--------------------------------
### Install from crates.io
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/getting-started/installation.mdx
Installs the package using the Rust package manager.
```console
cargo install catppuccin-whiskers
```
--------------------------------
### Install via Homebrew
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/getting-started/installation.mdx
Installs the binary using the Homebrew package manager on macOS or Linux.
```console
brew install catppuccin/tap/whiskers
```
--------------------------------
### Install from source via Cargo
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/getting-started/installation.mdx
Installs the latest version directly from the GitHub repository.
```console
cargo install --git https://github.com/catppuccin/whiskers
```
--------------------------------
### Install Whiskers via Package Managers
Source: https://context7.com/catppuccin/whiskers/llms.txt
Install Whiskers using Homebrew, Cargo, Nix, or AUR. Ensure you have the necessary package managers installed.
```bash
# Via Homebrew (macOS/Linux)
brew install catppuccin/tap/whiskers
```
```bash
# Via Cargo (crates.io)
car go install catppuccin-whiskers
```
```bash
# Via Cargo (from source)
car go install --git https://github.com/catppuccin/whiskers
```
```bash
# Via Nix
nix shell nixpkgs#catppuccin-whiskers --command whiskers
```
```bash
# Via AUR (Arch Linux)
yay -S catppuccin-whiskers-bin
```
--------------------------------
### Install and run via Nix
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/getting-started/installation.mdx
Provides methods for managing the package using Nix.
```console
nix shell nixpkgs#catppuccin-whiskers --command whiskers
```
```console
nix profile add nixpkgs#catppuccin-whiskers
```
--------------------------------
### Matrix Mode: Flavor and Accent Combinations
Source: https://context7.com/catppuccin/whiskers/llms.txt
Generate files for all flavor and accent combinations. This example creates 56 files, one for each flavor-accent pair.
```bash
cat > accent-themes.tera << 'EOF'
---
whiskers:
version: "^2.9.0"
matrix:
- flavor
- accent
filename: "themes/{{ flavor.identifier }}/{{ accent }}.ini"
---
[theme]
name = Catppuccin {{ flavor.name }} ({{ accent }})
accent_color = #{{ flavor.colors[accent].hex }}
background = #{{ base.hex }}
foreground = #{{ text.hex }}
EOF
whiskers accent-themes.tera
```
```text
# Creates 56 files: themes/{latte,frappe,macchiato,mocha}/{rosewater,flamingo,...,lavender}.ini
```
--------------------------------
### Rendered Markdown Output Example
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/getting-started/quick-start.mdx
Example of the rendered markdown output for a single flavor, including color details in a table.
```markdown
Catppuccin Mocha
|
Labels |
Hex |
RGB |
HSL |
 |
Rosewater |
#f5e0dc |
rgb(245, 224, 220) |
hsl(10, 56%, 91%) |
 |
Flamingo |
#f2cdcd |
rgb(242, 205, 205) |
hsl(0, 59%, 88%) |
...
```
--------------------------------
### Install Tera parser in Neovim
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/resources/editor-integrations.mdx
Run this command within Neovim to install the tera parser via nvim-treesitter.
```console
:TSInstall tera
```
--------------------------------
### Matrix Mode: Flavor-based File Generation
Source: https://context7.com/catppuccin/whiskers/llms.txt
Generate multiple files from a single template using matrix combinations. This example generates a configuration file per flavor.
```bash
# Create a matrix template generating files per flavor
cat > matrix-theme.tera << 'EOF'
---
whiskers:
version: "^2.9.0"
matrix:
- flavor
filename: "themes/catppuccin-{{ flavor.identifier }}.cfg"
---
[colors]
name = Catppuccin {{ flavor.name }}
dark = {{ flavor.dark }}
background = {{ base.hex }}
foreground = {{ text.hex }}
accent = {{ mauve.hex }}
EOF
whiskers matrix-theme.tera
```
```text
# Creates:
# themes/catppuccin-latte.cfg
# themes/catppuccin-frappe.cfg
# themes/catppuccin-macchiato.cfg
# themes/catppuccin-mocha.cfg
```
--------------------------------
### Successful Template Rendering with `get` Filter
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/cookbook/using-filter-pipelines.mdx
This console output shows the successful rendering of a Whiskers template after correcting the syntax to use the `get` filter.
```console
$ whiskers -f mocha my-cool-template.txt
highlight = cdb1b9
```
--------------------------------
### Manual Whiskers Check Workflow
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/resources/github-actions.mdx
A manual workflow setup for Whiskers checks if a reusable workflow is not suitable. It includes steps for checking out the repository, setting up Whiskers, and running the check command.
```yaml
name: whiskers
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup Whiskers
uses: catppuccin/setup-whiskers@v2
- name: Check
run: |
whiskers --check
```
--------------------------------
### Initial Template Syntax (Incorrect)
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/cookbook/using-filter-pipelines.mdx
This is an example of an incorrect template syntax that will cause a parsing error. Parentheses are not allowed around filter pipelines for direct property access.
```txt
highlight = {{ (red | sub(saturation=60)).hex }}
```
--------------------------------
### Provide Template Input to Whiskers
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/guides/how-to-use-standard-input-and-output.mdx
Input a template string directly into the terminal after starting the Whiskers process.
```console
$ whiskers -
Catppuccin Mocha Red - {{flavors.mocha.colors.red.hex}}
```
--------------------------------
### Generate JSON with All Flavors - Input Template
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/concepts/multi-flavor.mdx
An example Tera template that generates a JSON file containing theme information for all available Catppuccin flavors. It iterates through the 'flavors' map to dynamically create theme entries.
```yaml
---
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 %}
]
}
```
--------------------------------
### Using the `get` Filter for Property Access
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/cookbook/using-filter-pipelines.mdx
This corrected template syntax uses the `get` filter to access the 'hex' property from the result of a filter pipeline. This is the recommended way to access properties when parentheses are not allowed.
```diff
- highlight = {{ (red | sub(saturation=60)).hex }}
+ highlight = {{ red | sub(saturation=60) | get(key="hex") }}
```
--------------------------------
### Custom Hex Format with Frontmatter
Source: https://context7.com/catppuccin/whiskers/llms.txt
Customize hexadecimal color output format using the `hex_format` frontmatter key. This example shows a BGR format with alpha. Requires the `whiskers` CLI tool.
```bash
cat > hex-format.tera << 'EOF'
---
whiskers:
version: "^2.9.0"
hex_format: "0x{{ B }}{{ G }}{{ R }}{{ A }}"
---
# BGR format with alpha (useful for some applications)
background = {{ base.hex }}
foreground = {{ text.hex }}
accent = {{ mauve.hex }}
EOF
whiskers hex-format.tera --flavor mocha
```
--------------------------------
### Accessing Nested Object Properties with `get`
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/cookbook/using-filter-pipelines.mdx
This template demonstrates how to chain the `get` filter to access nested properties within an object, such as retrieving the 'r' value from an 'rgb' object.
```txt
highlight_red = {{ red | sub(saturation=60) | get(key="rgb") | get(key="r") }}
```
--------------------------------
### Create Object with `object`
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/reference/functions.mdx
The `object` function creates an object from key-value pairs. Example: `object(a=1, b=2)` results in `{a: 1, b: 2}`.
```whiskers
object(a=1, b=2)
```
--------------------------------
### Fetch hex representation
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/reference/filters.mdx
Retrieves the hex string of a color, acting as a shortcut for get(key="hex").
```text
red | hex
```
--------------------------------
### Matrix Mode: Custom Variables
Source: https://context7.com/catppuccin/whiskers/llms.txt
Add custom iterables to the matrix for additional variations. This example generates files based on 'variant' (normal/no-italics), flavor, and accent.
```bash
cat > variants.tera << 'EOF'
---
whiskers:
version: "^2.9.0"
matrix:
- variant: ["normal", "no-italics"]
- flavor
- accent
filename: "themes/{{ flavor.identifier }}-{{ accent }}-{{ variant }}.ini"
---
# Catppuccin {{ flavor.name }}{% if variant == "no-italics" %} (no italics){% endif %}
[theme]
accent = #{{ flavor.colors[accent].hex }}
italics = {% if variant == "normal" %}true{% else %}false{% endif %}
EOF
whiskers variants.tera
```
--------------------------------
### Custom Frontmatter Variables for Theming
Source: https://context7.com/catppuccin/whiskers/llms.txt
Define custom variables in frontmatter for reusable configuration within Tera templates. This example sets theme-specific variables like accent color and border width. Requires the `whiskers` CLI tool.
```bash
cat > custom-vars.tera << 'EOF'
---
whiskers:
version: "^2.9.0"
filename: "app-theme.ini"
app: "MyApp"
author: "Developer"
accent: "mauve"
border_width: 2
---
{% set accent_color = flavor.colors[accent] %}
{% set dark_accent = accent_color | sub(lightness=20) %}
# {{ app }} Theme by {{ author }}
# Flavor: {{ flavor.name }}
[appearance]
accent = #{{ accent_color.hex }}
accent_dark = #{{ dark_accent.hex }}
background = #{{ base.hex }}
foreground = #{{ text.hex }}
border_width = {{ border_width }}
is_dark = {{ flavor.dark }}
EOF
whiskers custom-vars.tera --flavor mocha
```
--------------------------------
### Hex Filter
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/reference/filters.mdx
Fetches a color's hexadecimal representation. This is a shortcut for `get(key="hex")`.
```APIDOC
## `hex` Filter
### Description
Fetch a color's hex representation. Shortcut for `get(key="hex")`.
### Method
Filter
### Endpoint
N/A (Template Filter)
### Parameters
None
### Request Example
```
red | hex
```
### Response
#### Success Response
- **hex_color** (string) - The color's hexadecimal representation.
#### Response Example
```
"d20f39"
```
```
--------------------------------
### Conditional Logic with `if`
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/reference/functions.mdx
Use the `if` function to return one of two values based on a boolean condition. Example: `if(cond=true, t=1, f=0)` returns `1`.
```whiskers
if(cond=true, t=1, f=0)
```
--------------------------------
### Read File Contents with `read_file`
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/reference/functions.mdx
Reads and includes the content of a specified file. The path is relative to the template file. Example: `read_file(path="abc.txt")` returns `abc`.
```whiskers
read_file(path="abc.txt")
```
--------------------------------
### Rendering Nested Properties
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/cookbook/using-filter-pipelines.mdx
This console output shows the result of rendering a template that accesses nested object properties using chained `get` filters.
```console
$ whiskers -f mocha my-cool-template.txt
highlight_red = 205
```
--------------------------------
### Filter Pipelines with Hex Output
Source: https://context7.com/catppuccin/whiskers/llms.txt
Chain multiple color manipulation filters and use the `hex` filter to obtain the final hex value. The `get` filter can be used to extract nested properties. Requires the `whiskers` CLI tool.
```bash
cat > pipelines.tera << 'EOF'
---
whiskers:
version: "^2.9.0"
---
# Chained filter operations
highlight = #{{ red | sub(saturation=60) | hex }}
dimmed_accent = #{{ mauve | sub(lightness=20) | hex }}
warm_surface = #{{ surface0 | add(hue=15) | hex }}
# Get nested properties with get filter
red_value = {{ red | sub(saturation=60) | get(key="rgb") | get(key="r") }}
EOF
whiskers pipelines.tera --flavor mocha
```
--------------------------------
### Convert Color to RGB CSS with `css_rgb`
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/reference/functions.mdx
Converts a color value to an RGB CSS string. For example, `css_rgb(color=red)` outputs `rgb(210, 15, 57)`.
```whiskers
css_rgb(color=red)
```
--------------------------------
### Convert Color to RGBA CSS with `css_rgba`
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/reference/functions.mdx
Converts a color value to an RGBA CSS string, including an alpha channel. Example: `css_rgba(color=red)` yields `rgba(210, 15, 57, 1.00)`.
```whiskers
css_rgba(color=red)
```
--------------------------------
### Color Manipulation Filters in Tera
Source: https://context7.com/catppuccin/whiskers/llms.txt
Modify colors using add, sub, mod, and mix filters. Use the hex filter to get the final hex value. Requires the `whiskers` CLI tool.
```bash
cat > colors.tera << 'EOF'
---
whiskers:
version: "^2.9.0"
---
# Color Manipulation Examples for {{ flavor.name }}
# Original red
red = #{{ red.hex }}
# Add 30 degrees hue (shifts toward orange)
red_orange = #{{ red | add(hue=30) | hex }}
# Subtract 30 degrees hue (shifts toward pink)
red_pink = #{{ red | sub(hue=30) | hex }}
# Set lightness to 80%
red_light = #{{ red | mod(lightness=80) | hex }}
# Reduce saturation by 60
red_desaturated = #{{ red | sub(saturation=60) | hex }}
# Mix red with base at 50%
red_muted = #{{ red | mix(color=base, amount=0.5) | hex }}
# Set opacity to 50%
red_transparent = #{{ red | mod(opacity=0.5) | hex }}
EOF
whiskers colors.tera --flavor mocha
```
--------------------------------
### Convert Color to HSLA CSS with `css_hsla`
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/reference/functions.mdx
Converts a color value to an HSLA CSS string, including an alpha channel. Example: `css_hsla(color=red)` results in `hsla(347, 87%, 44%, 1.00)`.
```whiskers
css_hsla(color=red)
```
--------------------------------
### Using the Dedicated `hex` Filter
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/cookbook/using-filter-pipelines.mdx
This corrected template syntax utilizes the dedicated `hex` filter, which is a shortcut for accessing the 'hex' property of a color object. It simplifies the template compared to using `get(key="hex")`.
```diff
- highlight = {{ red | sub(saturation=60) | get(key="hex") }}
+ highlight = {{ red | sub(saturation=60) | hex }}
```
--------------------------------
### Configure GitHub Actions for Whiskers
Source: https://context7.com/catppuccin/whiskers/llms.txt
Automate template validation in CI/CD pipelines using the setup-whiskers action.
```yaml
# .github/workflows/whiskers-check.yml
name: whiskers
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup Whiskers
uses: catppuccin/setup-whiskers@v2
- name: Check templates
run: whiskers --check template.tera
```
--------------------------------
### Render Template via CLI
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/getting-started/quick-start.mdx
Command to execute the template rendering process in multi-flavor mode.
```console
whiskers palette.tera
```
--------------------------------
### Standard Input/Output Usage
Source: https://context7.com/catppuccin/whiskers/llms.txt
Pipe content directly into whiskers or use interactive mode for quick testing.
```bash
echo '{{ flavors.mocha.colors.red.hex }}' | whiskers -
whiskers -
cat template.tera | whiskers - --flavor latte > output.txt
```
--------------------------------
### Run Whiskers in Check Mode (Success)
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/concepts/check-mode.mdx
Execute Whiskers with the --check option and provide the expected output file path. A successful check results in no output and an exit code of 0.
```console
$ whiskers theme.tera latte --check themes/latte.cfg
(no output, exit code 0)
```
--------------------------------
### Render Whiskers Template from CLI
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/getting-started/quick-start.mdx
Use the whiskers CLI command to render a template for a specific flavor. The --flavor flag specifies the flavor to use.
```console
whiskers flavor.tera --flavor mocha
```
--------------------------------
### Execute Whiskers via Standard Input
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/guides/how-to-use-standard-input-and-output.mdx
Initiate the Whiskers CLI in interactive mode by passing a hyphen as the input argument.
```console
$ whiskers -
```
--------------------------------
### Generated JSON Output with All Flavors
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/concepts/multi-flavor.mdx
The resulting JSON output when the 'example.tera' template is processed by Whiskers in multi-flavor mode. It includes theme details for latte, frappe, macchiato, and mocha.
```json
{
"themes": [
{
"id": "catppuccin-latte",
"name": "Catppuccin Latte",
"fg": "rgb(76, 79, 105)",
"bg": "rgb(239, 241, 245)",
"invert": false,
"dark-mode": false
},
{
"id": "catppuccin-frappe",
"name": "Catppuccin Frappé",
"fg": "rgb(198, 208, 245)",
"bg": "rgb(48, 52, 70)",
"invert": true,
"dark-mode": true
},
{
"id": "catppuccin-macchiato",
"name": "Catppuccin Macchiato",
"fg": "rgb(202, 211, 245)",
"bg": "rgb(36, 39, 58)",
"invert": true,
"dark-mode": true
},
{
"id": "catppuccin-mocha",
"name": "Catppuccin Mocha",
"fg": "rgb(205, 214, 244)",
"bg": "rgb(30, 30, 46)",
"invert": true,
"dark-mode": true
}
]
}
```
--------------------------------
### Perform a Dry Run for Template Generation
Source: https://context7.com/catppuccin/whiskers/llms.txt
Preview template output without writing files to the disk.
```bash
cat > matrix.tera << 'EOF'
---
whiskers:
version: "^2.9.0"
matrix:
- flavor
filename: "themes/{{ flavor.identifier }}.cfg"
---
background = #{{ base.hex }}
EOF
# Preview without creating files
whiskers matrix.tera --dry-run
```
--------------------------------
### Iterate Over Flavors in Tera Template
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/concepts/multi-flavor.mdx
Demonstrates how to loop through all available flavors in a Tera template when running Whiskers in multi-flavor mode. Each iteration provides the flavor ID and its corresponding object.
```html
{% 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 %}
```
--------------------------------
### Single-Flavor Template Rendering
Source: https://context7.com/catppuccin/whiskers/llms.txt
Render a template for a single Catppuccin flavor using the `--flavor` flag. All colors are directly accessible by name.
```bash
# Create a simple theme template
cat > theme.tera << 'EOF'
---
whiskers:
version: "^2.9.0"
---
# Catppuccin {{ flavor.name }} Theme
background = #{{ base.hex }}
foreground = #{{ text.hex }}
cursor = #{{ rosewater.hex }}
selection_bg = #{{ surface2.hex }}
red = #{{ red.hex }}
green = #{{ green.hex }}
blue = #{{ blue.hex }}
EOF
# Render for Mocha flavor
whiskers theme.tera --flavor mocha
```
```text
# Output:
# # Catppuccin Mocha Theme
# background = #1e1e2e
# foreground = #cdd6f4
# cursor = #f5e0dc
# selection_bg = #585b70
# red = #f38ba8
# green = #a6e3a1
# blue = #89b4fa
```
--------------------------------
### Multi-Flavor Template Rendering
Source: https://context7.com/catppuccin/whiskers/llms.txt
Generate output containing all four Catppuccin flavors by omitting the `--flavor` flag. Flavors are accessed through the `flavors` map.
```bash
# Create a multi-flavor JSON template
cat > all-themes.tera << 'EOF'
---
whiskers:
version: "^2.9.0"
filename: "themes.json"
---
{
"themes": [
{%- for id, flavor in flavors %}
{
"id": "catppuccin-{{ id }}",
"name": "Catppuccin {{ flavor.name }}",
"type": "{% if flavor.dark %}dark{% else %}light{% endif %}",
"colors": {
"background": "#{{ flavor.colors.base.hex }}",
"foreground": "#{{ flavor.colors.text.hex }}",
"accent": "#{{ flavor.colors.mauve.hex }}"
}
}{% if not loop.last %},{% endif %}
{%- endfor %}
]
}
EOF
# Render all flavors
whiskers all-themes.tera
```
```text
# Creates themes.json with Latte, Frappe, Macchiato, and Mocha
```
--------------------------------
### Whiskers CLI Usage
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/reference/cli-options.mdx
Overview of the command-line interface for the Whiskers tool.
```APIDOC
## CLI Usage
### Description
Render Catppuccin templates using the Whiskers CLI.
### Usage
`whiskers [OPTIONS] [TEMPLATE]`
### Arguments
- **TEMPLATE** (string) - Required - Path to the template file, or '-' for stdin.
### Options
- **-f, --flavor** (string) - Optional - Render a single flavor (latte, frappe, macchiato, mocha).
- **--color-overrides** (string) - Optional - Set color overrides.
- **--overrides** (string) - Optional - Set frontmatter overrides.
- **--check** (string) - Optional - Check output against an example file.
- **--dry-run** (boolean) - Optional - Perform a dry run without writing to disk.
- **--list-functions** (boolean) - Optional - List all custom Tera filters and functions.
- **--list-flavors** (boolean) - Optional - List the Catppuccin flavors.
- **--list-accents** (boolean) - Optional - List the Catppuccin accent colors.
- **-o, --output-format** (string) - Optional - Output format for list commands (json, yaml, markdown, markdown-table, plain). Default: json.
- **-h, --help** (boolean) - Optional - Print help information.
- **-V, --version** (boolean) - Optional - Print version information.
```
--------------------------------
### Whiskers Frontmatter Configuration
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/reference/frontmatter.mdx
Configuration options for Whiskers templates via frontmatter.
```APIDOC
## `whiskers` Frontmatter Keys
### `version`
The `version` key specifies the Whiskers template version. It ensures compatibility and is highly recommended.
#### Specification
Supported version requirement syntaxes include:
- `^X.Y.Z`: Recommended for general use.
- `~X.Y.Z`: For specific minor version compatibility.
- `=X.Y.Z`: Exact version match.
- `=X.Y` or `=X`: Wildcard for major.minor or major.
- `>ver`, `>=ver`: Greater than or equal to a version.
- ` (`Map`) |
| Any Frontmatter |
## Types
These types are designed to closely match the [palette.json](https://github.com/catppuccin/palette/blob/main/palette.json).
### Flavor
#### `name` {#flavor-name}
- **Description**: The name of the flavor.
- **Type**: `String`
- **Examples**: "Latte", "Frappé", "Macchiato", "Mocha"
#### `identifier` {#flavor-identifier}
- **Description**: The identifier of the flavor.
- **Type**: `String`
- **Examples**: "latte", "frappe", "macchiato", "mocha"
#### `emoji` {#flavor-emoji}
- **Description**: Emoji associated with the flavor.
- **Type**: `char`
- **Examples**: '🌻', '🪴', '🌺', '🌿'
#### `order` {#flavor-order}
- **Description**: Order of the flavor in the palette spec.
- **Type**: `u32`
- **Examples**: `0` to `3`
#### `dark` {#flavor-dark}
- **Description**: Whether the flavor is dark.
- **Type**: `bool`
- **Examples**: `false` for Latte, `true` for others
#### `light` {#flavor-light}
- **Description**: Whether the flavor is light.
- **Type**: `bool`
- **Examples**: `true` for Latte, `false` for others
#### `colors` {#flavor-colors}
- **Description**: A map of color identifiers to their respective values.
- **Type**: `Map`
### Color
#### `name` {#color-name}
- **Description**: The name of the color.
- **Type**: `String`
- **Examples**: "Rosewater", "Surface 0", "Base"
#### `identifier` {#color-identifier}
- **Description**: The identifier of the color.
- **Type**: `String`
- **Examples**: "rosewater", "surface0", "base"
#### `order` {#color-order}
- **Description**: Order of the color in the palette spec.
- **Type**: `u32`
- **Examples**: `0` to `25`
#### `accent` {#color-accent}
- **Description**: Whether the color is an accent color.
- **Type**: `bool`
#### `hex` {#color-hex}
- **Description**: The color in hexadecimal format.
- **Type**: `String`
- **Examples**: "1e1e2e"
#### `int24` {#color-int24}
- **Description**: Big-endian 24-bit color in RGB order.
- **Type**: `u32`
- **Examples**: `1973806`
#### `uint32` {#color-uint32}
- **Description**: Big-endian unsigned 32-bit color in ARGB order.
- **Type**: `u32`
- **Examples**: `4280163886`
#### `sint32` {#color-sint32}
- **Description**: Big-endian signed 32-bit color in ARGB order.
- **Type**: `i32`
- **Examples**: `-14803410`
#### `rgb` {#color-rgb}
- **Description**: The color in RGB format.
- **Type**: [`RGB`](#rgb)
#### `hsl` {#color-hsl}
- **Description**: The color in HSL format.
- **Type**: [`HSL`](#hsl)
#### `opacity` {#color-opacity}
- **Description**: The opacity of the color.
- **Type**: `u8`
- **Examples**: `0` to `255`
### RGB
#### `r` {#rgb-r}
- **Description**: The red channel of the color.
- **Type**: `u8`
#### `g` {#rgb-g}
- **Description**: The green channel of the color.
- **Type**: `u8`
#### `b` {#rgb-b}
- **Description**: The blue channel of the color.
- **Type**: `u8`
```
--------------------------------
### Configure Whiskers Template Output Filename
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/getting-started/quick-start.mdx
Add the 'filename' key to the frontmatter to specify the output file name for the rendered template.
```yaml
---
whiskers:
version: "^2.9.0"
filename: "flavor.md"
---
```
--------------------------------
### Access Color Properties
Source: https://context7.com/catppuccin/whiskers/llms.txt
Retrieve detailed color metadata including RGB, HSL, and integer representations.
```bash
cat > color-props.tera << 'EOF'
---
whiskers:
version: "^2.9.0"
---
# {{ flavor.name }} Red Color Properties
# Hexadecimal
hex: {{ red.hex }}
# RGB components
r: {{ red.rgb.r }}
g: {{ red.rgb.g }}
b: {{ red.rgb.b }}
channels: {{ red.rgb.channels }}
# HSL components
h: {{ red.hsl.h }}
s: {{ red.hsl.s }}
l: {{ red.hsl.l }}
# Integer representations
int24: {{ red.int24 }}
uint32: {{ red.uint32 }}
sint32: {{ red.sint32 }}
# Metadata
name: {{ red.name }}
identifier: {{ red.identifier }}
is_accent: {{ red.accent }}
order: {{ red.order }}
EOF
whiskers color-props.tera --flavor mocha
```
--------------------------------
### Define a template with default frontmatter
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/concepts/overrides.mdx
A Tera template file defining a default border_color in the frontmatter.
```yaml
---
whiskers:
version: "^X.Y.Z"
filename: "example.yml"
border_color: "mauve"
---
theme:
border_color: "{{flavor.colors[border_color].hex}}"
```
--------------------------------
### Generate files per flavor
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/concepts/matrix-mode.mdx
Configures the matrix to generate one file for each of the four available flavors.
```yaml
---
whiskers:
version: "^X.Y.Z"
matrix:
- flavor
filename: "themes/catppuccin-{{flavor.identifier}}.json"
---
# ...
```
--------------------------------
### Basic Whiskers Template Frontmatter
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/getting-started/quick-start.mdx
Every Whiskers template requires a frontmatter section with at least the whiskers.version key.
```yaml
---
whiskers:
version: "^2.9.0"
---
```
--------------------------------
### Verify Templates in CI/CD
Source: https://context7.com/catppuccin/whiskers/llms.txt
Use check mode to validate generated files against templates, returning exit code 1 on discrepancies.
```bash
whiskers theme.tera --flavor mocha --check expected/mocha.cfg
whiskers matrix-theme.tera --check
```
--------------------------------
### Generate files per flavor and accent
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/concepts/matrix-mode.mdx
Configures the matrix to generate files for every combination of flavor and accent, resulting in 56 total files.
```yaml
---
whiskers:
version: "^X.Y.Z"
matrix:
- flavor
- accent
filename: "themes/{{flavor.identifier}}/catppuccin-{{flavor.identifier}}/{{accent}}.json"
---
# ...
```
--------------------------------
### Basic Whiskers Template Structure
Source: https://context7.com/catppuccin/whiskers/llms.txt
A basic Whiskers template requires a frontmatter section with version specification, followed by Tera template content. The 'filename' in the frontmatter specifies the output file name.
```yaml
---
whiskers:
version: "^2.9.0"
filename: "output.txt"
---
Template content here with {{ variables }}
```
--------------------------------
### Include External Files
Source: https://context7.com/catppuccin/whiskers/llms.txt
Use the read_file function to inject external file contents into templates.
```bash
echo "MIT License" > LICENSE.txt
cat > with-license.tera << 'EOF'
---
whiskers:
version: "^2.9.0"
---
# Theme Configuration
background = #{{ base.hex }}
# License
{{ read_file(path="LICENSE.txt") }}
EOF
whiskers with-license.tera --flavor mocha
```
--------------------------------
### Accessing colors in single-flavor mode
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/concepts/single-flavor.mdx
Demonstrates direct access to color hex values in a Tera template when the --flavor flag is used.
```markdown
---
whiskers:
version: "^X.Y.Z"
---
I can use {{red.hex}} directly, instead of needing {{flavor.colors.red.hex}}.
```
--------------------------------
### Reusable Whiskers Check Workflow
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/resources/github-actions.mdx
Use this reusable workflow for consistent Whiskers checks across repositories. It leverages the catppuccin/actions repository for the workflow definition.
```yaml
name: whiskers
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
run:
uses: catppuccin/actions/.github/workflows/whiskers-check.yml@v1
with:
args:
secrets: inherit
```
--------------------------------
### Iterate Over Colors
Source: https://context7.com/catppuccin/whiskers/llms.txt
Loop through all colors in a flavor to generate tables or lists.
```bash
cat > color-table.tera << 'EOF'
---
whiskers:
version: "^2.9.0"
---
# {{ flavor.name }} Color Palette
| Name | Hex | RGB |
|------|-----|-----|
{%- for _, color in flavor.colors %}
| {{ color.name }} | #{{ color.hex }} | rgb({{ color.rgb.r }}, {{ color.rgb.g }}, {{ color.rgb.b }}) |
{%- endfor %}
EOF
whiskers color-table.tera --flavor mocha
```
--------------------------------
### Override frontmatter via CLI
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/concepts/overrides.mdx
Command to execute a template with a specific frontmatter override.
```console
$ whiskers example.tera -f mocha --overrides '{"border_color": "pink"}'
```
--------------------------------
### CSS Format Functions and Filters
Source: https://context7.com/catppuccin/whiskers/llms.txt
Convert colors to CSS-compatible strings using built-in functions like css_rgb, css_hsl, css_rgba, css_hsla, or equivalent filters. Requires the `whiskers` CLI tool.
```bash
cat > css-colors.tera << 'EOF'
---
whiskers:
version: "^2.9.0"
---
:root {
/* Using functions */
--background: {{ css_rgb(color=base) }};
--foreground: {{ css_hsl(color=text) }};
--accent: {{ css_rgba(color=mauve) }};
--highlight: {{ css_hsla(color=yellow) }};
/* Using filters (equivalent) */
--red: {{ red | css_rgb }};
--green: {{ green | css_hsl }};
--blue: {{ blue | css_rgba }};
--pink: {{ pink | css_hsla }};
}
EOF
whiskers css-colors.tera --flavor mocha
```
--------------------------------
### Create Objects Dynamically
Source: https://context7.com/catppuccin/whiskers/llms.txt
Use the object function to define custom objects within a template.
```bash
cat > objects.tera << 'EOF'
---
whiskers:
version: "^2.9.0"
---
{% set custom = object(name="Custom", value=42) %}
name: {{ custom.name }}
value: {{ custom.value }}
EOF
whiskers objects.tera --flavor mocha
```
--------------------------------
### Access Flavor Properties
Source: https://context7.com/catppuccin/whiskers/llms.txt
Access metadata about the current flavor, such as name, emoji, and light/dark mode status.
```bash
cat > flavor-props.tera << 'EOF'
---
whiskers:
version: "^2.9.0"
---
# Flavor: {{ flavor.name }}
# ID: {{ flavor.identifier }}
# Emoji: {{ flavor.emoji }}
# Order: {{ flavor.order }}
# Is Dark: {{ flavor.dark }}
# Is Light: {{ flavor.light }}
{% if flavor.dark %}
[dark_mode]
{% else %}
[light_mode]
{% endif %}
background = #{{ base.hex }}
EOF
whiskers flavor-props.tera --flavor mocha
```
--------------------------------
### Serialize with LZMA
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/reference/filters.mdx
Serializes an object into a URL-safe string using LZMA compression.
```text
some_object | urlencode_lzma
```
--------------------------------
### Define Multi-Flavor Template
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/getting-started/quick-start.mdx
A Tera template configuration that iterates over all flavors and their respective colors to generate a markdown table.
```markdown
---
whiskers:
version: "^2.9.0"
filename: "palette.md"
---
{%- for _, flavor in flavors %}
Catppuccin {{flavor.name}}
|
Labels |
Hex |
RGB |
HSL |
{%- for _, color in flavor.colors %}
 |
{{color.name}} |
#{{color.hex}} | {#- Direct access on the `color` object #}
{{css_rgb(color=color)}} | {#- Using functions #}
{{color | css_hsl}} | {#- Using filters #}
{%- endfor %}
{% endfor %}
```
--------------------------------
### GitHub Actions Integration
Source: https://context7.com/catppuccin/whiskers/llms.txt
Use the reusable workflow for automated template verification in GitHub Actions.
```yaml
# .github/workflows/whiskers-check.yml
name: whiskers
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
run:
uses: catppuccin/actions/.github/workflows/whiskers-check.yml@v1
with:
args: template.tera
secrets: inherit
```
--------------------------------
### Define Custom Variables
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/reference/frontmatter.mdx
Include arbitrary metadata and variables in the frontmatter to be used within the template body.
```markdown
---
whiskers:
version: "^X.Y.Z"
filename: "example.ini"
app: "Windows9x"
author: "backwardspy"
accent: "mauve"
---
{% set darkGreen = green | sub(lightness=30) %}
# Catppuccin for {{app}} by {{author}}
bg = "#{{base.hex}}"
fg = "#{{text.hex}}"
border = "#{{flavor.colors[accent].hex}}"
diffAddFg = "#{{green.hex}}"
diffAddBg = "#{{darkGreen.hex}}"
```
```ini
# Catppuccin for Windows9x by backwardspy
bg = "#1e1e2e"
fg = "#cdd6f4"
border = "#cba6f7"
diffAddFg = "#a6e3a1"
diffAddBg = "#40b436"
```
--------------------------------
### Whiskers Template for Single Flavor Colors
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/getting-started/quick-start.mdx
This template iterates through colors of a single flavor to generate a markdown table. It uses Tera templating syntax for loops and expressions.
```markdown
---
whiskers:
version: "^2.9.0"
---
Catppuccin {{flavor.name}}
|
Labels |
Hex |
RGB |
HSL |
{%- for _, color in flavor.colors %}
 |
{{color.name}} |
#{{color.hex}} | {#- Direct access on the `color` object #}
{{css_rgb(color=color)}} | {#- Using functions #}
{{color | css_hsl}} | {#- Using filters #}
{%- endfor %}
```
--------------------------------
### Generate files with custom variants
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/concepts/matrix-mode.mdx
Uses an arbitrary iterable to include a 'normal' and 'no-italics' variant in the matrix generation process.
```markdown
---
whiskers:
version: "^X.Y.Z"
matrix:
- variant: ["normal", "no-italics"]
- flavor
- accent
filename: "themes/{{flavor.identifier}}/catppuccin-{{flavor.identifier}}-{{accent}}-{{variant}}.ini"
---
# Catppuccin {{flavor.name}}{% if variant == "no-italics" %} (no italics){% endif %}
[theme]
{{accent}}: {{flavor.colors[accent].hex}}
```
--------------------------------
### Frontmatter Overrides via CLI
Source: https://context7.com/catppuccin/whiskers/llms.txt
Override frontmatter variables at runtime using the `--overrides` flag. This allows for dynamic theme adjustments without modifying the template file. Requires the `whiskers` CLI tool.
```bash
cat > overridable.tera << 'EOF'
---
whiskers:
version: "^2.9.0"
accent: "mauve"
border_style: "rounded"
---
[theme]
accent = #{{ flavor.colors[accent].hex }}
border = {{ border_style }}
EOF
# Default rendering
whiskers overridable.tera --flavor mocha
# With overrides
whiskers overridable.tera --flavor mocha --overrides '{"accent": "pink", "border_style": "square"}'
```
--------------------------------
### Color Overrides via CLI
Source: https://context7.com/catppuccin/whiskers/llms.txt
Override specific palette colors at runtime using the `--color-overrides` flag. This is useful for applying custom color schemes or variations like pure black backgrounds. Requires the `whiskers` CLI tool.
```bash
cat > theme.tera << 'EOF'
---
whiskers:
version: "^2.9.0"
---
background = #{{ base.hex }}
foreground = #{{ text.hex }}
surface = #{{ surface0.hex }}
EOF
# Standard Mocha colors
whiskers theme.tera --flavor mocha
# OLEDppuccin/Americano overrides (pure black backgrounds)
whiskers theme.tera --flavor mocha --color-overrides '{
"mocha": {
"base": "000000",
"mantle": "010101",
"crust": "020202"
}
}'
```
--------------------------------
### Run Whiskers in Check Mode (Failure)
Source: https://github.com/catppuccin/whiskers/blob/main/docs/src/content/docs/concepts/check-mode.mdx
When template rendering results in changes compared to the expected output file, Whiskers will report the differences and exit with code 1. This indicates that the generated files do not match the templates.
```console
$ whiskers theme.tera latte --check themes/latte.cfg
Templating would result in changes.
4c4
< accent is #ea76cb
---
> accent is #40a02b
(exit code 1)
```
--------------------------------
### Apply Color Overrides
Source: https://context7.com/catppuccin/whiskers/llms.txt
Use the --color-overrides flag to modify specific color values during template generation.
```bash
whiskers theme.tera --flavor mocha --color-overrides '{
"all": {
"text": "ffffff"
}
}'
```