I wrote about the styling system I use in &orca UI toolkit, which solves some problems I had with stack based approaches: https://www.forkingpaths.dev/posts/23-03-10/rule_based_styling_imgui.html