Skip to content

Commit a46e2e2

Browse files
Merge branch 'master' into book-representation-3
2 parents 75dac15 + 3838fa0 commit a46e2e2

File tree

6 files changed

+47
-22
lines changed

6 files changed

+47
-22
lines changed

src/theme/book.css

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ table thead td {
114114
-moz-box-sizing: border-box;
115115
box-sizing: border-box;
116116
min-height: 100%;
117-
-webkit-transition: padding-left 0.5s;
118-
-moz-transition: padding-left 0.5s;
119-
-o-transition: padding-left 0.5s;
120-
-ms-transition: padding-left 0.5s;
121-
transition: padding-left 0.5s;
117+
-webkit-transition: padding-left 0.5s, margin-right 0.5s;
118+
-moz-transition: padding-left 0.5s, margin-right 0.5s;
119+
-o-transition: padding-left 0.5s, margin-right 0.5s;
120+
-ms-transition: padding-left 0.5s, margin-right 0.5s;
121+
transition: padding-left 0.5s, margin-right 0.5s;
122122
}
123123
@media only screen and (max-width: 1060px) {
124124
.page-wrapper {
@@ -130,6 +130,7 @@ table thead td {
130130
}
131131
.sidebar-visible .page-wrapper {
132132
padding-left: 300px;
133+
margin-right: -300px;
133134
}
134135
.page {
135136
outline: 0;
@@ -265,6 +266,12 @@ table thead td {
265266
.sidebar-visible .previous {
266267
left: 315px;
267268
}
269+
@media only screen and (max-width: 1060px) {
270+
.nav-wrapper {
271+
max-width: 750px;
272+
margin: 0 auto;
273+
}
274+
}
268275
.theme-popup {
269276
position: absolute;
270277
left: 10px;
@@ -284,7 +291,7 @@ table thead td {
284291
border-top-left-radius: inherit;
285292
border-top-right-radius: inherit;
286293
}
287-
@media only screen and (max-width: 1250px) {
294+
@media only screen and (max-width: 1060px) {
288295
.nav-chapters {
289296
display: none;
290297
}

src/theme/index.hbs

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,27 @@
9494
{{{ content }}}
9595
</div>
9696

97-
<!-- Mobile navigation buttons -->
98-
{{#previous}}
99-
<a rel="prev" href="{{link}}" class="mobile-nav-chapters previous" title="Previous chapter">
100-
<i class="fa fa-angle-left"></i>
101-
</a>
102-
{{/previous}}
103-
104-
{{#next}}
105-
<a rel="next" href="{{link}}" class="mobile-nav-chapters next" title="Next chapter">
106-
<i class="fa fa-angle-right"></i>
107-
</a>
108-
{{/next}}
97+
<!--
98+
Constrain the space between buttons on small screen so the total
99+
width of the buttons group will not exceed the main content
100+
above.
101+
-->
102+
<div class="nav-wrapper">
103+
<!-- Mobile navigation buttons -->
104+
{{#previous}}
105+
<a rel="prev" href="{{link}}" class="mobile-nav-chapters previous" title="Previous chapter">
106+
<i class="fa fa-angle-left"></i>
107+
</a>
108+
{{/previous}}
109+
110+
{{#next}}
111+
<a rel="next" href="{{link}}" class="mobile-nav-chapters next" title="Next chapter">
112+
<i class="fa fa-angle-right"></i>
113+
</a>
114+
{{/next}}
115+
116+
<div style="clear: both"></div>
117+
</div>
109118

110119
</div>
111120

@@ -139,7 +148,7 @@
139148
<script>
140149
var localAddrs = ["localhost", "127.0.0.1", ""];
141150
142-
// make sure we don't activate google analytics if the developer is
151+
// make sure we don't activate google analytics if the developer is
143152
// inspecting the book locally...
144153
if (localAddrs.indexOf(document.location.hostname) === -1) {
145154
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){

src/theme/stylus/nav-icons.styl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,10 @@
3636
.sidebar-visible .previous {
3737
left: $sidebar-width + $page-padding
3838
}
39+
40+
.nav-wrapper {
41+
@media only screen and (max-width: $max-page-width-with-hidden-sidebar) {
42+
max-width: $content-max-width
43+
margin: 0 auto
44+
}
45+
}

src/theme/stylus/page.styl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
min-height: 100%
88

99
// Animation: slide away
10-
transition: padding-left 0.5s
10+
transition: padding-left 0.5s, margin-right 0.5s
1111

1212
@media only screen and (max-width: $max-page-width-with-hidden-sidebar) {
1313
padding-left: 0
@@ -20,6 +20,7 @@
2020

2121
.sidebar-visible .page-wrapper {
2222
padding-left: $sidebar-width
23+
margin-right: - $sidebar-width
2324
}
2425

2526
.page {
@@ -30,7 +31,7 @@
3031
.content {
3132
margin-left: auto
3233
margin-right:auto
33-
max-width: 750px
34+
max-width: $content-max-width
3435
padding-bottom: 50px
3536

3637
a {

src/theme/stylus/theme-popup.styl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
}
2525

26-
@media only screen and (max-width: 1250px) {
26+
@media only screen and (max-width: $max-page-width-with-hidden-sidebar) {
2727

2828
.nav-chapters {
2929
display: none

src/theme/stylus/variables.styl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
$sidebar-width = 300px
22
$page-padding = 15px
33
$max-page-width-with-hidden-sidebar = 1060px
4+
$content-max-width = 750px

0 commit comments

Comments
 (0)