[2.x] Spacing with Like/Reply is off in Flarum 2.x
Current Behavior
Flarum 1.x:
Flarum 2.x:
You can see the amount of spacing used in Flarum 2.x is exaggerated compared to 1.x.
The same is true even if there are only likes but no replies.
Steps to Reproduce
1.x example: https://forum.pianotell.com/d/2380-pianotell-recital-8-is-now-live/2
2.x example: https://discuss.flarum.org/d/39191-flarum-in-a-box-try-flarum-2x-in-one-command-with-docker/28
Expected Behavior
Could we get the same spacing optimization that we have in 1.x in 2.x?
Screenshots
No response
Environment
- Flarum version: RC4 on Discuss
Output of php flarum info
Output of "php flarum info", run this in terminal in your Flarum directory.
Possible Solution
No response
Additional Context
No response
Just so I understand this correctly, you're talking about (from your screenshots) "Reply Unlike" ? Or the list of usernames for likes and replies?
Just so I understand this correctly, you're talking about (from your screenshots) "Reply Unlike" ? Or the list of usernames for likes and replies?
Look at the vertical space under Reply and compare it between the two screenshots.
Okay I see it clearly now. Ones inline and the other stacks.
I checked, the issue is not present on my test instance still running 2.0.0-rc.3. Yes, I see it on discuss.flarum.org.
I checked, the issue is not present on my test instance still running 2.0.0-rc.3. Yes, I see it on discuss.flarum.org.
I agree, I couldn't replicate this on 2.0 RC4.
@PrimateCoder as others have also said here, this it not caused by core or it's bundled extensions. I have narrowed this down to potentially two extensions, can you please share the output of php flarum info
Thanks for the detailed report and screenshots.
This turned out not to be a core bug — it's caused by fof/best-answer, which is why it reproduces on discuss.flarum.org (and any forum with that extension) but not on a vanilla install.
Root cause: best-answer applied width: 100% to every .Post-footer:
.Post-footer {
width: 100%;
.item-bestAnswerPost { ... }
}
Core lays the post footer out as a height: 0 inline-block so the likes/replies line sits on the same row as the floated post actions (Reply/Like). Forcing full width on all footers turns that into a full-width block, dropping the likes/replies line below the actions with the exaggerated gap you saw — on every post, not just ones with a best-answer preview.
Fix (scopes the rule to footers that actually render the preview) is up at FriendsOfFlarum/best-answer#133:
.Post-footer:has(.item-bestAnswerPost) {
width: 100%;
}
Closing here as it's an extension issue — please follow FriendsOfFlarum/best-answer#133 for the fix.