Phoenix LiveView 1.2 lands colocated CSS
Phoenix LiveView 1.2 has been released, introducing colocated CSS support within HEEx templates to build on the colocated JavaScript and hooks features from version 1.1. While native CSS scoping is not enabled by default due to limited browser support, the release overhauls compiler internals and introduces developer experience enhancements such as custom HTML tag formatters and automatic encoding for JavaScript client events.
Shipping the structural foundation for colocated scoped CSS without browser-native scoping by default is a pragmatic compromise that keeps Phoenix modern yet compatible.
- –Scoping Workaround: Relying on a customizable `@behaviour` for scoping avoids locking developers into a single strategy while browser support for native `@scope` matures.
- –Compiler Overhaul: Splitting HEEx compilation into tokenization and parsing steps significantly cleans up macro component processing and consolidates formatting logic.
- –Quality of Life: Automatic encoding for `JS` structs in `push_event` and modular debug annotation settings streamline typical real-world development workflows.
DISCOVERED
4d ago
2026-06-14
PUBLISHED
4d ago
2026-06-14
RELEVANCE
AUTHOR
ksec