Technology

Phoenix LiveView 1.2 Ships Colocated CSS and Revised HEEx Compilation

Martin HollowayPublished 4d ago3 min readBased on 2 sources
Reading level
Phoenix LiveView 1.2 Ships Colocated CSS and Revised HEEx Compilation

The Phoenix Framework team released LiveView 1.2 on June 14, 2026, with two headline changes: support for colocating CSS alongside component modules, and a revised HEEx template compilation pipeline.

The colocated CSS feature is the more visible of the two. It extends the component colocation model that LiveView 1.1 introduced for JavaScript hooks — developers can now place component-scoped stylesheets directly alongside their Elixir module files rather than managing a separate CSS layer. The pattern will be familiar to anyone who has worked with CSS Modules or Vue's single-file components: the goal is to keep the full surface area of a component — markup, behaviour, and presentation — navigable from a single location in the project tree. LiveView's implementation builds on the Colocated Hooks groundwork laid in 1.1, applying the same file-proximity convention to stylesheets.

The HEEx compilation changes are lower-level but affect every LiveView application. HEEx — the HTML-aware EEx dialect that underpins LiveView templates — is now compiled differently, though the release announcement does not enumerate the specific internal changes in the verified facts available at publication. What is notable is that compilation changes at this layer can affect change-tracking granularity, diff payload sizes, and the way assigns propagate through a component tree — all of which have direct consequences for render performance and the correctness of LiveView's fine-grained update model.

LiveView's colocation story has been building incrementally. The 1.1 release, published in July 2025, delivered Colocated Hooks and keyed comprehensions — the latter addressing a long-standing ergonomic gap when rendering lists with stable identity. The 1.2 CSS addition follows the same design philosophy: bring assets that belong to a component into its physical neighbourhood in the codebase, reducing the cognitive overhead of cross-cutting concerns scattered across an assets directory.

Worth flagging for teams running LiveView in production: HEEx compilation changes at a minor version boundary deserve scrutiny during upgrade testing, particularly if your application relies on the precise timing or granularity of DOM patch instructions. The LiveView diffing model is one of the framework's most carefully maintained invariants, and any change to how templates are compiled is worth tracing through your specific component patterns in a staging environment before rolling to production.

The broader trajectory here is a framework maturing around the colocation pattern as a first-class primitive. Phoenix LiveView entered mainstream Elixir development as a radical simplification of real-time UI — server-rendered, diff-patched, no client state machine required. Successive releases have been filling in the ergonomic gaps that come with scale: hooks for imperative JavaScript interop, keyed lists for efficient reconciliation, and now CSS scoping. Each addition narrows the gap between what a developer can do in LiveView and what they would otherwise reach for a JavaScript framework to accomplish.