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
exportDOM methods for HeadingNode, QuoteNode #4445
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
const indent = this.getIndent(); | ||
if (indent > 0) { | ||
element.style.textIndent = `${indent * 20}px`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think any of these apply to list item, but indent especially will not do what we want here, as indent has a different implementation in lists than in elements generally. Also I'm not sure we should be using textIndent anywhere, as it only indents the first line of the text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree that it does not make sense for lists, as for textIndent for other nodes seems like this one is the explanation:
lexical/packages/lexical/src/nodes/LexicalParagraphNode.ts
Lines 82 to 85 in aabb5b6
// padding-inline-start is not widely supported in email HTML, but | |
// Lexical Reconciler uses padding-inline-start. Using text-indent instead. | |
element.style.textIndent = `${indent * 20}px`; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @acywatson and @fantactuka will remove the textIndent part, I actually didn't realize it was even a thing outside of lists. What would be the correct way to solve this for lists, where should I be looking to solve the alignment on an individual list item level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like this one is the explanation:
Yea but if you look at the docs, these do completely different things:
https://developer.mozilla.org/en-US/docs/Web/CSS/text-indent
https://developer.mozilla.org/en-US/docs/Web/CSS/padding-inline-start
I don't understand how that text-indent property is working the same way as padding-inline-start.
where should I be looking to solve the alignment on an individual list item level.
Alignment in what sense? List indentation is semantic rather than stylistic in Lexical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as in having a single item from a list have justification "right", while the others remain with "left" justification. The bullet icon remains still correctly indented, it's just the text alignment on the row.
@acywatson Could I get a second look. I've removed the list item part. |
Adding exportDOM methods for the HeadingNode, QuoteNode (rich-text package). All of the changes are outside of the core, so adding the methods should be safe performance-wise.
Before:
exportDOM-pre.mp4
After:
exportDOMs-post.mp4