forked from tlvince/bootstrap-stylus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresponsive.styl
329 lines (231 loc) · 6.24 KB
/
responsive.styl
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
/*!
* Bootstrap Responsive v2.0.1
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world $twitter by $mdo and $fat.
*/
// Responsive.styl
// For phone and tablet devices
// -------------------------------------------------------------
// REPEAT VARIABLES & MIXINS
// -------------------------
// Required since we compile the responsive stuff separately
@import "variables.styl" // Modify this for custom colors, font-sizes, etc
@import "mixins.styl"
// RESPONSIVE CLASSES
// ------------------
// Hide from screenreaders and browsers
// Credit: HTML5 Boilerplate
.hidden
display: none
visibility: hidden
// UP TO LANDSCAPE PHONE
// ---------------------
@media (max-width: 480px)
// Smooth out the collapsing/expanding nav
.nav-collapse
-webkit-transform: translate3d(0, 0, 0) // activate the GPU
// Block level the page header small tag for readability
.page-header h1 small
display: block
line-height: $baseLineHeight
// Make span* classes full width
input[class*="span"],
select[class*="span"],
textarea[class*="span"],
.uneditable-input
display: block
width: 100%
min-height: 28px /* Make inputs at least the height of their button counterpart */
/* Makes inputs behave like true block-level elements */
-webkit-box-sizing: border-box /* Older Webkit */
-moz-box-sizing: border-box /* Older FF */
-ms-box-sizing: border-box /* IE8 */
box-sizing: border-box /* CSS3 spec*/
// But don't let it screw up prepend/append inputs
.input-prepend input[class*="span"],
.input-append input[class*="span"]
width: auto
// Update checkboxes for iOS
input[type="checkbox"],
input[type="radio"]
border: 1px solid #ccc
// Remove the horizontal form styles
.form-horizontal .control-group > label
float: none
width: auto
padding-top: 0
text-align: left
// Move over all input controls and content
.form-horizontal .controls
margin-left: 0
// Move the options list down to align with labels
.form-horizontal .control-list
padding-top: 0 // has to be padding because margin collaspes
// Move over buttons in .form-actions to align with .controls
.form-horizontal .form-actions
padding-left: 10px
padding-right: 10px
// Modals
.modal
position: absolute
top: 10px
left: 10px
right: 10px
width: auto
margin: 0
&.fade.in
top: auto
.modal-header .close
padding: 10px
margin: -10px
// Carousel
.carousel-caption
position: static
// LANDSCAPE PHONE TO SMALL DESKTOP & PORTRAIT TABLET
// --------------------------------------------------
@media (max-width: 767px)
// GRID & CONTAINERS
// -----------------
// Remove width from containers
.container
width: auto
padding: 0 20px
// Fluid rows
.row-fluid
width: 100%
// Undo negative margin on rows
.row
margin-left: 0
// Make all columns even
.row > [class*="span"],
.row-fluid > [class*="span"]
float: none
display: block
width: auto
margin: 0
// PORTRAIT TABLET TO DEFAULT DESKTOP
// ----------------------------------
@media (min-width: 768px) and (max-width: 979px)
// Fixed grid
$gridSystem-generate(12, 42px, 20px)
// Fluid grid
$fluidGridSystem-generate(12, 5.801104972%, 2.762430939%)
// Input grid
$inputGridSystem-generate(12, 42px, 20px)
// TABLETS AND BELOW
// -----------------
@media (max-width: 979px)
// UNFIX THE TOPBAR
// ----------------
// Remove any padding from the body
body
padding-top: 0
// Unfix the navbar
.navbar-fixed-top
position: static
margin-bottom: $baseLineHeight
.navbar-fixed-top .navbar-inner
padding: 5px
.navbar .container
width: auto
padding: 0
// Account for brand name
.navbar .brand
padding-left: 10px
padding-right: 10px
margin: 0 0 0 -5px
// Nav collapse clears brand
.navbar .nav-collapse
clear: left
// Block-level the nav
.navbar .nav
float: none
margin: 0 0 ($baseLineHeight / 2)
.navbar .nav > li
float: none
.navbar .nav > li > a
margin-bottom: 2px
.navbar .nav > .divider-vertical
display: none
.navbar .nav .nav-header
color: $navbarText
text-shadow: none
// Nav and dropdown links in navbar
.navbar .nav > li > a,
.navbar .dropdown-menu a
padding: 6px 15px
font-weight: bold
color: $navbarLinkColor
$border-radius(3px)
.navbar .dropdown-menu li + li a
margin-bottom: 2px
.navbar .nav > li > a:hover,
.navbar .dropdown-menu a:hover
background-color: $navbarBackground
// Dropdowns in the navbar
.navbar .dropdown-menu
position: static
top: auto
left: auto
float: none
display: block
max-width: none
margin: 0 15px
padding: 0
background-color: transparent
border: none
$border-radius(0)
$box-shadow(none)
.navbar .dropdown-menu:before,
.navbar .dropdown-menu:after
display: none
.navbar .dropdown-menu .divider
display: none
// Forms in navbar
.navbar-form,
.navbar-search
float: none
padding: ($baseLineHeight / 2) 15px
margin: ($baseLineHeight / 2) 0
border-top: 1px solid $navbarBackground
border-bottom: 1px solid $navbarBackground
$shadow = inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1)
$box-shadow($shadow)
// Pull right (secondary) nav content
.navbar .nav.pull-right
float: none
margin-left: 0
// Static navbar
.navbar-static .navbar-inner
padding-left: 10px
padding-right: 10px
// Navbar button
.btn-navbar
display: block
// Hide everything in the navbar save .brand and toggle button */
.nav-collapse
overflow: hidden
height: 0
// DEFAULT DESKTOP
// ---------------
@media (min-width: 980px)
.nav-collapse.collapse
height: auto !important
// LARGE DESKTOP & UP
// ------------------
@media (min-width: 1200px)
// Fixed grid
$gridSystem-generate(12, 70px, 30px)
// Fluid grid
$fluidGridSystem-generate(12, 5.982905983%, 2.564102564%)
// Input grid
$inputGridSystem-generate(12, 70px, 30px)
// Thumbnails
.thumbnails
margin-left: -30px
.thumbnails > li
margin-left: 30px