Why this fires¶
A @(expr) interpolation becomes the value of a CSS custom property on the component's root element. Only str, int, and float serialize into one meaningfully. A bool, a View, a map, a struct, or a function has no CSS spelling — at render time it would either stringify into garbage or be dropped — so the type checker rejects it. TE732 is typeck-owned: it surfaces under zolo check and in the editor; zolo run and zolo build skip the full type check, so there the bad value degrades to initial at render time (dev overlay reports it) instead of failing the build.
fn Card() -> View {
let visible = true
<div class="card">
<style>.card { opacity: @(visible); }</style>
</div>
}
// error[TE732]: css interpolation expects str, int, or float — found `bool`Fix it¶
Compute a CSS-ready value before interpolating:
fn Card() -> View {
let visible = true
let opacity = if visible { 1.0 } else { 0.0 }
<div class="card">
<style>.card { opacity: @(opacity); }</style>
</div>
}For on/off styling, prefer toggling a class in the markup and writing two static rules — that morphs better under the dev server too.
A value the checker cannot type (Any, an unannotated parameter) stays silent by design: this error never guesses.