-
Notifications
You must be signed in to change notification settings - Fork 133
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
Fix heading padding FOUC (option 3 with modifications: sticky header) #1939
Merged
Merged
Changes from 20 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
28c3358
Both options
ang-zeyu 2ed7491
Make sticky demo non-searchable
ang-zeyu c3fa410
update tests
ang-zeyu 597019b
typo
ang-zeyu 12979af
Finish mobile <header sticky>'s site / page nav
ang-zeyu a91e90a
Cleanup, fix / streamline resizing logic
ang-zeyu 0b44177
Ug edits
ang-zeyu e24c96e
Sticky header only
ang-zeyu 39a6eaa
Test file updates
ang-zeyu 98485a5
remove 1 more [fixed] selector
ang-zeyu 8a4cae8
some more test file updates
ang-zeyu 5eb413f
Merge branch 'master' into fix-fixed-header-both
ang-zeyu 526f273
padding tweak
ang-zeyu 41af9f5
Remove some unnecessary padding changes from header[fixed]
ang-zeyu 3728ec3
Add another example
ang-zeyu 38d5a9e
link "css variable" to mdn docs
ang-zeyu b5672db
Update scrolling logic
ang-zeyu fd74b17
overflow-x for content wrapper
ang-zeyu a58bb21
Adapt scrolling properly
ang-zeyu e9f6732
overflow-x for content wrapper (other files+update tests)
ang-zeyu 8547c90
Adapt left/right layout container max heights
ang-zeyu facad3a
Fix overflow value
ang-zeyu aa9f60b
Docs update
ang-zeyu b9358fb
Remove temporary announcement banner
ang-zeyu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,7 @@ mark { | |
margin: 0 auto; | ||
min-width: 0; | ||
max-width: 1000px; | ||
overflow-x: auto; | ||
padding: 0.8rem 20px 0 20px; | ||
transition: 0.4s; | ||
-webkit-transition: 0.4s; | ||
|
@@ -64,9 +65,8 @@ mark { | |
#site-nav, | ||
#page-nav { | ||
position: sticky; | ||
top: 0; | ||
top: var(--sticky-header-height); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2nd change per the docs |
||
flex: 0 0 auto; | ||
padding-top: 1rem; | ||
max-width: 300px; | ||
width: 300px; | ||
} | ||
|
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
Documenting the layout file changes for review + future release changelog noting (should be simplified though I think =P)
1st of 3 important changes in the layout file:
This might be somewhat controversial, but is unfortunately necessary with a sticky header. At least, I haven't found another solution.
The issue (without this) occurs on pages that overflow (e.g. "formatting contents" page or "Using html javascript and css"). The nearest scrolling ancestor which is the page / root element expands to accomodate the overflown content, which in turn does 2 things:
window.innerWidth/Height
are erroneous (although there is an easy alternative for thisdocument.documentElement.clientWidth/Height
)Gif demo (open image in new tab to view in order): there are 3 settings here.
translateY
) to show the issue is really unrelated to header hiding / anything we are doing.You can try removing the
overflow-x
when testing this PR to see the issue better, its a little hard to present on a gif.The fix: I've set
overflow-x
on the content wrapper which significantly changes ux on mobile devices (but just pages that overflow).Pros:
Cons:
Not sure if there's a better solution =, but imo its a good enough compromise.