Status: development → future · Priority: high
Note: This is a future plan, not a commitment. The syntax and API shown here are proposals — they can be completely different when actually implemented.
A complete runtime CSS cascade: merging every matched rule — across CSS files, Tailwind utilities, inline styles, and defaults — by specificity and origin into one final computed style per element. The selector engine exists; the cascade resolver (planned as a Rust stage in the IR pipeline) is not built yet.
Today styles resolve mostly at IR-build time (inline > Tailwind > CSS rules > UA defaults per property). A real cascade gives:
!important, specificity battles, source order — matching what web developers expectmorph check parity — warn on rules that would never win| Piece | State |
|---|---|
Selector engine (crates/morph-parser/ CSS side) — descendant/child/adjacent/sibling combinators, compounds, pseudo-classes, specificity |
✅ Shipped |
Runtime :hover / :active / ancestor-hover rules |
✅ Shipped |
| Builder cascade (inline > Tailwind > CSS rules > defaults) | ✅ Shipped |
| Cascade resolver | ❌ Not built — planned as a Rust stage in the IR pipeline |
// future: crates/morph-ir or morph-parser cascade resolver
resolve(element, rules) -> computed_style!important + specificity + source ordercolor, font-size, font-weight, text-align)IRStyle / runtime style structs the renderer already consumesThe C++ side then deserializes or emits the final computed style — pixel-identical dev/build rendering is a hard requirement (already enforced by the existing dev deserializer).
!important — does it belong in .mx CSS? (Trivial to support once the cascade sorts by origin)--custom-props) — natural extension once the cascade exists, currently unsupportedstyle/resolver.py!important and source-order semanticsmorph check cascade diagnostics