Expand description
Declarative ui! macro for building GPUI element trees.
All parsing and expansion logic lives in declarative-gpui-core โ a
normal library crate, so it can be unit-tested, benchmarked, and fuzzed
(proc-macro crates export nothing but their macros, and the proc_macro
API is only usable inside a real expansion). This crate is just the entry
point converting at the proc_macro / proc_macro2 boundary.
Macrosยง
- color
- Convert a color to a
gpui::Hslaliteral at compile time โ the same conversion theui!style tokens use, exposed standalone so theme palettes can beconst. Accepts 3/4/6/8-digit hex (optional leading#, optionally quoted) or a named color. - ui
- Build a GPUI element tree declaratively.
- ui_
expand - Like
ui!, but instead of building the element tree, expand to a&'static strof the pretty-printed GPUI builder code the same input generates โcargo expandscoped to one invocation, with no nightly or extra tooling.