Skip to content

Commit

Permalink
use css/flexbox rather than js for sticky footer
Browse files Browse the repository at this point in the history
  • Loading branch information
willnorris committed Oct 21, 2021
1 parent 2f383ed commit 973ce70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
7 changes: 7 additions & 0 deletions assets/css/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,20 @@ html {

body {
background-color: white;
display: flex;
min-height: 100vh;
flex-direction: column;

@media (prefers-color-scheme: dark) {
background-color: var(--tw-color-gray-900-experimental);
color: var(--tw-color-gray-faint);
}
}

main {
flex: 1;
}

.content {
padding: var(--feather-grid-mega) 0;
}
Expand Down
9 changes: 0 additions & 9 deletions static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@ function removeClassByClass(target, className) {
}


// Create sticky footer by defining min-height of site wrapper
var site = document.getElementsByTagName("main")[0]
var footer = document.getElementsByClassName("footer")[0]
// Year in Review website does not have a footer
if (footer) {
var footerHeight = footer.clientHeight
site.style.minHeight = "calc(100vh - " + footerHeight + "px)"
}

// Create DOM element for navigation bar
var navBar = document.getElementsByTagName("nav")[0]

Expand Down

0 comments on commit 973ce70

Please sign in to comment.