Skip to content

Commit

Permalink
adds sticky footer
Browse files Browse the repository at this point in the history
  • Loading branch information
sdellis committed Sep 24, 2021
1 parent 8b400ca commit ec3973f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
16 changes: 16 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -453,3 +453,19 @@
// }
// }
// }

html, body {
height: 100%;
margin: 0;
}

#main-container {
min-height: calc(100vh - 400px);
}
.wrapper {
padding-bottom: 300px;
}
.footer {
height: 50px;
margin-top: -300px;
}
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<![endif]-->

</head>
<body class="<%= render_body_class %>">
<body class="<%= render_body_class %> h-100">
<%= render partial: 'shared/header_navbar' %>
<%= render partial: 'shared/announcements' %>
<%= render partial: 'shared/masthead' %>
Expand Down
12 changes: 7 additions & 5 deletions app/views/layouts/spotlight/base.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<%= render 'shared/analytics' if Rails.env.production? %>
</head>
<body class="<%= render_body_class %>">
<body>
<div id="skip-link">
<%= link_to t('blacklight.skip_links.search_field'), '#search_field', class: 'element-invisible element-focusable rounded-bottom py-2 px-3', data: { turbolinks: 'false' } %>
<%= link_to t('blacklight.skip_links.main_content'), '#main-container', class: 'element-invisible element-focusable rounded-bottom py-2 px-3', data: { turbolinks: 'false' } %>
Expand All @@ -39,12 +39,14 @@
<%= content_for?(:header_content) ? yield(:header_content) : "" %>

<main id="main-container" class="<%= container_classes %>" role="main" aria-label="<%= t('blacklight.main.aria.main_container') %>">
<%= content_for(:container_header) %>
<div class="wrapper">
<%= content_for(:container_header) %>
<%= render partial: 'shared/flash_msg', layout: 'shared/flash_messages' %>
<%= render partial: 'shared/flash_msg', layout: 'shared/flash_messages' %>

<div class="row">
<%= content_for?(:content) ? yield(:content) : yield %>
<div class="row">
<%= content_for?(:content) ? yield(:content) : yield %>
</div>
</div>
</main>

Expand Down
3 changes: 1 addition & 2 deletions app/views/shared/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<footer class="lux" role="contentinfo">
<library-footer></library-footer>
<a href="#l-page" class="back-to-top"></a>
<library-footer></library-footer>
</footer>

0 comments on commit ec3973f

Please sign in to comment.