Skip to content
GitLab

Using web components to encapsulate CSS and resolve design system conflicts

May 3, 2021Tyler Williams6 min read
Opens about.gitlab.com
What the post coversAI, 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.
Read the full post on about.gitlab.com · 6 min (opens in a new tab)

More from the UI Navigation and Layout Redesign trail