TeemuKoivisto / prosemirror-dev-toolkit

Injectable developer tools for ProseMirror rich-text editors implemented in Svelte and TypeScript.
https://teemukoivisto.github.io/prosemirror-dev-toolkit/
MIT License
115 stars 6 forks source link

Issue with injected Svelte styles #46

Closed svenadlung closed 1 year ago

svenadlung commented 1 year ago

Not 100% grounded and completely investigated, but I have noticed that on some pages, content elements are hidden whenever this Chrome Extension is activated.

A short investigation led to the following assumption: The extension/DevTools uses Svelte and injects its styles at runtime. This includes a generic hidden class. Because it is injected in the head as a style block, the specificity is higher than the same class referenced before.

Please see the following screenshots:

Without extension:

Bildschirm­foto 2023-02-14 um 15 04 37

Activated extension:

Bildschirm­foto 2023-02-14 um 15 03 25

This is the injection:

Bildschirm­foto 2023-02-14 um 15 02 24

If this is correct, it will disrupt functionality on many websites, as this is also a default class of Tailwind. If possible, it should be scoped.

TeemuKoivisto commented 1 year ago

Hey @svenadlung ! Thanks for the bug report, yeah I've tried to fix this by using class names that ought to be unique but this only gets you so far. I'll definitely try to get the styles scoped somehow. Best way would be a web component. Second best I guess just mangling the class names, last time I checked Svelte didn't provide this out-of-the-box.