Repository navigation
template layout improvements #17
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
Open
drammock
wants to merge
6
commits into
scientific-python:main
Choose a base branch
from
drammock:width
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5d3e851
wider main content (closes #13)
drammock 394dcae
center footer items at narrow widths
drammock da3ba3e
use more width of footer on narrow screens
drammock 55cbe75
better distribution of whitespace in footer
drammock 4fb0e5b
even better whitespace distribution in footer
drammock f8117d1
adaptive number of rows for icon links in footer
drammock 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 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
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -14,6 +14,20 @@ main { | |||||||||||||||||||||||||||||||||||||
| * doesn't grow <main> to push the footer offscreen. | ||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||
| min-height: 0; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| /* Align main content with the navbar (2rem padding, max 1440px). | ||||||||||||||||||||||||||||||||||||||
| * text starts under the logo, and the page contents starts near the search box. | ||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||
| @media (min-width: 1024px) { | ||||||||||||||||||||||||||||||||||||||
| grid-template-columns: | ||||||||||||||||||||||||||||||||||||||
| [screen-start] calc(max(2rem, 50% - 720px) + 1.25rem) | ||||||||||||||||||||||||||||||||||||||
| [screen-inset-start page-start page-inset-start body-outset-start body-start body-inset-start middle-start gutter-left-start gutter-left-end gutter-right-start] | ||||||||||||||||||||||||||||||||||||||
| 1fr | ||||||||||||||||||||||||||||||||||||||
| [gutter-right-end middle-end body-inset-end body-end body-outset-end] | ||||||||||||||||||||||||||||||||||||||
| 20.5rem | ||||||||||||||||||||||||||||||||||||||
| [page-inset-end page-end screen-inset-end] max(2rem, 50% - 720px) | ||||||||||||||||||||||||||||||||||||||
| [screen-end]; | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+22
to
+29
Contributor
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. Is it possible to reformat like this, or does the auto-formatter complain?
Suggested change
|
||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| .footer { | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -33,8 +47,9 @@ main { | |||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| /* Outer content grid */ | ||||||||||||||||||||||||||||||||||||||
| & .outer-grid { | ||||||||||||||||||||||||||||||||||||||
| /* logo, project description, link columns, social icons */ | ||||||||||||||||||||||||||||||||||||||
| grid-template-columns: 2fr 6fr 8fr 3fr; | ||||||||||||||||||||||||||||||||||||||
| /* logo, project description, link columns, social icons; | ||||||||||||||||||||||||||||||||||||||
| * all but the description are "auto" for better whitespace distribution */ | ||||||||||||||||||||||||||||||||||||||
| grid-template-columns: auto 1fr auto auto; | ||||||||||||||||||||||||||||||||||||||
| column-gap: 4rem; | ||||||||||||||||||||||||||||||||||||||
| align-items: center; | ||||||||||||||||||||||||||||||||||||||
| margin: 0rem 4rem; | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -44,10 +59,27 @@ main { | |||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| @media (max-width: 640px) { | ||||||||||||||||||||||||||||||||||||||
| /* Tighten spacing on mid-size screens to give the columns more room */ | ||||||||||||||||||||||||||||||||||||||
| @media (max-width: 1279px) { | ||||||||||||||||||||||||||||||||||||||
| & .outer-grid { | ||||||||||||||||||||||||||||||||||||||
| column-gap: 2rem; | ||||||||||||||||||||||||||||||||||||||
| margin: 0; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| /* Stack everything vertically below the theme's large breakpoint */ | ||||||||||||||||||||||||||||||||||||||
| @media (max-width: 1023px) { | ||||||||||||||||||||||||||||||||||||||
| & .outer-grid { | ||||||||||||||||||||||||||||||||||||||
| grid-template-columns: 1fr; | ||||||||||||||||||||||||||||||||||||||
| justify-items: start; | ||||||||||||||||||||||||||||||||||||||
| justify-items: center; | ||||||||||||||||||||||||||||||||||||||
| text-align: center; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| /* One centered, wrapping row of icons instead of a 2-column grid */ | ||||||||||||||||||||||||||||||||||||||
| & .footer-icons { | ||||||||||||||||||||||||||||||||||||||
| display: flex; | ||||||||||||||||||||||||||||||||||||||
| flex-wrap: wrap; | ||||||||||||||||||||||||||||||||||||||
| justify-content: center; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
|
|
@@ -70,6 +102,12 @@ main { | |||||||||||||||||||||||||||||||||||||
| column-gap: 1.5rem; | ||||||||||||||||||||||||||||||||||||||
| line-height: normal; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| /* Two columns that hug the link text, so no dead space sits beside them | ||||||||||||||||||||||||||||||||||||||
| * (handles case where longest link in one col is much longer than in other col) */ | ||||||||||||||||||||||||||||||||||||||
| @media (min-width: 1024px) { | ||||||||||||||||||||||||||||||||||||||
| grid-template-columns: repeat(2, max-content); | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| & a { | ||||||||||||||||||||||||||||||||||||||
| color: white; | ||||||||||||||||||||||||||||||||||||||
| text-decoration-color: white; | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -89,6 +127,18 @@ main { | |||||||||||||||||||||||||||||||||||||
| column-gap: 3rem; | ||||||||||||||||||||||||||||||||||||||
| row-gap: 1rem; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| /* One row, or two rows if there are 5+ icons, with as many columns as | ||||||||||||||||||||||||||||||||||||||
| * the icons need (adapts to the number of icons, and keeps them from | ||||||||||||||||||||||||||||||||||||||
| * overflowing their column) */ | ||||||||||||||||||||||||||||||||||||||
| @media (min-width: 1024px) { | ||||||||||||||||||||||||||||||||||||||
| grid-template-columns: none; | ||||||||||||||||||||||||||||||||||||||
| grid-auto-flow: column; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| &:has(> :nth-child(5)) { | ||||||||||||||||||||||||||||||||||||||
| grid-template-rows: repeat(2, auto); | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| & img { | ||||||||||||||||||||||||||||||||||||||
| filter: invert(100%); | ||||||||||||||||||||||||||||||||||||||
| margin-bottom: 0.1rem; | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -138,4 +188,10 @@ h4 { | |||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| .copyright { | ||||||||||||||||||||||||||||||||||||||
| font-size: smaller; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| /* Don't widen the socials column to fit the copyright text; wrap to the icons' width | ||||||||||||||||||||||||||||||||||||||
| * instead (only when not stacked, so it can stay on one line on narrow screens) */ | ||||||||||||||||||||||||||||||||||||||
| @media (min-width: 1024px) { | ||||||||||||||||||||||||||||||||||||||
| contain: inline-size; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
TODO: code formatting to make this section more readable, plus some more comments (e.g, "matching the alignment of items in the topbar" etc)