Skip to content

Commit 2e84a8d

Browse files
author
Swaagie
committed
[ux] proper offset for guide and add grid classes
1 parent d38ba3f commit 2e84a8d

File tree

3 files changed

+405
-404
lines changed

3 files changed

+405
-404
lines changed

client.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ pipe.once('package.json:render', function render(pagelet) {
1111
* @api private
1212
*/
1313
placeholders.on('click mouseover', 'pre a:not(.trigger)', function guide() {
14-
guides.hide();
14+
var scroll = $(document).scrollTop()
15+
, offset = scroll - guides.parent().offset().top;
1516

17+
guides.hide();
1618
placeholders.find('#'+ this.href.split('#').pop().replace('.', '\\.'))
17-
.css('top', $(document).scrollTop() +'px')
19+
.css('top', (offset < 0 ? scroll : offset) +'px')
1820
.show();
1921
});
2022

css.styl

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
.guides
22
.example
33
box-sizing: border-box
4-
min-height: 1px
54

5+
.intro
66
.guides
7-
float: left
87
font-family: "proxima-nova-1","proxima-nova-2",sans-serif
8+
9+
.guides
10+
float: left
911
font-size: 21px
1012
position: relative
11-
width: 30.75%
1213

1314
code
1415
background-color: #F8F8F8
@@ -34,8 +35,6 @@
3435
text-decoration: underline
3536

3637
.intro
37-
width: 65.4%
38-
3938
a
4039
color: #4183C4
4140
text-decoration: none
@@ -49,7 +48,7 @@
4948
small
5049
color: #888
5150
display: block
52-
font-size: 16px
51+
font-size: 14px
5352
font-weight: normal
5453
text-transform: uppercase
5554

@@ -60,7 +59,6 @@
6059
margin-right: 3.8%
6160
padding: 12px
6261
position: relative
63-
width: 65.4%
6462

6563
.key
6664
color: navy

0 commit comments

Comments
 (0)