responsive-1.less
5.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
//side menu toggler in mobile view
@sidebar-toggler-background: #444;
@sidebar-toggler-color: #FFF;
.main-container .menu-toggler {
display: none;
}
.enable_responsive_menu() when(@enable-responsive-menu = true) {
@duration : 0.2s;
//responsive sidebar
@media only screen and (max-width: @grid-float-breakpoint-max) {
.sidebar.responsive:before {
display: none;
}
.sidebar.responsive {
.box-shadow(~"2px 1px 2px 0 rgba(0,0,0,0.15)");
z-index: @zindex-sidebar-fixed;
overflow: hidden;
max-height: 0;
.transform(translateX(-@sidebar-width - 10));
//"left" or "margin-left" transition is slow on Chrome, so we use translateX
-webkit-transition: -webkit-transform @duration linear 0s, max-height 0s linear @duration;
-moz-transition: -moz-transform @duration linear 0s, max-height 0s linear @duration;
-o-transition: -o-transform @duration linear 0s, max-height 0s linear @duration;
transition: transform @duration linear 0s, max-height 0s linear @duration;
position: relative;
bottom: auto;
//top: auto has a problem with android default browser if sidebar is fixed
left: @sidebar-width;
margin-left: -(@sidebar-width);
//why are we doing this?
//we don't use "position: absolute" so that our page's height is at least as tall as .sidebar
//and therefore our page background is white when sidebar is expanded (whitened by .main-container:before) (it won't happen on position: absolute)
//but "position: relative" will push ".main-content" to left
//so we use negative "margin-left" on .sidebar to get more space and bring back .main-content
//and then we move .sidebar again back to its place using "left" property
//so it will look like the "position: absolute" alternative, but it's not
}
}
@media (min-width: @screen-compact-menu) and (max-width: @grid-float-breakpoint-max) {
.sidebar.responsive.compact {
.transform(translateX(-@sidebar-compact-width - 10));
&.push_away.display + .main-content {
.transform(translateX(@sidebar-compact-width));
}
.navbar.navbar-fixed-top + .main-container & {
&.push_away.display ~ .footer .footer-inner {
.transform(translateX(@sidebar-compact-width));
}
}
}
}
@media only screen and (max-width: @grid-float-breakpoint-max) {
.sidebar.responsive {
&.menu-min {
.transform(translateX(-@sidebar-min-width - 10));
}
&.display {
.transform(none) !important;//to override .rtl's
overflow: visible;
max-height: 2000px;
-webkit-transition-delay: 0s;
-moz-transition-delay: 0s;
-o-transition-delay: 0s;
transition-delay: 0s;
}
//push .main-content to left
&.push_away {
.box-shadow(none) !important;//to override .RTL's
&:before {
display: block !important;
}
+ .main-content {
-webkit-transition: -webkit-transform @duration linear 0s;
-moz-transition: -moz-transform @duration linear 0s;
-o-transition: -o-transform @duration linear 0s;
transition: transform @duration linear 0s;
}
&.display + .main-content {
.transform(translateX(@sidebar-width));
}
&.display.menu-min + .main-content {
.transform(translateX(@sidebar-min-width));
}
}
.navbar.navbar-fixed-top + .main-container & {
&.push_away {
&:before {
height: 5000px;
}
.enable_footer_responsive_menu_push() when (@enable-footer = true) {
~ .footer .footer-inner {
-webkit-transition: -webkit-transform @duration linear 0s;
-moz-transition: -moz-transform @duration linear 0s;
-o-transition: -o-transform @duration linear 0s;
transition: transform @duration linear 0s;
}
&.display ~ .footer .footer-inner {
.transform(translateX(@sidebar-width));
}
&.display.menu-min ~ .footer .footer-inner {
.transform(translateX(@sidebar-min-width));
}
}
.enable_footer_responsive_menu_push();
}
}
.nav-list > li.active:after {
height: @nav-item-height + 2;
}
.nav-list li li.active > a:after {
display: none;
}
&.menu-min .nav-list > li.active:after {
display: block;
}
+ .main-content {
margin-left: 0 !important;
}
}
}
.enable_container_responsive_1() when(@enable-container = true) {
//maybe disable transition when it is not good enough!
@media only screen and (min-width: @screen-sm-min) and (max-width: @grid-float-breakpoint-max) {
.main-container.container .sidebar.responsive {
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
transition: none;
display: none;
&.display {
display: block;
}
&.push_away {
+ .main-content, ~ .footer .footer-inner {
-webkit-transition: none !important;
-moz-transition: none !important;
-o-transition: none !important;
transition: none !important;
.transform(none) !important;
}
}
}
}
}
.enable_container_responsive_1();
}
.enable_responsive_menu();
//************************************************************************************
//remove the following to disable fixed sidebar (style1 - default) on smaller devices
//if you also want to disable fixed breadcrumbs on smalelr devices, refer to breadcrumbs.less
@media only screen and (max-width: @grid-float-breakpoint-max) {
.responsive.sidebar-fixed {
position: fixed;
}
.main-container .menu-toggler.fixed {
position: fixed;
left: auto;
z-index: @zindex-sidebar-fixed - 1;
-moz-backface-visibility: hidden;
}
}