-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
update ReactRenderer to include CSS class #2166
Conversation
✔️ Deploy Preview for tiptap-embed ready! 🔨 Explore the source changes: 8423d8f 🔍 Inspect the deploy log: https://app.netlify.com/sites/tiptap-embed/deploys/6192112090e17f00077afab0 😎 Browse the preview: https://deploy-preview-2166--tiptap-embed.netlify.app |
Not sure about this one. You can add a class to your component within ReactRenderer, right? |
Thanks! Yeah, @philippkuehn we can do that but the tree looks like .first-component + .next-component {
margin-top: -3rem;
} in this structure: <div class="react-renderer first-component">
…
</div>
<div class="react-renderer next-component">
…
</div> This CSS above doesn’t work right now because going up the tree in CSS is not possible so this CSS below doesn’t have access to the .react-renderer > .first-component + ? as structure is: <div class="react-renderer">
<div class="first-component"></div>
</div>
<div class="react-renderer">
<div class="next-component"></div>
</div> It’s possible to do it programmatically but not ideal, thus this PR. Let me know if this makes sense. |
Thanks for the PR! The solution feels somehow wrong to me. If we’ll add support for it, it should be configureable and maybe even off by default. Another nitpick: We use lowerCamelCase for extension names, so the class names would end up like |
Ok, that’s fair @hanspagel. What about adding extension name as a So it would look like: <div class="react-renderer" data-extension="taskItem" /> |
We're currently using a decoration to achieve this as a workaround, but I think it would be easier and more performant if Tiptap did this out of the box. Here's our custom plugin for reference:
|
Thanks for this PR but instead of adding the extension name to the |
Awesome, thanks @philippkuehn |
Includes extension name to root
react-renderer
node so that styling can be done directly.