Skip to content
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

Make footer sticky. #35

Merged
merged 3 commits into from
Jan 30, 2024
Merged

Conversation

rebeccacremona
Copy link
Contributor

Technique from https://developer.mozilla.org/en-US/docs/Web/CSS/Layout_cookbook/Sticky_footers

Before:
image

After:
image

Even though only the 404 page is affected at present, since it is the only short page, I moved the footer on the landing page and on the caselaw page, so that on every page, it is a sibling of main instead of a child of main, so that this CSS would work properly there, had they been shorter. (The footer was already a sibling of main on the gallery and about pages).

With this change, an empty page,

	<body>
		<cap-nav></cap-nav>
		<main id="main"></main>
		<cap-footer></cap-footer>
	</body>

looks like
image

instead of
image

@rebeccacremona rebeccacremona requested a review from a team as a code owner January 29, 2024 20:34
@rebeccacremona rebeccacremona requested review from mdellabitta and removed request for a team January 29, 2024 20:34
@mdellabitta
Copy link
Contributor

Assigning to @tinykite because I'm way out of my element! (HTML pun intended)

@mdellabitta mdellabitta requested a review from tinykite January 29, 2024 20:37
@rebeccacremona
Copy link
Contributor Author

@mdellabitta Yeah, CSS grid is pretty great! Observe that this literally only took one line: grid-template-rows: auto 1fr auto;!

Comment on lines 1 to 11
html {
height: 100%;
min-height: 100%;
}

body {
min-height: 100%;
display: grid;
grid-template-rows: auto 1fr auto;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if it would be helpful for me to write a style guide (after everything else critical is written, perhaps) about the conventions and organization strategies for cap static. The layout.css file is specifically intended for layout classes — that are prepended with l-.

For example, l-interiorPage

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 moved!

@tinykite
Copy link
Contributor

This is great! My only suggestion would be the move the global root selector classes you wrote (for body and html) to global.css

@rebeccacremona rebeccacremona merged commit 5aa5301 into harvard-lil:main Jan 30, 2024
1 check passed
@rebeccacremona rebeccacremona deleted the sticky-footer branch January 30, 2024 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants