File tree 4 files changed +76
-44
lines changed
4 files changed +76
-44
lines changed Original file line number Diff line number Diff line change 1
1
var packages = require ( "./packages" ) ;
2
2
require ( "./styles/styles.less!" ) ;
3
- window . PACKAGES = packages ;
4
-
5
- // sets sidebar height to window height
6
- function setSidebarHeightOnResize ( ) {
7
- var windowHeight = window . innerHeight ;
8
- document . getElementsByClassName ( "sidebar" ) [ 0 ] . style . height = windowHeight + "px" ;
9
- }
10
- setSidebarHeightOnResize ( ) ;
11
- window . onresize = function ( ) {
12
- setSidebarHeightOnResize ( ) ;
13
- } ;
3
+ window . PACKAGES = packages ;
Original file line number Diff line number Diff line change 1
1
@import " locate://bit-docs-site/styles/variables.less" ;
2
2
3
- @sidebar-width : 250px ;
3
+ .flex-mixin {
4
+ display : -webkit-box ;
5
+ display : -moz-box ;
6
+ display : -ms-flexbox ;
7
+ display : -webkit-flex ;
8
+ display : flex ;
9
+ }
10
+
11
+ html {
12
+ height : 100% ;
13
+ box-sizing : border-box ;
14
+ }
15
+
16
+ * , * :before , * :after {
17
+ box-sizing : inherit ; // https://css-tricks.com/box-sizing/
18
+ }
4
19
5
20
body {
21
+ .flex-mixin ;
22
+ width : 100% ;
23
+ height : 100vh ;
24
+ margin : auto ;
25
+ flex-direction : column ;
26
+ justify-content : space-between ;
6
27
font-family : @defaultFontFamily ;
7
- margin-left : (@sidebar-width + 25 );
8
28
}
9
- .sidebar {
10
- float : left ;
11
- margin : 0 ;
12
- margin-top : -19px ;
13
- max-width : @sidebar-width ;
14
- overflow : auto ;
15
- position : fixed ;
16
- left : 0 ;
17
-
18
- ul {
19
- white-space : nowrap ;
29
+
30
+ header , footer {
31
+ width : 100% ;
32
+ flex-shrink : 0 ; // retain height
33
+ }
34
+
35
+ .content {
36
+ flex-grow : 1 ; // fill space vertical
37
+ flex-shrink : 1 ; // IE10 sets flex-shrink to 0
38
+
39
+ @media @desktops {
40
+ .flex-mixin ;
41
+ overflow : auto ; // scroll .content when .main overflows
42
+ }
43
+
44
+ .sidebar {
45
+ overflow : auto ; // scroll .sidebar when <ul> overflows
46
+ flex-shrink : 0 ; // retain width
47
+
48
+ .current > a {
49
+ font-weight : bold ;
50
+ }
20
51
}
21
52
22
- .current > a {
23
- font-weight : bold ;
53
+ .main {
54
+ flex-grow : 1 ; // fill space horizontal
55
+ flex-shrink : 1 ;
56
+ padding-left : 25px ;
57
+ padding-right : 25px ;
58
+ overflow-x : hidden ; // hide <pre> code overflow
24
59
}
25
- }
60
+ }
Original file line number Diff line number Diff line change 92
92
@logo : " ../img/logo.svg" ;
93
93
@logoFooter : " ../img/logo-grey.svg" ;
94
94
@logoWidth : 170px ;
95
+
96
+ // Breakpoints for use with @media
97
+
98
+ @smartphones : ~ " only screen and (max-width: 767px)" ;
99
+ @desktops : ~ " only screen and (min-width: 767px)" ;
Original file line number Diff line number Diff line change 1
- { {#unless hideSidebar} }
2
- { {> sidebar.mustache} }
3
- { {/unless} }
4
- <article >
5
- { {#unless hideTitle} }
6
- { {> title.mustache} }
1
+ <div class =" content" >
2
+ { {#unless hideSidebar} }
3
+ { {> sidebar.mustache} }
7
4
{ {/unless} }
5
+ <article class =" main" >
6
+ { {#unless hideTitle} }
7
+ { {> title.mustache} }
8
+ { {/unless} }
8
9
9
- { {#unless hideDescription} }
10
- { {#if description} }
11
- { {> description.mustache} }
12
- { {/if } }
13
- { {/unless} }
10
+ { {#unless hideDescription} }
11
+ { {#if description} }
12
+ { {> description.mustache} }
13
+ { {/if } }
14
+ { {/unless} }
14
15
15
- { {#unless hideBody} }
16
- { {#if body} }
17
- { {> body.mustache} }
18
- { {/if } }
19
- { {/unless} }
20
- </article >
16
+ { {#unless hideBody} }
17
+ { {#if body} }
18
+ { {> body.mustache} }
19
+ { {/if } }
20
+ { {/unless} }
21
+ </article >
22
+ </div >
You can’t perform that action at this time.
0 commit comments