I spent 6 months building a Chrome extension with Vue 3 and Shadow DOM -- here are the hard parts
Your Chrome extension looks perfect in development. The fonts are crisp, the layout is clean, Tailwind utilities work exactly as expected. Then you deploy it to a real e-commerce site. Every style ...

Source: DEV Community
Your Chrome extension looks perfect in development. The fonts are crisp, the layout is clean, Tailwind utilities work exactly as expected. Then you deploy it to a real e-commerce site. Every style breaks. The host page has an aggressive CSS reset that overrides your carefully crafted UI. Your text-sm renders at the wrong size. Your flex containers collapse. You add !important to a few rules, then a few dozen, and eventually you realize you are fighting a war you cannot win. I spent six months building a Chrome extension that injects analysis panels into e-commerce pages. It runs on multiple platforms across thousands of different CSS environments, each one capable of destroying my UI. Here is how I solved it. The approaches that failed Before landing on the right solution, I tried three common approaches: Approach What it does Why it fails for content scripts Scoped CSS Prevents your styles from leaking out Does not stop host page styles from leaking in CSS-in-JS Generates unique class