Darginec05 / Yoopta-Editor

Build Notion-like, Craft-like, Coda-like, Medium-like editors with Yoopta
https://yoopta.dev/
MIT License
784 stars 61 forks source link

[BUG] Editor styles overwriting global styles #186

Open chrassendk opened 2 weeks ago

chrassendk commented 2 weeks ago

Has this bug been raised before?

Description

When embedding the editor the local styles for the editor is globally applied. image. https://github.com/Darginec05/Yoopta-Editor/blob/cd8c25f695296c87ae27138330038d931301f663/packages/core/editor/src/styles.css

Steps to Reproduce

  1. Add editor.
  2. Tailwind buttons e.g. loose their border

Environment

Screenshots

image

Do you want to work on this issue?

No

If "yes" to above, please explain how you would technically implement this

No response

XavierDK commented 2 weeks ago

Hi 👋,

Here's a temporary fix that might help you:

useEffect(() => {
    document.head.querySelectorAll("style").forEach((style) => {
      if (style.innerHTML.includes("button")) {
        style.innerHTML = style.innerHTML.replace("border:none", "");
      }
    });
  }, []);

Hope this helps!

chrassendk commented 1 week ago

It will not work on SPA renderings, since it only runs on mount