Skip to content

Commit

Permalink
miscellaneous fixes to print style
Browse files Browse the repository at this point in the history
  • Loading branch information
Anand Thakker committed Nov 24, 2014
1 parent 738521c commit 74dae3a
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 22 deletions.
6 changes: 3 additions & 3 deletions _includes/lesson-title.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% if lesson.lesson != 0 %}
Lesson {{ lesson.lesson }}:
{% else %}
{% if lesson.type == 'habit' %}
Habits of Mind:
{% else %}
Lesson {{ lesson.lesson }}:
{% endif %}
{% assign words = (lesson.title | prepend: '' | split: ' ') %}
{% for word in words %}{{ word | capitalize }} {% endfor %}
2 changes: 1 addition & 1 deletion _layouts/book.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% assign summary = lessons | where: 'type', 'summary' | first %}
{% assign answers = lessons | where: 'type', 'answers' | first %}

<section class="book">
<section class="book book-{{page.book}}">

<section class="info"></section>

Expand Down
15 changes: 8 additions & 7 deletions _lessons/02-0-visualize.html → _lessons/02-0-1-visualize.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
published: true
book: 2
lesson: 0
title: visualize
published: true
book: 2
lesson: 0-1
title: visualize
type: habit
layout: habit-lesson
layout: habit-lesson
---
{% raw %}

Expand All @@ -30,10 +30,11 @@
<p>There are many ways to <em class="vocab">visualize</em> in
solving a problem. Sometimes visualizing can be as simple
as plotting several points on a graph and interpreting
what you see. Visualizing can also involve <em>altering</em> or <em>adding to</em> a given picture to make the problem
what you see. Visualizing can also involve <em>altering</em>
or <em>adding to</em> a given picture to make the problem
easier.</p>

<div class="problem" data-problem-number="2">
<div class="problem new-page" data-problem-number="2">
<div class="problem-content">
<p>How many square units are enclosed by the polygon DANCE
below?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
published: true
book: 2
lesson: 0
lesson: 0-2
type: habit
title: represent symbolically
layout: habit-lesson
Expand Down Expand Up @@ -252,7 +252,7 @@
<p>In the figure below, a rectangle is divided into four
squares. The width (bottom side) of the rectangle is 35 cm.
Find the perimeter of the rectangle.</p>

<figure>
<img src="../images/02-0-represent-symbolically/9-2%20Symbolically%2019.tif.jpg" >
</figure>
Expand Down
12 changes: 11 additions & 1 deletion _sass/_book.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,22 @@ $margin-print-gutter: 54pt;
*/
.book-page {
counter-reset: page 1;
.book > section { page-break-before: always; }
.book > section { page-break-before: right; }
.book > .habit-lesson { page-break-before: left; }
.book > .habit-list { page-break-before: left; }
.book > .toc { page-break-before: right; }
.book > #summary-and-review .problems { page-break-before: auto; }
}

// These string-sets are used by the paged-media for running headers.
h1 > .book { string-set: book-title content(); }
.book > section h1 { string-set: lesson-title content(); }
@include page-setup();


/**
* book-specific exceptions to the above page-break scheme.
*/


}
5 changes: 4 additions & 1 deletion _sass/_habits.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@ $habit-header-lines: 6;
// habits-colors.scss

.development {
page-break-after: always;
margin-bottom: lines(3);

/* grey boxes */
@include mq(sm, print) {
.problem {
/* reset column settings from base lesson style */
margin-left: 0;
margin-bottom: lines(3);

&.new-page { margin-top: lines(5); }

width: 100%;

background: $grey-color-light;
Expand Down
26 changes: 19 additions & 7 deletions _sass/_lessons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}

.new-page {
@include mq(page) {
@include mq(print) {
display: block;
page-break-before: always;
}
Expand Down Expand Up @@ -134,6 +134,7 @@
}

@include mq(print) {
page-break-before: always;
column-count: 2;
-webkit-column-count: 2;
column-fill: auto;
Expand All @@ -150,15 +151,26 @@
color: $grey-color-light;
font-weight: 700;
font-size: 2.5em;
@include mq(sm, print) { font-size: 4em; column-span: all; }
@include mq(sm, print) {
font-size: 4em;

/* reset from the make-column layout above */
margin-top: 0;
padding: 0;
float: none;
width: 100%;

column-span: all;
}
}

/* Exploring in Depth heading */
h2:nth-of-type(2) {
@include make-column(sm,3);
@include make-column-offset(sm,3);
@include make-column(print, 6);
@include make-column-offset(print, 6);
@include make-column(sm,6);
@include make-column-offset(sm,6);
@include make-column(print, 12);
@include make-column-offset(print, 12);
word-spacing: 20em;
}

/* center figures by default within problems section. */
Expand All @@ -170,6 +182,6 @@

@include mq(print) {
h1,h2 { page-break-after: avoid; }
.problem p { page-break-inside: avoid; }
// .problem > p { page-break-inside: avoid; }
}
}

0 comments on commit 74dae3a

Please sign in to comment.