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
+1 -1
View File
@@ -860,7 +860,7 @@ All forms support returning `impl IntoEffect` and compose through tuples.
002 Generated class constants are ergonomic references only: they do not create a CSS framework, require a framework project structure, or make dynamic class expressions compile-time facts. Unknown Rust class references fail by normal Rust name resolution when the generated constant is absent. [north_star]
### req: style/003
003 When a hemplate dynamic class attribute needs more than one class token, Rust passes a displayable list of generated `CssClass` values as view data. Rust should not assemble ad hoc class strings for known style tokens. [north_star]
003 When a hemplate dynamic class attribute needs more than one class token, Rust passes a displayable list of generated `CssClass` values as view data. Conditional state classes should compose from generated constants with boring Rust helpers such as `classes::card.with_if(selected, classes::is_selected)`. Rust should not assemble ad hoc class strings for known style tokens. [north_star]
---