Skip to content

Instantly share code, notes, and snippets.

@johncionci
Created December 1, 2013 18:51
Show Gist options
  • Save johncionci/7739150 to your computer and use it in GitHub Desktop.
Save johncionci/7739150 to your computer and use it in GitHub Desktop.
WordPress 320px Responsive Layout
/*
* 320px layout supports: ( max-width 320px )
*
* 10px | 300px | 10px
* Posts are not floated left, can be resized with container eq 300px
*
* 10px | 100% ( 300px ) | 10px
*
* @required
* rem-mixin.scss
*
* @assumptions
* * { box-sizing: border-box; }
* font sizes, margins, & padding all use REMS
* widths all use percantage based values
*/
#page {
margin: 0 auto;
max-width: 320px;
width: 100%;
}
#content {
@include rem(margin, 0, 1);
}
#primary {
float: none;
width: 100%;
.post {
float: left;
margin: 0;
width: 300px;
}
}
#secondary {
float: none;
min-width: none;
max-width: none;
width: 100%;
}
<!-- This should mimick the typical output of the basetheme structure -->
<div id="page" class="hfeed site">
<div id="content" class="site-content">
<section id="primary" class="content-area">
<article class="post">Article One</article>
<article class="post">Article Two</article>
</section><!-- #primary -->
<div id="secondary" class="widget-area" role="complementary">
<aside class="widget">Widget</aside>
</div><!-- #secondary -->
</div><!-- #content -->
</div><!-- #page -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment