Skip to main content

kit

Macro kit 

Source
macro_rules! kit {
    ($dir:literal $(, tokens = [$($part:literal),* $(,)?])?
        $(, fonts = [$($font:literal),* $(,)?])?
        $(, license = $license:literal)?
        $(,)?) => { ... };
    ($dir:literal, kit = $kit:literal
        $(, tokens = [$($part:literal),* $(,)?])?
        $(, fonts = [$($font:literal),* $(,)?])?
        $(, license = $license:literal)?
        $(,)?) => { ... };
}
Expand description

Embeds a kit folder in the binary: kit.yaml (or the kit file kit = "kit.json" names), and the token files, faces (under fonts/) and licence it is given. The path is relative to the file calling the macro, as include_str!’s. Nothing is checked when compiling: call kit::check from a test.

ⓘ
let kit = egui_pop_tokens::kit!("../kits/brand",
    tokens = ["tab.tokens.yaml"],
    fonts = ["Inter-Regular.ttf", "Inter-Bold.ttf"],
    license = "LICENSE");