-
Notifications
You must be signed in to change notification settings - Fork 21
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/6475 Table of Contents overflowing side of window and global footer #140
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c4b0f71
Fix horizontal overflow of toc
adamwoodnz 8a02230
Add script to position fixed toc above footer is it overlaps
adamwoodnz a6d66c1
Add lodash throttle
adamwoodnz f745b0f
:lipstick: eslint ignore lodash throttle issues
adamwoodnz 04edd31
Switch to lodash throttle
adamwoodnz 2e48993
Add minified lodash.throttle
adamwoodnz 0b58315
:lipstick: follow file naming convention
adamwoodnz 9f6df36
Use CSS to handle vertical overflow
adamwoodnz File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2006,7 +2006,7 @@ aside[id^="nav_menu"] .widget-title { | |
.table-of-contents { | ||
display: flex; | ||
flex-direction: column; | ||
min-width: 230px; | ||
min-width: 210px; | ||
border: 1px solid #eee; | ||
margin: 30px 0; | ||
z-index: 1; | ||
|
@@ -2034,7 +2034,7 @@ aside[id^="nav_menu"] .widget-title { | |
} | ||
|
||
.items { | ||
overflow-y: scroll; | ||
overflow-y: auto; | ||
} | ||
} | ||
} | ||
|
@@ -2243,7 +2243,6 @@ div[class*="-table-of-contents-container"] { | |
background: linear-gradient(to right, #fafafa 35%, #fff 35%); | ||
max-width: 100%; | ||
padding: 0; | ||
overflow: auto; | ||
} | ||
|
||
#content { | ||
|
@@ -2270,7 +2269,7 @@ div[class*="-table-of-contents-container"] { | |
padding: 4rem 0 4rem 4rem; | ||
background: #fff; | ||
box-sizing: border-box; | ||
width: $single-handbook-content-primary-width * 100%; | ||
width: 72%; | ||
|
||
@media (max-width: 876px) { | ||
padding: 4rem 20px; | ||
|
@@ -2458,37 +2457,12 @@ body.responsive-show { | |
|
||
@media (min-width: 90em) { | ||
.site-main .table-of-contents { | ||
position: fixed; | ||
width: 15vw; | ||
|
||
.code-reference & { | ||
margin-left: 0; | ||
left: calc( #{ $devhub-wrap-content-width } + ( ( 100vw - #{ $devhub-wrap-content-width } ) / 2 ) ); | ||
top: $devhub-wrap-toc-position-top; | ||
max-height: calc(90vh - #{ $devhub-wrap-toc-position-top }); | ||
} | ||
|
||
// Pages with sidebar | ||
.widget-area + & { | ||
left: calc( #{ $single-handbook-content-width } + ( ( 100vw - #{ $single-handbook-content-width } ) / 2 ) ); | ||
top: $single-handbook-toc-position-top; | ||
max-height: calc(90vh - #{ $single-handbook-toc-position-top }); | ||
} | ||
} | ||
} | ||
|
||
@media (min-width: 877px) { | ||
// Pages which are not code reference and without a sidebar | ||
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. This was required for local dev, but in production all pages have a sidebar on the left so this code is redundant |
||
.site-main .table-of-contents:not(.code-reference .site-main .table-of-contents):not(.widget-area + .site-main .table-of-contents) { | ||
position: fixed; | ||
width: 15vw; | ||
position: sticky; | ||
width: $single-handbook-toc-width; | ||
margin: 0 calc(-#{ $single-handbook-toc-width } - 30px) 0; | ||
float: right; | ||
top: $single-handbook-toc-position-top; | ||
left: calc( | ||
#{ $single-handbook-content-width } * #{ $single-handbook-content-primary-width } | ||
+ ( ( 100vw - #{ $single-handbook-content-width } ) / 2 ) | ||
+ 15px | ||
); | ||
max-height: calc(90vh - #{ $single-handbook-toc-position-top }); | ||
max-height: calc(80vh - #{ $single-handbook-toc-position-top }); | ||
} | ||
} | ||
|
||
|
5 changes: 2 additions & 3 deletions
5
source/wp-content/themes/wporg-developer/scss/settings/_dimensions.scss
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
$single-handbook-content-width: 960px; | ||
$single-handbook-content-primary-width: 0.72; | ||
$single-handbook-toc-position-top: 200px; | ||
$single-handbook-toc-width: 15vw; | ||
$single-handbook-toc-position-top: 150px; | ||
|
||
$devhub-wrap-content-width: 60em; | ||
$devhub-wrap-toc-position-top: 210px; |
32 changes: 7 additions & 25 deletions
32
source/wp-content/themes/wporg-developer/stylesheets/main.css
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
A parent with this property stops
position: sticky
working on children. I'm unsure why it's being set and haven't observed any changes as a result of removing it.