Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Editor styles overwriting global styles #186

Open
1 task done
chrassendk opened this issue Jun 20, 2024 · 2 comments
Open
1 task done

[BUG] Editor styles overwriting global styles #186

chrassendk opened this issue Jun 20, 2024 · 2 comments

Comments

@chrassendk
Copy link
Sponsor

chrassendk commented Jun 20, 2024

Has this bug been raised before?

  • I have checked "open" AND "closed" issues and this is not a duplicate

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

  • OS:
  • Browser:

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
Copy link

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
Copy link
Sponsor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants