Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expand the accent magic iterable to return full colour objects instead of just identifiers #76

Open
backwardspy opened this issue Mar 1, 2025 · 0 comments
Milestone

Comments

@backwardspy
Copy link
Member

flavor is automatically expanded right before a multi-file render:

whiskers/src/main.rs

Lines 555 to 567 in 9a7d0be

// expand flavor automatically to prevent requiring:
// `{% set flavor = flavors[flavor] %}`
// at the top of every template.
if key == "flavor" {
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 {

we may have to defer the expansion of accent to a second pass after the rest of the matrix has been expanded into the template context, since it's dependent on the flavour to get the correct colour object.

@backwardspy backwardspy added this to the v3 milestone Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant