TL;DR
Phoenix LiveView 1.2 has been officially released, adding support for colocated CSS and several small but impactful improvements. The update simplifies styling in LiveView components and enhances template compilation, though full CSS scoping remains experimental.
Phoenix LiveView 1.2 is now available, introducing colocated CSS support and several improvements to template compilation and JavaScript handling, aimed at enhancing developer experience.
The new release, version 1.2, enables developers to colocate CSS within HEEx templates, leveraging the @scope rule and phx-r attributes to scope styles to specific components. This builds upon existing colocated JavaScript features introduced in LiveView 1.1.
While the framework now supports colocated CSS, full CSS scoping using the @scope rule is not yet included due to limited browser support. Instead, LiveView offers a configurable approach with a custom phx-r attribute and a partial implementation of the @scope rule, allowing early adopters to experiment with scoped styles.
Additional improvements include the ability to customize the formatting of and tags, automatic encoding of Phoenix.LiveView.JS structs during push_event, and configurable HEEx debug annotations and test warnings. These updates aim to streamline development workflows and improve debugging capabilities.
Impact of Colocated CSS and Template Enhancements
This update simplifies styling in LiveView applications by allowing CSS to be colocated within components, reducing global style conflicts and improving modularity. Although full CSS scoping is not yet supported across browsers, the partial implementation provides a foundation for more isolated styles, which can benefit complex LiveView interfaces.
The improvements to template compilation and JavaScript handling enhance developer productivity and debugging, making it easier to build and maintain dynamic, real-time web applications with Elixir and Phoenix.

Elixir & Phoenix The Concurrent Edge: Build Fault-Tolerant, Scalable, and Real-Time Web Applications with a Functional Approach
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Background on LiveView 1.2 Features and Development
LiveView 1.1 introduced colocated hooks and JavaScript, enabling inline scripting within HEEx templates. The 1.2 release extends this approach to CSS, following ongoing discussions about component-scoped styling and the challenges of CSS scoping in browsers.
The development was sponsored by Dashbit and involved significant changes to the HEEx compilation process, including splitting tokenization and parsing steps to support colocated CSS and JS without complicating the overall template compilation.
While the feature set is promising, the team emphasized that full CSS scoping using the @scope rule is experimental, with browser support still limited as of June 2026.
“The release of LiveView 1.2 marks a significant step toward component-based styling, though full scoping remains a work in progress due to browser limitations.”
— an anonymous researcher

Visual Studio Code: End-to-End Editing and Debugging Tools for Web Developers
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Remaining Challenges with CSS Scoping Support
Full CSS scoping via the @scope rule is not yet supported across browsers, and LiveView’s implementation remains experimental. It is unclear when broader browser support will be available or if the feature will be fully integrated into the framework.
Additionally, the long-term adoption of colocated CSS depends on community feedback and further development of the scoping mechanism.
HEEx template editor
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Upcoming Developments and Community Feedback
Developers are encouraged to experiment with the colocated CSS features and provide feedback through forums or issue trackers. The LiveView team plans to monitor browser support and may enhance the scoping capabilities in future releases.
Further updates are expected to include more robust CSS scoping, additional documentation, and potentially broader adoption of colocated styles in production applications.
CSS scoping tools for web development
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Key Questions
What is colocated CSS in LiveView 1.2?
Colocated CSS allows developers to define CSS styles directly within HEEx templates, scoped to specific components using attributes and partial support for CSS scoping rules.
Is full CSS scoping supported in LiveView 1.2?
No, full CSS scoping using the @scope rule is not yet supported across browsers. LiveView 1.2 offers partial, experimental support with custom configuration options.
What other improvements are included in LiveView 1.2?
Improvements include customizable formatting for and tags, automatic encoding of JS structs during push_event, and configurable HEEx debug annotations and test warnings.
How do I enable colocated CSS in my project?
Update your mix.exs dependency to ~> 1.2.0 and re-fetch dependencies. Use the tag within your HEEx templates to define styles.
What is the significance of this release for Elixir developers?
This release simplifies styling and improves component modularity in LiveView applications, making it easier to build maintainable, real-time web interfaces.
Source: Hacker News