aboutsummaryrefslogtreecommitdiff
path: root/lib/responsive.less
blob: f63f90c982b1822858e44d2b189140a9a3389d36 (plain)
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
// Responsive.less
// For phone and tablet devices
// -------------------------------------------------------------


// UP TO LANDSCAPE PHONE
// ---------------------

@media (max-width: 480px) {
  // Remove width from containers
  .container {
    width: auto;
    padding: 0 15px;
  }
  // Undo negative margin on rows
  .row {
    margin-left: 0;
  }
  // Make all columns even
  [class*="span"] {
    float: none;
    display: block;
    width: auto;
    margin: 0;
  }
  // Resize modals
  .modal {
    width: auto;
    margin: 0;
  }

  // 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: 0;
  }

}


// LANDSCAPE PHONE TO SMALL DESKTOP & PORTRAIT TABLET
// --------------------------------------------------

@media (min-width: 480px) and (max-width: 768px) {
  // Remove width from containers
  .container {
    width: auto;
    padding: 0 10px;
  }
  // Undo negative margin on rows
  .row {
    margin-left: 0;
  }
  // Make all columns even
  [class*="span"] {
    float: none;
    display: block;
    width: auto;
    margin: 0;
  }
}


// PORTRAIT TABLET TO DEFAULT DESKTOP
// ----------------------------------

@media (min-width: 768px) and (max-width: 940px) {

  // Reset grid variables
  @gridColumns:       16;
  @gridColumnWidth:   44px;
  @gridGutterWidth:   20px;
  @siteWidth:         748px;

  // Bring grid mixins to recalculate widths
  .columns(@columnSpan: 1) {
    width: (@gridColumnWidth * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1));
  }
  .offset(@columnOffset: 1) {
    margin-left: (@gridColumnWidth * @columnOffset) + (@gridGutterWidth * (@columnOffset - 1)) + @gridGutterWidth;
  }

  // 16cols at 30px wide with 16px gutters
  .container {
    width: @siteWidth;
  }

  // Default columns
  .span1     { .columns(1); }
  .span2     { .columns(2); }
  .span3     { .columns(3); }
  .span4     { .columns(4); }
  .span5     { .columns(5); }
  .span6     { .columns(6); }
  .span7     { .columns(7); }
  .span8     { .columns(8); }
  .span9     { .columns(9); }
  .span10    { .columns(10); }
  .span11    { .columns(11); }
  .span12    { .columns(12); }

  // Offset column options
  .offset1   { .offset(1); }
  .offset2   { .offset(2); }
  .offset3   { .offset(3); }
  .offset4   { .offset(4); }
  .offset5   { .offset(5); }
  .offset6   { .offset(6); }
  .offset7   { .offset(7); }
  .offset8   { .offset(8); }
  .offset9   { .offset(9); }
  .offset10  { .offset(10); }
  .offset11  { .offset(11); }
  .offset12  { .offset(12); }

}

/*
// LARGE DESKTOP & UP
// ------------------

@media (min-width: 1210px) {

  // Reset grid variables
  @gridColumns:       12;
  @gridColumnWidth:   70px;
  @gridGutterWidth:   30px;
  @siteWidth:         1170px;

  // Bring grid mixins to recalculate widths
  .columns(@columnSpan: 1) {
    width: (@gridColumnWidth * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1));
  }
  .offset(@columnOffset: 1) {
    margin-left: (@gridColumnWidth * @columnOffset) + (@gridGutterWidth * (@columnOffset - 1)) + @gridGutterWidth;
  }

  .container {
    width: @siteWidth;
  }
  [class*="span"] {
    margin-left: @gridGutterWidth;
  }

  // Default columns
  .span1     { .columns(1); }
  .span2     { .columns(2); }
  .span3     { .columns(3); }
  .span4     { .columns(4); }
  .span5     { .columns(5); }
  .span6     { .columns(6); }
  .span7     { .columns(7); }
  .span8     { .columns(8); }
  .span9     { .columns(9); }
  .span10    { .columns(10); }
  .span11    { .columns(11); }
  .span12    { .columns(12); }

  // Offset column options
  .offset1   { .offset(1); }
  .offset2   { .offset(2); }
  .offset3   { .offset(3); }
  .offset4   { .offset(4); }
  .offset5   { .offset(5); }
  .offset6   { .offset(6); }
  .offset7   { .offset(7); }
  .offset8   { .offset(8); }
  .offset9   { .offset(9); }
  .offset10  { .offset(10); }
  .offset11  { .offset(11); }
  .offset12  { .offset(12); }

}
*/