Skip to content

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

@backwardspy

Description

@backwardspy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions