Skip to content

Commit 2ffee37

Browse files
authored
Merge pull request #230 from canjs/224-fix-ios-bug
Fixes bug scrolling to the top in IOS #224
2 parents c023786 + 0df4568 commit 2ffee37

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

static/mobile.less

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,33 @@ label[for="nav-trigger"] {
1717
font-weight: 700;
1818
.border-radius;
1919
z-index: 99;
20-
transition: background .25s;
20+
transition: background @transition-speed;
2121
}
2222
label:hover{
2323
background: @border-color;
2424
}
2525
.nav-trigger:checked + label{
26-
left: @sidebar-width + @gutter*2;
26+
left: @sidebar-width + @gutter*2;
27+
transition: left @transition-speed*2;
2728
}
2829
.nav-trigger ~ #everything #right {
2930
width: 100%;
3031
}
3132
.nav-trigger:checked ~ #everything #right {
32-
flex-shrink: 0;
33-
width: auto;
34-
position: fixed;
35-
left: @sidebar-width;
36-
overflow-x: hidden;
37-
z-index: 50;
33+
@media screen and (max-width: @breakpoint){
34+
flex-shrink: 0;
35+
width: auto;
36+
position: fixed;
37+
left: @sidebar-width;
38+
overflow-x: hidden;
39+
z-index: 50;
40+
}
41+
}
42+
.nav-trigger:not(:checked) ~ #everything #left {
43+
@media screen and (max-width: @breakpoint){
44+
visibility: hidden;
45+
transition: visibility @transition-speed;
46+
}
3847
}
3948
.nav-trigger + label {
4049
.transition-left
@@ -52,4 +61,4 @@ label:hover{
5261
display: none;
5362
}
5463
}
55-
}
64+
}

static/sidebar.less

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
.search-bar {
32
display:none;
43
background: @code-color;
@@ -10,8 +9,8 @@
109
color: white;
1110
font-weight: 300;
1211
}
13-
@media screen and (min-width: @breakpoint) {
14-
display: block;
12+
@media screen and (min-width: @breakpoint) {
13+
display: block;
1514
}
1615
}
1716

@@ -137,4 +136,4 @@ img.social-icon-small{
137136
}
138137
}
139138
}
140-
}
139+
}

static/variables.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@gutter: 15px;
1515
@breakpoint: 1000px;
1616
@sidebar-width: 250px;
17+
@transition-speed: .25s;
1718

1819
/*----- TYPE -----*/
1920
@font-weight-heading: 500;
20-

0 commit comments

Comments
 (0)