Fix spacing problem of paragraphs around lists#10305
Fix spacing problem of paragraphs around lists#10305luixxiul wants to merge 17 commits intomatrix-org:developfrom luixxiul:fix-margin-list
Conversation
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
| .mx_EventTile_content .markdown-body { | ||
| p, | ||
| ul, | ||
| ol, |
There was a problem hiding this comment.
I am not sure if the margin-bottom for ul and ol on compact modern layout has been expected, as the other layouts do not have margin-bottom for them.
| // Check block margin values of paragraphs and lists on compact modern layout | ||
| cy.setSettingValue("useCompactLayout", null, SettingLevel.DEVICE, true); | ||
| cy.get(".mx_EventTile[data-layout=group] .markdown-body").within(() => { | ||
| cy.get("ul").should("have.css", "margin-block", "0px 4px"); |
There was a problem hiding this comment.
If ul and ol margin is in fact not expected here, this needs to be replaced as well. https://github.com/matrix-org/matrix-react-sdk/pull/10305/files#r1127766737
richvdh
left a comment
There was a problem hiding this comment.
Thanks for looking at this. A few questions and comments below.
Generally: as I understand it, this works by setting a margin-top for <p> elements which follow a list. What is the reason for doing that, rather than setting a margin-bottom on lists, to bring them into line with the other block elements? I'm worried that with all these overrides, we're making the CSS very hard to reason about, and that there may be other situations that this won't fix.
The problematic margin-bottom override appears to have been introduced in #9871, though I don't entirely follow why it was required. As the author of that PR, @alunturner can you shed any light on it?
res/css/views/rooms/_EventTile.pcss
Outdated
| :is(ul, ol) + p { | ||
| margin-block: $spacing-16; | ||
| } |
There was a problem hiding this comment.
this seems to be directly overriding the settings at lines 647-650. Do we really need both settings?
There was a problem hiding this comment.
Are you suggesting that ul + p and ol + p would be covered by :is(blockquote > p, ol, ul) ?
There was a problem hiding this comment.
Erm, I'm mostly asking the same question as in the review summary:
Generally: as I understand it, this works by setting a
margin-topfor<p>elements which follow a list. What is the reason for doing that, rather than setting amargin-bottomon lists, to bring them into line with the other block elements? I'm worried that with all these overrides, we're making the CSS very hard to reason about, and that there may be other situations that this won't fix.
| @@ -648,6 +648,32 @@ $left-gutter: 64px; | |||
| margin-top: 0; | |||
There was a problem hiding this comment.
(I don't really know why we need a margin-top here. As far as I can tell, it's the default anyway)
res/css/views/rooms/_EventTile.pcss
Outdated
| /* Paragraph below ul or ol */ | ||
| :is(ul, ol) + p { | ||
| margin-block: $spacing-4; | ||
| } |
There was a problem hiding this comment.
again, how does this interact with the settings at lines 647-650?
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
|
Closing for now as setting up a well-thought test set for lists should be done at first. |
|
Hello
Hello! This work was carried out before I was aware that we were having clashes in the timeline when trying to apply styling purely to the output of the wysiwyg composer. That specific override was put in to handle consecutive list display from the rich text editor, but if it breaks other things, I think it's sensible to be taken out. This is exactly what I did in #10071 to revert an unseen issue with paragraph spacing caused by wysiwyg work. |
This PR intends to fix a spacing problem of paragraphs (
p) around lists (ulandol) inside.markdown-body.Fixes element-hq/element-web#24602
Signed-off-by: Suguru Hirahara luixxiul@users.noreply.github.com
type: defect
Checklist
Here's what your changelog entry will look like:
🐛 Bug Fixes