GitLab

Using web components to encapsulate CSS and resolve design system conflicts

May 3, 2021Tyler Williams
Using web components to encapsulate CSS and resolve design system conflicts
SummaryAI, from the source post

This post details the use of web component technologies (Shadow DOM, templates, slots, custom elements) to achieve CSS encapsulation and incrementally adopt the Slippers design system on the GitLab blog. It describes the technical implementation of using a template tag, loading JavaScript to inject encapsulated CSS, and using slots for rendering non-Slippers items. The solution addresses the challenge of conflicting CSS between the new design system (Tailwind CSS with Preflight) and existing legacy styles.

More from the UI Navigation and Layout Redesign trail