Skip to content

Commit

Permalink
feat(footer): remove fixed height by using flexbox for sticky footer
Browse files Browse the repository at this point in the history
  • Loading branch information
talha131 committed Jun 29, 2019
1 parent 137a02a commit d9d84e1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
22 changes: 14 additions & 8 deletions static/css/elegant.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
/* Base */
/* #push.height = -#content-sans-footer.margin-bottom = #footer.margin-top + ul.footer-content */
body,
html {
html,
body {
height: 100%;
}
#content-sans-footer {
min-height: 100%;
margin-bottom: -60px;
body {
display: flex;
flex-direction: column;
}
#push {
height: 60px;
div#content {
flex: 1 0 auto;
}
footer {
flex-shrink: 0;
border-top: 1px solid rgba(0, 0, 0, 0.2);
font: 0.8em Calibri, Tahoma, Arial, Sans-Serif;
margin: 15px 0 0 0;
padding: 0;
}
h1,
h2,
Expand Down
2 changes: 0 additions & 2 deletions templates/_includes/footer.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<footer>
<div id="footer">
<ul class="footer-content">
{% from '_includes/_defaults.html' import SITESUBTITLE with context %}
{% if SITESUBTITLE %}
Expand All @@ -24,7 +23,6 @@
{% endif %}
</li>
</ul>
</div>
{% if AMAZON_ONELINK %}
<div id="amzn-assoc-ad-{{ AMAZON_ONELINK }}"></div>
<script async src="//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US&adInstanceId={{ AMAZON_ONELINK }}">
Expand Down
3 changes: 1 addition & 2 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
{% include '_includes/analytics.html' %}
</head>
<body>
<div id="content-sans-footer">
<div id="content">
<div class="navbar navbar-static-top">
<div class="navbar-inner">
<div class="container-fluid">
Expand Down Expand Up @@ -89,7 +89,6 @@
<div class="span1"></div>
</div>
</div>
<div id="push"></div>
</div>
{% include '_includes/footer.html' %}
{% block script %}
Expand Down

0 comments on commit d9d84e1

Please sign in to comment.