Skip to content

Commit 65fcf8c

Browse files
Ryan Wilsonchasenlehara
authored andcommitted
Improve the sidebar’s styling & fix scrolling issues (#513)
Fixes #505 Fixes #507
1 parent 46b9185 commit 65fcf8c

File tree

11 files changed

+19801
-20186
lines changed

11 files changed

+19801
-20186
lines changed

docMap.json

Lines changed: 19596 additions & 20041 deletions
Large diffs are not rendered by default.

sidebar/test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ QUnit.test('Search map is parsed', function(assert) {
136136
assert.ok(childrenLength > 1 && childrenLength < 10, 'rootPage has a reasonable number of children');
137137
});
138138

139-
QUnit.test('Parents with @subchildren should show their grandchildren', function(assert) {
139+
// This used to test how the Recipes page had groups underneath it,
140+
// but that page was removed and Chasen couldn’t find another like it.
141+
QUnit.skip('Parents with @subchildren should show their grandchildren', function(assert) {
140142
var vm = new ViewModel({searchMap: searchMap});
141143
var pageMap = vm.pageMap;
142144
var guidesPage = pageMap['guides'];

static/base.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
body {
22
height: 100%;
3-
overflow: hidden;
3+
overflow: auto;
44
margin: 0px;
55
}
66
html {

static/canjs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ function navigate(href, updateLocation) {
278278
}
279279

280280
// Scroll to the top of the page
281-
$articleContainer.scrollTop(0);
281+
$('html').scrollTop(0);
282282

283283
var $article = $content.find("article");
284284
var currentPage = $content.filter("#everything").attr("data-current-page");

static/header.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
display: flex;
1212
align-items: center;
1313
flex-shrink: 0;
14+
grid-area: header;
1415
padding: 0 @gutter*2;
16+
position: fixed;
17+
width: 100%;
1518
@media screen and (max-width: 499px){
1619
padding: 0 @gutter;
1720
}
@@ -88,6 +91,7 @@
8891
align-items: center;
8992
font-size: 12px;
9093
height: @brand-height;
94+
padding-top: 7px;
9195
cursor: pointer;
9296
.version-number::after {
9397
display: inline-block;

static/layout.less

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
#everything {
2-
.flex;
3-
-webkit-flex-flow: row wrap;
4-
justify-content: flex-start;
5-
align-items: stretch;
6-
flex-wrap: nowrap;
72
box-sizing: border-box;
8-
height: calc(~"100% - 53px");// 53px header
93
-webkit-overflow-scrolling: touch;
104
padding-bottom: 0;
115
transition: padding-bottom @transition-speed ease;
6+
display:-ms-grid;
7+
display: grid;
8+
-ms-grid-columns: 300px 1fr;
9+
grid-template-columns: max-content 1fr;
10+
grid-template-areas: "header header" "left-nav content";
1211
}
1312
#left {
13+
-ms-grid-row: 2;
14+
-ms-grid-column: 1;
15+
-ms-grid-column-span: 1;
16+
grid-area: left-nav;
17+
height: calc(~"100vh - " @brand-height);// 53px header
18+
overflow-y: scroll;
1419
position: fixed;
1520
scroll-behavior: smooth;
21+
top: @brand-height;
1622
width: @sidebar-width;
17-
min-width: 0;
1823
transition: min-width @transition-speed ease;
1924
border-right: 3px solid #F4F4F4;
2025
@media screen and (min-width: @breakpoint){
21-
flex-shrink: 0;
22-
padding: 0px;
23-
position: relative;
26+
.sticky;
27+
margin: @brand-height 0 0;
2428
width: auto;
2529
}
2630
}
2731
#right {
28-
height: 100%;
29-
min-height: 100%;
30-
max-height: 100%;
3132
background: white;
33+
display: flex;
34+
-ms-grid-column: 2;
35+
grid-area: content;
3236
overflow-x: hidden;
33-
// z-index: 90;
37+
padding-top: @brand-height;
3438
position: relative;
3539
left: 0;
3640
.transition-left;
3741
flex-grow: 1;
38-
@media screen and (min-width: @breakpoint){
39-
display: flex;
40-
flex-grow: 1;
41-
}
4242
}
4343
.column {
4444
height: 100%;

static/mixins.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
font-size: .9em;
3636
color: @code-color;
3737
}
38+
.sticky {
39+
position: -webkit-sticky;
40+
position: sticky;
41+
}
3842
.transition-left {
3943
-webkit-transition: left .5s ;
4044
-moz-transition: left .5s;

static/mobile.less

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ label[for="nav-trigger"] {
2424
label:hover{
2525
background: @border-color;
2626
}
27-
.nav-trigger ~ #everything #right {
28-
width: 100%;
29-
}
3027
.nav-trigger:checked ~ #everything #right {
3128
@media screen and (max-width: @breakpoint){
3229
flex-shrink: 0;

0 commit comments

Comments
 (0)