Rule-driven inline cell styles
`cellStyle` and `styleRules` apply inline style objects computed from values. These are useful for dynamic values such as heatmap backgrounds where precomputed classes are impractical. Styles are restricted to a safe CSS property allowlist and are CSP-compatible because they are applied via the CSSOM rather than style attributes.
Planned. This page shows the specification from issue #184. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
A utilization grid where cellStyle computes the background color from the value.
Expected behavior
Background colors update with values. The injected url() is dropped with a warning. The grid works under strict CSP mode.
Planned API surface
cellStylestyleRulesrowStyleallowedStylePropertiesAcceptance criteria
- Styles are applied via element.style property setters and work under CSP with no 'unsafe-inline'. (pending)
- Values containing url(), expression() or javascript: are rejected. (pending)
- Properties outside the allowlist are dropped with a dev warning. (pending)
- Styles are cleared when a rule no longer applies. (pending)