fix(composer): centre the column vertically - #205
Merged
Conversation
The column centred horizontally but sat at the top of the page, because align-items only handles the cross axis. `justify-content: safe center` rather than plain `center`, and the `safe` is load-bearing. In a scroll container a plain `center` clips the top of anything taller than the viewport and puts it permanently out of reach: with a long build history the heading itself would have been unscrollable. `safe` centres while the content fits and falls back to start alignment the moment it does not. There is deliberately no plain `center` declared above it as a fallback. A browser without `safe` support drops the whole declaration and lands on start alignment, which is exactly today's behaviour; declaring `center` first would give those browsers the clipping bug instead. Padding is symmetric now, since asymmetric edges make a centred column read as sitting low. 1465 tests green. Lint and build clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The composer column centred horizontally but sat at the top of the page:
align-itemsonly handles the cross axis.Why
safe centerand notcenterIn a scroll container, a plain
justify-content: centerclips the top of anything taller than the viewport and puts it permanently out of reach. With a long build history the heading itself would have been unscrollable.safe centercentres while the content fits and falls back to start alignment the moment it doesn't.There is deliberately no plain
centerfallback declared above it. A browser withoutsafesupport drops the whole declaration and lands on start alignment, which is exactly today's behaviour; declaringcenterfirst would hand those browsers the clipping bug instead.Padding is symmetric now, since asymmetric edges make a centred column read as sitting low.
1465 tests green· lint and build clean. CSS-only, so jsdom can't assert it; verified by build and by reasoning about the overflow case.