Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
Make the page responsive down to 780px by switching to a table layout…
Browse files Browse the repository at this point in the history
…. Further scaling is possible if we want to remove elements from the header.
  • Loading branch information
brendanlong committed Dec 6, 2016
1 parent 791c76a commit 5de4259
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 15 deletions.
11 changes: 4 additions & 7 deletions r2/r2/public/static/discussion.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,8 @@
#header.discussion {
background: url(/static/background-discussion.jpg) no-repeat top left;
}

#header.discussion #header-img {
height: 55px;
@media (max-width: 975px) {
img#tagline {
display: none !important;
}
}

#header.discussion #tagline {
display: none;
}
2 changes: 1 addition & 1 deletion r2/r2/public/static/lesswrong.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#content.clear.fullwidth {
padding: 0 15px;
width: 920px;
max-width: 920px;
}

div.comment-meta span span {
Expand Down
Binary file modified r2/r2/public/static/logo-discussion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 21 additions & 7 deletions r2/r2/public/static/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ body {
background-color: #d8d8d8;
margin: 0;
padding: 0;
word-wrap: break-word;
overflow-wrap: break-word;
}
#wrapper {
background-color: #fff;
Expand All @@ -38,19 +40,29 @@ body {
box-shadow: 0px 0px 10px #555;
margin: 0 auto;
padding: 0;
width: 990px;
max-width: 990px;
min-width: 780px;
}
#main {
padding: 15px 20px;
display: table;
table-layout: fixed;
width: 100%;

}
#content {
float: left;
padding: 0 0 0 15px;
width: 695px;
width: 100%;
padding: 15px 20px 20px 35px;
}
#sidebar {
float: right;
width: 220px;
padding: 15px 20px 20px 0;
}
#header {
overflow: hidden;
}
#content, #sidebar {
display: table-cell;
vertical-align: top;
}


Expand Down Expand Up @@ -200,7 +212,9 @@ input, select, textarea, button {
a#logo {
display: block;
float: left;
margin: 35px 10px 0 35px;
height: 54px;
overflow: hidden;
margin: 35px 10px 14px 35px;
}
img#tagline {
display: block;
Expand Down
12 changes: 12 additions & 0 deletions r2/r2/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@
<meta name="description" content="${description | h}" />
%endif
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta id="viewport" name="viewport" content="width=device-width, initial-scale=1.0" />
<script>
/* Set initial screen size for screens smaller than our max width.
* This is necessary because the viewport tag stupidly forces a zoom
* and has no way to set the minimum width.
* Note: This doesn't work on Firefox Mobile :(
*/
if (screen.width < 780) {
var viewport = document.getElementById("viewport");
viewport.setAttribute("content", "width=780");
}
</script>
${self.robots()}
##these are globals, so they should be run first
##things that need are referenced by the reddit, the buttons, and
Expand Down

0 comments on commit 5de4259

Please sign in to comment.