feat(style): compose generated class states

Add CssClass/CssClasses with/with_if helpers so nested partial view data can compose generated CSS constants without ad hoc class strings.

req: style/003

req: component/003
This commit is contained in:
slhx agent
2026-06-02 07:24:10 +02:00
parent a138f92b33
commit 3ab89adf2d
4 changed files with 29 additions and 9 deletions
+3
View File
@@ -141,6 +141,9 @@ fn generated_css_classes_join_for_hemplate_dynamic_class_attrs() {
assert_eq!(classes.as_str(), "work-card is-selected");
assert_eq!(classes.to_string(), "work-card is-selected");
assert_eq!(CARD.with(SELECTED).as_str(), "work-card is-selected");
assert_eq!(CARD.with_if(true, SELECTED).as_str(), "work-card is-selected");
assert_eq!(CARD.with_if(false, SELECTED).as_str(), "work-card");
}
#[test]