Repository navigation
13: fix: make the layout work on a phone - #36
Merged
Merged
Conversation
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.
What. Rebuilds the layout mobile first and adds a shared
Sectioncomponent so page rhythm isdecided once.
Why. The site was unusable on a phone and it was my fault in two specific ways.
I redefined Tailwind's
--spacingfrom 4px to 8px in@theme, trying to encode the 8 point grid.That doubles every spacing utility on every element at once, so
mt-12became 96px andgap-5became 40px. The grid is now kept by using even steps instead, so
px-4is 16px.The header was unconditional: a wordmark, two text links and a button need roughly 438px, and the
narrowest phone in common use is 320. It scrolled sideways. The text links now appear at the small
breakpoint and above, and the call to action stays visible at every width.
The whole site also shipped with exactly one breakpoint,
min-width: 48rem, becausemd:was theonly prefix used anywhere. Padding and type now move at three.
Tests. 37, up from 33. Four of them guard this specifically: the navigation is hidden below the
small breakpoint, the call to action never is,
--spacingis not redefined, and the stylesheet hasmore than two breakpoints. Two were mutation checked, by unhiding the navigation and by putting the
spacing override back.
What I cannot check. I have no browser here, so I read markup and stylesheets rather than
looking at the page. If it still reads wrong after this, tell me what specifically and I will treat
that as the fault rather than what I can measure.
Part of #2.