gpui-ui-kit-macros
Procedural macros for gpui-ui-kit.
Provides the ComponentTheme derive macro which generates Default and From<&Theme> implementations for component theme structs, reducing repetitive boilerplate.
Usage
use ComponentTheme;
This generates:
impl Default for MyComponentThemeusing the hex/literaldefaultvaluesimpl From<&Theme> for MyComponentThememapping fields from the global theme (from = nonekeeps the default)
Attribute Reference
- Color fields (
Rgba):#[theme(default = 0xRRGGBB, from = <theme_field>)] - Float fields (
f32):#[theme(default = <value>, from = none)]
This is a proc-macro crate. Use it via gpui-ui-kit which re-exports ComponentTheme.