Skip to content

Commit

Permalink
feat(whiskers): add colors to context in single-flavor matrix (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasPortzel authored May 24, 2024
1 parent 5831b5d commit 37217cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions whiskers/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@ fn render_multi_output(
let flavor: catppuccin::FlavorName = value.parse()?;
let flavor = &palette.flavors[flavor.identifier()];
ctx.insert("flavor", flavor);

// also throw in the flavor's colors for convenience
for (_, color) in flavor {
ctx.insert(&color.identifier, &color);
}
} else {
ctx.insert(key, &value);
}
Expand Down
1 change: 1 addition & 0 deletions whiskers/tests/fixtures/multifile.tera
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ whiskers:
# Catppuccin {{flavor.name}}{% if variant == "no-italics" %} (no italics){% endif %}
[theme]
{{accent}}: #{{flavor.colors[accent].hex}}
rosewater: {{rosewater.hex}}

0 comments on commit 37217cc

Please sign in to comment.