Massage the grid layout

This commit is contained in:
Michael Rose 2016-03-20 15:20:33 -04:00
parent 1e3b62d893
commit 780b30c9f6
12 changed files with 56 additions and 39 deletions

View file

@ -1,6 +1,6 @@
<aside class="toc"> <aside class="sidebar__right">
<nav class="toc" markdown="1">
<header><h4 class="toc__title"><i class="fa fa-{{ include.icon | default: 'book' }}"></i> {{ include.title | default: site.data.ui-text[site.locale].toc_label }}</h4></header> <header><h4 class="toc__title"><i class="fa fa-{{ include.icon | default: 'book' }}"></i> {{ include.title | default: site.data.ui-text[site.locale].toc_label }}</h4></header>
<nav markdown="1">
* Auto generated table of contents * Auto generated table of contents
{:toc .toc__menu} {:toc .toc__menu}
</nav> </nav>

View file

@ -35,7 +35,7 @@ layout: compress
{% endif %} {% endif %}
<div id="main" role="main"> <div id="main" role="main">
<div class="sidebar sticky"> {% if page.author_profile or page.sidebar %}<div class="sidebar sticky">
{% if page.author_profile %}{% include author-profile.html %}{% endif %} {% if page.author_profile %}{% include author-profile.html %}{% endif %}
{% if page.sidebar %} {% if page.sidebar %}
{% for s in page.sidebar %} {% for s in page.sidebar %}
@ -52,8 +52,7 @@ layout: compress
{% if s.text %}{{ s.text | markdownify }}{% endif %} {% if s.text %}{{ s.text | markdownify }}{% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% unless page.author_profile or page.sidebar %}&nbsp;{% endunless %} </div>{% endif %}
</div>
{{ content }} {{ content }}
</div> </div>

View file

@ -5,10 +5,10 @@
.archive { .archive {
margin-bottom: 2em; margin-bottom: 2em;
@include breakpoint($medium) { @include breakpoint($medium) {
@include span(10 of 12 last); @include span(12 of 12);
} }
@include breakpoint($large) { @include breakpoint($large) {
@include suffix(3 of 12); @include span(10 of 12 last);
} }
@include breakpoint($x-large) { @include breakpoint($x-large) {
@include prefix(0.5 of 12); @include prefix(0.5 of 12);

View file

@ -7,7 +7,7 @@
@include clearfix; @include clearfix;
margin-top: 3em; margin-top: 3em;
padding: 0 2em 3em; padding: 0 2em 3em;
@include breakpoint($medium) { @include breakpoint($large) {
padding-left: 1em; padding-left: 1em;
padding-right: 1em; padding-right: 1em;
} }
@ -23,7 +23,7 @@
} }
.page__footer-copyright { .page__footer-copyright {
@include breakpoint($medium) { @include breakpoint($large) {
@include prefix(2 of 12); @include prefix(2 of 12);
} }
@include breakpoint($x-large) { @include breakpoint($x-large) {
@ -33,7 +33,7 @@
} }
.page__footer-follow { .page__footer-follow {
@include breakpoint($medium) { @include breakpoint($large) {
@include prefix(2 of 12); @include prefix(2 of 12);
} }
@include breakpoint($x-large) { @include breakpoint($x-large) {

View file

@ -9,7 +9,7 @@
font-family: $sans-serif-narrow; font-family: $sans-serif-narrow;
font-weight: 700; font-weight: 700;
text-transform: uppercase; text-transform: uppercase;
@include breakpoint($medium) { @include breakpoint($large) {
padding-left: 1em; padding-left: 1em;
padding-right: 1em; padding-right: 1em;
} }
@ -23,7 +23,7 @@
/* Site name */ /* Site name */
.site-name { .site-name {
@include breakpoint($medium) { @include breakpoint($large) {
@include prefix(2 of 12); @include prefix(2 of 12);
} }
@include breakpoint($x-large) { @include breakpoint($x-large) {
@ -33,7 +33,7 @@
} }
.masthead__menu { .masthead__menu {
@include breakpoint($medium) { @include breakpoint($large) {
@include prefix(2 of 12); @include prefix(2 of 12);
} }
@include breakpoint($x-large) { @include breakpoint($x-large) {

View file

@ -9,7 +9,7 @@
margin-top: 2em; margin-top: 2em;
padding-left: 2em; padding-left: 2em;
padding-right: 2em; padding-right: 2em;
@include breakpoint($medium) { @include breakpoint($large) {
padding-left: 1em; padding-left: 1em;
padding-right: 1em; padding-right: 1em;
} }
@ -20,13 +20,15 @@
.page { .page {
@include breakpoint($medium) { @include breakpoint($medium) {
@include span(10 of 12 last); padding-right: $right-sidebar-width-narrow;
} }
@include breakpoint($large) { @include breakpoint($large) {
@include span(10 of 12 last);
padding-right: $right-sidebar-width; padding-right: $right-sidebar-width;
} }
@include breakpoint($x-large) { @include breakpoint($x-large) {
@include prefix(0.5 of 12); @include prefix(0.5 of 12);
padding-right: $right-sidebar-width-wide;
} }
} }
@ -67,7 +69,7 @@
z-index: 5; z-index: 5;
opacity: 0.5; opacity: 0.5;
border-radius: $border-radius 0 $border-radius 0; border-radius: $border-radius 0 $border-radius 0;
@include breakpoint($medium) { @include breakpoint($large) {
padding: 5px 10px; padding: 5px 10px;
} }
a { a {
@ -164,7 +166,7 @@
border-top: 1px solid $border-color; border-top: 1px solid $border-color;
@include clearfix(); @include clearfix();
float: left; float: left;
@include breakpoint($medium) { @include breakpoint($large) {
@include pre(2 of 12); @include pre(2 of 12);
} }
@include breakpoint($x-large) { @include breakpoint($x-large) {

View file

@ -2,15 +2,17 @@
SIDEBAR SIDEBAR
========================================================================== */ ========================================================================== */
/*
Default
========================================================================== */
.sidebar { .sidebar {
@include clearfix(); @include clearfix();
margin-bottom: 2em; margin-bottom: 2em;
padding-bottom: 1em; padding-bottom: 1em;
border-bottom: 1px solid $border-color; @include breakpoint($large) {
@include breakpoint($medium) {
@include span(2 of 12); @include span(2 of 12);
@include suffix(0.25 of 12); @include suffix(0.25 of 12);
border-bottom: none;
} }
@include breakpoint($x-large) { @include breakpoint($x-large) {
padding-right: 0; padding-right: 0;
@ -27,6 +29,28 @@
} }
} }
.sidebar__right {
@include breakpoint($medium) {
position: absolute;
top: 0;
right: 1em;
width: $right-sidebar-width-narrow;
padding-left: 2em;
@include breakpoint($large) {
width: $right-sidebar-width;
}
@include breakpoint($x-large) {
width: $right-sidebar-width-wide;
}
}
@include breakpoint($large) {
right: calc(50% - (0.5 * #{$large}) + 1em); // 50% - 1/2 of wrapper's max-width + wrapper padding
}
@include breakpoint($x-large) {
right: calc(50% - (0.5 * #{$x-large}) + 1em); // 50% - 1/2 of wrapper's max-width + wrapper padding
}
}
/* /*
Author profile and links Author profile and links
========================================================================== */ ========================================================================== */
@ -35,7 +59,7 @@
float: left; float: left;
width: 50px; width: 50px;
margin-right: 10px; margin-right: 10px;
@include breakpoint($medium) { @include breakpoint($large) {
float: none; float: none;
width: initial; width: initial;
} }
@ -48,7 +72,7 @@
.author__content { .author__content {
float: right; float: right;
width: calc(100% - 60px); // subtract avatar width + any margin/padding width: calc(100% - 60px); // subtract avatar width + any margin/padding
@include breakpoint($medium) { @include breakpoint($large) {
float: none; float: none;
width: 100%; width: 100%;
} }
@ -58,7 +82,7 @@
margin: 0; margin: 0;
font-family: $sans-serif-narrow; font-family: $sans-serif-narrow;
font-size: 20px; font-size: 20px;
@include breakpoint($medium) { @include breakpoint($large) {
margin-top: 10px; margin-top: 10px;
margin-bottom: 10px; margin-bottom: 10px;
} }
@ -68,7 +92,7 @@
margin-bottom: 10px; margin-bottom: 10px;
font-size: 14px; font-size: 14px;
font-style: italic; font-style: italic;
@include breakpoint($medium) { @include breakpoint($large) {
margin-bottom: 20px; margin-bottom: 20px;
} }
} }
@ -80,7 +104,7 @@
padding-right: 5px; padding-right: 5px;
font-size: 14px; font-size: 14px;
text-decoration: none; text-decoration: none;
@include breakpoint($medium) { @include breakpoint($large) {
display: block; display: block;
} }
&:hover { &:hover {

View file

@ -9,16 +9,6 @@
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 1px; letter-spacing: 1px;
background-color: #fff; background-color: #fff;
@include breakpoint($large) {
position: absolute;
top: 0;
right: calc(50% - (0.5 * #{$large}) + 1em); // 50% - 1/2 of wrapper's max-width + wrapper padding
width: $right-sidebar-width;
padding-left: 2em;
}
@include breakpoint($x-large) {
right: calc(50% - (0.5 * #{$x-large}) + 1em); // 50% - 1/2 of wrapper's max-width + wrapper padding
}
} }
.toc__title { .toc__title {
@ -53,7 +43,7 @@
// hide sub sub links on small screens // hide sub sub links on small screens
li > ul li { li > ul li {
display: none; display: none;
@include breakpoint($large) { @include breakpoint($medium) {
display: block; display: block;
} }
} }

View file

@ -81,7 +81,9 @@ $x-large : 1280px;
Grid Grid
========================================================================== */ ========================================================================== */
$right-sidebar-width-narrow : 200px;
$right-sidebar-width : 300px; $right-sidebar-width : 300px;
$right-sidebar-width-wide : 400px;
$susy: ( $susy: (
columns: 12, columns: 12,

File diff suppressed because one or more lines are too long

View file

@ -12,7 +12,7 @@ $(document).ready(function(){
var stickySideBar = function(){ var stickySideBar = function(){
var windowWidth = $(window).width(); var windowWidth = $(window).width();
if (windowWidth > 768) { if (windowWidth > 1024) {
// fix // fix
Stickyfill.rebuild(); Stickyfill.rebuild();
Stickyfill.init(); Stickyfill.init();

File diff suppressed because one or more lines are too long