A workaround for hiding empty slots in Chromium

236 · · June 19, 2026, 5:07 a.m.
Summary
This blog post discusses a workaround for addressing an issue in Chromium where empty slots in web components cause unwanted gaps in layout. It details the use of the :scope selector as a solution, showing how it can effectively hide empty slots and collapse gaps across different browsers. The author shares personal experiences and insights into CSS tricks, noting both the challenges and the final successful approach while providing examples and explanations.