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

Fix Style injection caused tailwind override css priorities #161

Merged
merged 5 commits into from
Oct 3, 2023

Conversation

eyalcohen4
Copy link
Contributor

@eyalcohen4 eyalcohen4 commented Sep 13, 2023

This PR should fix #128 by prefixing the tailwind classes of Novel.

One current Issue I face that blocking a merge is that the Prose classes inside the tiptap/react editor are not customizable, and therefor the prose class doesn't apply to them.

Screenshot 2023-09-13 at 19 16 36

@vercel
Copy link

vercel bot commented Sep 13, 2023

@eyalcohen4 is attempting to deploy a commit to the Elegance Team on Vercel.

A member of the Team first needs to authorize it.

@alvin
Copy link

alvin commented Sep 25, 2023

@eyalcohen4 not sure if this is the same editor text styling issue you were getting, but after compiling this branch to fix the overall style pollution with my global tailwind (which resulted in clean outer site content -- but unstyled editor content) I had success passing in editorProps (which Novel exposes) to natively style tiptap with tailwind as documented on the tiptap site:

      <NovelEditor
        editorProps={{
          attributes: {
            class: 'prose dark:prose-invert prose-sm sm:prose-base lg:prose-lg focus:outline-none ',
          },
        }}
        ...
        />

So, it appears that using branch plus that trick, plus adding .ProseMirror scoped h1, h2, h3 styles in prosemirror.css has this one unblocked for me. Thanks for the fix!

@vercel
Copy link

vercel bot commented Oct 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
novel ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 3, 2023 4:24pm

@steven-tey
Copy link
Owner

Thanks so much for this PR @eyalcohen4!! Also fixed the prose issue (without needing to use the exposed editorProps prop from <Novel/>)

CleanShot 2023-10-03 at 09 18 54

To be honest this doesn't feel like a very "clean" fix to me 😅 – I've been cracking my head trying to find a better solution, but to no avail so far.

However, it does the job perfectly (thank you @alvin for confirming) and it's also not too hard to revert in the future if we do find a better fix!

Will cut a new release soon after merging a few other PRs!

@steven-tey steven-tey merged commit 849b3fa into steven-tey:main Oct 3, 2023
3 checks passed
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

Successfully merging this pull request may close these issues.

Style injection caused tailwind override css priorities
4 participants