bootstrap-generators 2.0.1 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. data/README.md +258 -33
  2. data/Rakefile +0 -59
  3. data/lib/bootstrap/generators/engine.rb +6 -1
  4. data/lib/bootstrap/generators/version.rb +1 -1
  5. data/lib/generators/bootstrap/install/install_generator.rb +10 -2
  6. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.css.scss +120 -15
  7. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.less +206 -0
  8. data/lib/generators/bootstrap/install/templates/assets/stylesheets/fluid.css +2 -0
  9. data/lib/generators/bootstrap/install/templates/assets/stylesheets/fluid.css.less +5 -4
  10. data/lib/generators/bootstrap/install/templates/assets/stylesheets/fluid.css.scss +3 -2
  11. data/lib/generators/bootstrap/install/templates/assets/stylesheets/hero.css +2 -0
  12. data/lib/generators/bootstrap/install/templates/assets/stylesheets/hero.css.less +5 -4
  13. data/lib/generators/bootstrap/install/templates/assets/stylesheets/hero.css.scss +3 -2
  14. data/lib/generators/bootstrap/install/templates/config/initializers/simple_form.rb +3 -0
  15. data/lib/generators/bootstrap/install/templates/form_builders/form_builder/_form.html.erb +3 -3
  16. data/lib/generators/bootstrap/install/templates/form_builders/form_builder/_form.html.haml +2 -2
  17. data/lib/generators/bootstrap/install/templates/form_builders/simple_form/_form.html.erb +1 -1
  18. data/lib/generators/bootstrap/install/templates/form_builders/simple_form/_form.html.haml +1 -1
  19. data/test/fixtures/application.js +3 -0
  20. data/test/lib/generators/bootstrap/install_generator_test.rb +4 -3
  21. data/test/test_helper.rb +8 -1
  22. data/vendor/assets/images/glyphicons-halflings-white.png +0 -0
  23. data/vendor/assets/images/glyphicons-halflings.png +0 -0
  24. data/vendor/assets/javascripts/bootstrap-alert.js +28 -32
  25. data/vendor/assets/javascripts/bootstrap-button.js +29 -33
  26. data/vendor/assets/javascripts/bootstrap-carousel.js +33 -21
  27. data/vendor/assets/javascripts/bootstrap-collapse.js +47 -26
  28. data/vendor/assets/javascripts/bootstrap-dropdown.js +18 -10
  29. data/vendor/assets/javascripts/bootstrap-modal.js +25 -17
  30. data/vendor/assets/javascripts/bootstrap-popover.js +13 -10
  31. data/vendor/assets/javascripts/bootstrap-scrollspy.js +44 -18
  32. data/vendor/assets/javascripts/bootstrap-tab.js +12 -7
  33. data/vendor/assets/javascripts/bootstrap-tooltip.js +40 -35
  34. data/vendor/assets/javascripts/bootstrap-transition.js +30 -20
  35. data/vendor/assets/javascripts/bootstrap-typeahead.js +29 -15
  36. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/accordion.less +5 -0
  37. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/alerts.less +2 -14
  38. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/bootstrap.less +2 -2
  39. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/breadcrumbs.less +2 -0
  40. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/button-groups.less +76 -33
  41. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/buttons.less +32 -24
  42. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/carousel.less +0 -0
  43. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/close.less +12 -1
  44. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/code.less +6 -6
  45. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/component-animations.less +7 -5
  46. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/dropdowns.less +58 -45
  47. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/forms.less +205 -144
  48. data/vendor/twitter/bootstrap/less/grid.less +5 -0
  49. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/hero-unit.less +3 -1
  50. data/vendor/twitter/bootstrap/less/labels-badges.less +55 -0
  51. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/layouts.less +1 -1
  52. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/mixins.less +235 -179
  53. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/modals.less +13 -6
  54. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/navbar.less +131 -72
  55. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/navs.less +53 -43
  56. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/pager.less +6 -0
  57. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/pagination.less +1 -0
  58. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/popovers.less +0 -0
  59. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/progress-bars.less +27 -5
  60. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/reset.less +8 -3
  61. data/vendor/twitter/bootstrap/less/responsive-1200px-min.less +26 -0
  62. data/vendor/twitter/bootstrap/less/responsive-767px-max.less +149 -0
  63. data/vendor/twitter/bootstrap/less/responsive-768px-979px.less +17 -0
  64. data/vendor/twitter/bootstrap/less/responsive-navbar.less +153 -0
  65. data/vendor/twitter/bootstrap/less/responsive-utilities.less +41 -0
  66. data/vendor/twitter/bootstrap/less/responsive.less +48 -0
  67. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/scaffolding.less +4 -4
  68. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/sprites.less +42 -9
  69. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/tables.less +46 -20
  70. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/thumbnails.less +14 -2
  71. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/tooltip.less +0 -0
  72. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/type.less +27 -13
  73. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/utilities.less +0 -0
  74. data/vendor/twitter/bootstrap/less/variables.less +206 -0
  75. data/vendor/{assets/stylesheets → twitter/bootstrap}/less/wells.less +10 -0
  76. data/vendor/{assets/stylesheets/scss/accordion.scss → twitter/bootstrap/sass/_accordion.scss} +5 -0
  77. data/vendor/{assets/stylesheets/scss/alerts.scss → twitter/bootstrap/sass/_alerts.scss} +3 -15
  78. data/vendor/{assets/stylesheets/scss/breadcrumbs.scss → twitter/bootstrap/sass/_breadcrumbs.scss} +2 -0
  79. data/vendor/{assets/stylesheets/scss/button-groups.scss → twitter/bootstrap/sass/_button-groups.scss} +76 -33
  80. data/vendor/{assets/stylesheets/scss/buttons.scss → twitter/bootstrap/sass/_buttons.scss} +33 -25
  81. data/vendor/{assets/stylesheets/scss/carousel.scss → twitter/bootstrap/sass/_carousel.scss} +1 -1
  82. data/vendor/{assets/stylesheets/scss/close.scss → twitter/bootstrap/sass/_close.scss} +12 -1
  83. data/vendor/{assets/stylesheets/scss/code.scss → twitter/bootstrap/sass/_code.scss} +7 -7
  84. data/vendor/{assets/stylesheets/scss/component-animations.scss → twitter/bootstrap/sass/_component-animations.scss} +9 -7
  85. data/vendor/{assets/stylesheets/scss/dropdowns.scss → twitter/bootstrap/sass/_dropdowns.scss} +58 -45
  86. data/vendor/{assets/stylesheets/scss/forms.scss → twitter/bootstrap/sass/_forms.scss} +205 -145
  87. data/vendor/twitter/bootstrap/sass/_grid.scss +5 -0
  88. data/vendor/{assets/stylesheets/scss/hero-unit.scss → twitter/bootstrap/sass/_hero-unit.scss} +3 -1
  89. data/vendor/twitter/bootstrap/sass/_labels-badges.scss +52 -0
  90. data/vendor/{assets/stylesheets/scss/layouts.scss → twitter/bootstrap/sass/_layouts.scss} +2 -2
  91. data/vendor/{assets/stylesheets/scss/mixins.scss → twitter/bootstrap/sass/_mixins.scss} +246 -182
  92. data/vendor/{assets/stylesheets/scss/modals.scss → twitter/bootstrap/sass/_modals.scss} +14 -7
  93. data/vendor/{assets/stylesheets/scss/navbar.scss → twitter/bootstrap/sass/_navbar.scss} +132 -73
  94. data/vendor/{assets/stylesheets/scss/navs.scss → twitter/bootstrap/sass/_navs.scss} +53 -43
  95. data/vendor/{assets/stylesheets/scss/pager.scss → twitter/bootstrap/sass/_pager.scss} +6 -0
  96. data/vendor/{assets/stylesheets/scss/pagination.scss → twitter/bootstrap/sass/_pagination.scss} +1 -0
  97. data/vendor/{assets/stylesheets/scss/popovers.scss → twitter/bootstrap/sass/_popovers.scss} +0 -0
  98. data/vendor/{assets/stylesheets/scss/progress-bars.scss → twitter/bootstrap/sass/_progress-bars.scss} +27 -5
  99. data/vendor/{assets/stylesheets/scss/reset.scss → twitter/bootstrap/sass/_reset.scss} +8 -3
  100. data/vendor/twitter/bootstrap/sass/_responsive-1200px-min.scss +26 -0
  101. data/vendor/twitter/bootstrap/sass/_responsive-767px-max.scss +149 -0
  102. data/vendor/twitter/bootstrap/sass/_responsive-768px-979px.scss +17 -0
  103. data/vendor/twitter/bootstrap/sass/_responsive-navbar.scss +153 -0
  104. data/vendor/twitter/bootstrap/sass/_responsive-utilities.scss +41 -0
  105. data/vendor/{assets/stylesheets/scss/scaffolding.scss → twitter/bootstrap/sass/_scaffolding.scss} +4 -4
  106. data/vendor/{assets/stylesheets/scss/sprites.scss → twitter/bootstrap/sass/_sprites.scss} +40 -7
  107. data/vendor/{assets/stylesheets/scss/tables.scss → twitter/bootstrap/sass/_tables.scss} +37 -32
  108. data/vendor/{assets/stylesheets/scss/thumbnails.scss → twitter/bootstrap/sass/_thumbnails.scss} +14 -2
  109. data/vendor/{assets/stylesheets/scss/tooltip.scss → twitter/bootstrap/sass/_tooltip.scss} +1 -1
  110. data/vendor/{assets/stylesheets/scss/type.scss → twitter/bootstrap/sass/_type.scss} +27 -13
  111. data/vendor/{assets/stylesheets/scss/utilities.scss → twitter/bootstrap/sass/_utilities.scss} +0 -0
  112. data/vendor/twitter/bootstrap/sass/_variables.scss +204 -0
  113. data/vendor/{assets/stylesheets/scss/wells.scss → twitter/bootstrap/sass/_wells.scss} +10 -0
  114. data/vendor/{assets/stylesheets/scss → twitter/bootstrap/sass}/bootstrap.scss +3 -3
  115. data/vendor/twitter/bootstrap/sass/responsive.scss +48 -0
  116. metadata +93 -84
  117. data/lib/generators/bootstrap/install/templates/assets/javascripts/bootstrap-generators.js +0 -1
  118. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.css.less +0 -98
  119. data/vendor/assets/stylesheets/bootstrap.css +0 -3363
  120. data/vendor/assets/stylesheets/less/grid.less +0 -8
  121. data/vendor/assets/stylesheets/less/labels.less +0 -32
  122. data/vendor/assets/stylesheets/less/responsive.less +0 -327
  123. data/vendor/assets/stylesheets/less/variables.less +0 -107
  124. data/vendor/assets/stylesheets/scss/grid.scss +0 -8
  125. data/vendor/assets/stylesheets/scss/labels.scss +0 -32
  126. data/vendor/assets/stylesheets/scss/responsive.scss +0 -327
  127. data/vendor/assets/stylesheets/scss/variables.scss +0 -107
@@ -0,0 +1,5 @@
1
+ // Fixed (940px)
2
+ #grid > .core(@gridColumnWidth, @gridGutterWidth);
3
+
4
+ // Fluid (940px)
5
+ #grid > .fluid(@fluidGridColumnWidth, @fluidGridGutterWidth);
@@ -4,17 +4,19 @@
4
4
  .hero-unit {
5
5
  padding: 60px;
6
6
  margin-bottom: 30px;
7
- background-color: #f5f5f5;
7
+ background-color: @heroUnitBackground;
8
8
  .border-radius(6px);
9
9
  h1 {
10
10
  margin-bottom: 0;
11
11
  font-size: 60px;
12
12
  line-height: 1;
13
+ color: @heroUnitHeadingColor;
13
14
  letter-spacing: -1px;
14
15
  }
15
16
  p {
16
17
  font-size: 18px;
17
18
  font-weight: 200;
18
19
  line-height: @baseLineHeight * 1.5;
20
+ color: @heroUnitLeadColor;
19
21
  }
20
22
  }
@@ -0,0 +1,55 @@
1
+ // LABELS & BADGES
2
+ // ---------------
3
+
4
+ // Base classes
5
+ .label,
6
+ .badge {
7
+ font-size: @baseFontSize * .846;
8
+ font-weight: bold;
9
+ line-height: 14px; // ensure proper line-height if floated
10
+ color: @white;
11
+ vertical-align: baseline;
12
+ white-space: nowrap;
13
+ text-shadow: 0 -1px 0 rgba(0,0,0,.25);
14
+ background-color: @grayLight;
15
+ }
16
+ // Set unique padding and border-radii
17
+ .label {
18
+ padding: 1px 4px 2px;
19
+ .border-radius(3px);
20
+ }
21
+ .badge {
22
+ padding: 1px 9px 2px;
23
+ .border-radius(9px);
24
+ }
25
+
26
+ // Hover state, but only for links
27
+ a {
28
+ &.label:hover,
29
+ &.badge:hover {
30
+ color: @white;
31
+ text-decoration: none;
32
+ cursor: pointer;
33
+ }
34
+ }
35
+
36
+ // Colors
37
+ // Only give background-color difference to links (and to simplify, we don't qualifty with `a` but [href] attribute)
38
+ .label,
39
+ .badge {
40
+ // Important (red)
41
+ &-important { background-color: @errorText; }
42
+ &-important[href] { background-color: darken(@errorText, 10%); }
43
+ // Warnings (orange)
44
+ &-warning { background-color: @orange; }
45
+ &-warning[href] { background-color: darken(@orange, 10%); }
46
+ // Success (green)
47
+ &-success { background-color: @successText; }
48
+ &-success[href] { background-color: darken(@successText, 10%); }
49
+ // Info (turquoise)
50
+ &-info { background-color: @infoText; }
51
+ &-info[href] { background-color: darken(@infoText, 10%); }
52
+ // Inverse (black)
53
+ &-inverse { background-color: @grayDark; }
54
+ &-inverse[href] { background-color: darken(@grayDark, 10%); }
55
+ }
@@ -11,7 +11,7 @@
11
11
 
12
12
  // Fluid layouts (left aligned, with sidebar, min- & max-width content)
13
13
  .container-fluid {
14
- padding-left: @gridGutterWidth;
15
14
  padding-right: @gridGutterWidth;
15
+ padding-left: @gridGutterWidth;
16
16
  .clearfix();
17
17
  }
@@ -70,21 +70,24 @@
70
70
 
71
71
  // Sizing shortcuts
72
72
  // -------------------------
73
- .size(@height: 5px, @width: 5px) {
73
+ .size(@height, @width) {
74
74
  width: @width;
75
75
  height: @height;
76
76
  }
77
- .square(@size: 5px) {
77
+ .square(@size) {
78
78
  .size(@size, @size);
79
79
  }
80
80
 
81
81
  // Placeholder text
82
82
  // -------------------------
83
83
  .placeholder(@color: @placeholderText) {
84
- :-moz-placeholder {
84
+ &:-moz-placeholder {
85
85
  color: @color;
86
86
  }
87
- ::-webkit-input-placeholder {
87
+ &:-ms-input-placeholder {
88
+ color: @color;
89
+ }
90
+ &::-webkit-input-placeholder {
88
91
  color: @color;
89
92
  }
90
93
  }
@@ -98,6 +101,16 @@
98
101
  white-space: nowrap;
99
102
  }
100
103
 
104
+ // CSS image replacement
105
+ // -------------------------
106
+ // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
107
+ .hide-text {
108
+ font: 0/0 a;
109
+ color: transparent;
110
+ text-shadow: none;
111
+ background-color: transparent;
112
+ border: 0;
113
+ }
101
114
 
102
115
 
103
116
  // FONTS
@@ -106,13 +119,13 @@
106
119
  #font {
107
120
  #family {
108
121
  .serif() {
109
- font-family: Georgia, "Times New Roman", Times, serif;
122
+ font-family: @serifFontFamily;
110
123
  }
111
124
  .sans-serif() {
112
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
125
+ font-family: @sansFontFamily;
113
126
  }
114
127
  .monospace() {
115
- font-family: Menlo, Monaco, "Courier New", monospace;
128
+ font-family: @monoFontFamily;
116
129
  }
117
130
  }
118
131
  .shorthand(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
@@ -135,159 +148,18 @@
135
148
  }
136
149
 
137
150
 
138
-
139
- // GRID SYSTEM
151
+ // FORMS
140
152
  // --------------------------------------------------
141
153
 
142
- // Site container
143
- // -------------------------
144
- .container-fixed() {
145
- width: @gridRowWidth;
146
- margin-left: auto;
147
- margin-right: auto;
148
- .clearfix();
149
- }
150
-
151
- // Le grid system
152
- // -------------------------
153
- #gridSystem {
154
- // Setup the mixins to be used
155
- .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, @columns) {
156
- width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
157
- }
158
- .offset(@gridColumnWidth, @gridGutterWidth, @columns) {
159
- margin-left: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1)) + (@gridGutterWidth * 2);
160
- }
161
- .gridColumn(@gridGutterWidth) {
162
- float: left;
163
- margin-left: @gridGutterWidth;
164
- }
165
- // Take these values and mixins, and make 'em do their thang
166
- .generate(@gridColumns, @gridColumnWidth, @gridGutterWidth) {
167
- // Row surrounds the columns
168
- .row {
169
- margin-left: @gridGutterWidth * -1;
170
- .clearfix();
171
- }
172
- // Find all .span# classes within .row and give them the necessary properties for grid columns (supported by all browsers back to IE7, thanks @dhg)
173
- [class*="span"] {
174
- #gridSystem > .gridColumn(@gridGutterWidth);
175
- }
176
- // Default columns
177
- .span1 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 1); }
178
- .span2 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 2); }
179
- .span3 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 3); }
180
- .span4 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 4); }
181
- .span5 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 5); }
182
- .span6 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 6); }
183
- .span7 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 7); }
184
- .span8 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 8); }
185
- .span9 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 9); }
186
- .span10 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 10); }
187
- .span11 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 11); }
188
- .span12,
189
- .container { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 12); }
190
- // Offset column options
191
- .offset1 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 1); }
192
- .offset2 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 2); }
193
- .offset3 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 3); }
194
- .offset4 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 4); }
195
- .offset5 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 5); }
196
- .offset6 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 6); }
197
- .offset7 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 7); }
198
- .offset8 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 8); }
199
- .offset9 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 9); }
200
- .offset10 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 10); }
201
- .offset11 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 11); }
202
- }
203
- }
204
-
205
- // Fluid grid system
206
- // -------------------------
207
- #fluidGridSystem {
208
- // Setup the mixins to be used
209
- .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, @columns) {
210
- width: 1% * (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1));
211
- }
212
- .gridColumn(@fluidGridGutterWidth) {
213
- float: left;
214
- margin-left: @fluidGridGutterWidth;
215
- }
216
- // Take these values and mixins, and make 'em do their thang
217
- .generate(@gridColumns, @fluidGridColumnWidth, @fluidGridGutterWidth) {
218
- // Row surrounds the columns
219
- .row-fluid {
220
- width: 100%;
221
- .clearfix();
222
-
223
- // Find all .span# classes within .row and give them the necessary properties for grid columns (supported by all browsers back to IE7, thanks @dhg)
224
- > [class*="span"] {
225
- #fluidGridSystem > .gridColumn(@fluidGridGutterWidth);
226
- }
227
- > [class*="span"]:first-child {
228
- margin-left: 0;
229
- }
230
- // Default columns
231
- > .span1 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 1); }
232
- > .span2 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 2); }
233
- > .span3 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 3); }
234
- > .span4 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 4); }
235
- > .span5 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 5); }
236
- > .span6 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 6); }
237
- > .span7 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 7); }
238
- > .span8 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 8); }
239
- > .span9 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 9); }
240
- > .span10 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 10); }
241
- > .span11 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 11); }
242
- > .span12 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 12); }
243
- }
244
- }
245
- }
246
-
247
- // Input grid system
248
- // -------------------------
249
- #inputGridSystem {
250
- .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, @columns) {
251
- width: ((@gridColumnWidth) * @columns) + (@gridGutterWidth * (@columns - 1)) - 10;
252
- }
253
- .generate(@gridColumns, @gridColumnWidth, @gridGutterWidth) {
254
- input,
255
- textarea,
256
- .uneditable-input {
257
- &.span1 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 1); }
258
- &.span2 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 2); }
259
- &.span3 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 3); }
260
- &.span4 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 4); }
261
- &.span5 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 5); }
262
- &.span6 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 6); }
263
- &.span7 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 7); }
264
- &.span8 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 8); }
265
- &.span9 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 9); }
266
- &.span10 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 10); }
267
- &.span11 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 11); }
268
- &.span12 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 12); }
269
- }
270
- }
271
- }
272
-
273
- // Make a Grid
274
- // -------------------------
275
- // Use .makeRow and .makeColumn to assign semantic layouts grid system behavior
276
- .makeRow() {
277
- margin-left: @gridGutterWidth * -1;
278
- .clearfix();
279
- }
280
- .makeColumn(@columns: 1) {
281
- float: left;
282
- margin-left: @gridGutterWidth;
283
- width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
154
+ // Block level inputs
155
+ .input-block-level {
156
+ display: block;
157
+ width: 100%;
158
+ min-height: 28px; // Make inputs at least the height of their button counterpart
159
+ .box-sizing(border-box); // Makes inputs behave like true block-level elements
284
160
  }
285
161
 
286
162
 
287
-
288
- // Form field states (used in forms.less)
289
- // --------------------------------------------------
290
-
291
163
  // Mixin for form field states
292
164
  .formFieldState(@textColor: #555, @borderColor: #ccc, @backgroundColor: #f5f5f5) {
293
165
  // Set the text color
@@ -297,6 +169,8 @@
297
169
  color: @textColor;
298
170
  }
299
171
  // Style inputs accordingly
172
+ .checkbox,
173
+ .radio,
300
174
  input,
301
175
  select,
302
176
  textarea {
@@ -322,14 +196,14 @@
322
196
  // --------------------------------------------------
323
197
 
324
198
  // Border Radius
325
- .border-radius(@radius: 5px) {
199
+ .border-radius(@radius) {
326
200
  -webkit-border-radius: @radius;
327
201
  -moz-border-radius: @radius;
328
202
  border-radius: @radius;
329
203
  }
330
204
 
331
205
  // Drop shadows
332
- .box-shadow(@shadow: 0 1px 3px rgba(0,0,0,.25)) {
206
+ .box-shadow(@shadow) {
333
207
  -webkit-box-shadow: @shadow;
334
208
  -moz-box-shadow: @shadow;
335
209
  box-shadow: @shadow;
@@ -359,21 +233,21 @@
359
233
  -o-transform: scale(@ratio);
360
234
  transform: scale(@ratio);
361
235
  }
362
- .translate(@x: 0, @y: 0) {
236
+ .translate(@x, @y) {
363
237
  -webkit-transform: translate(@x, @y);
364
238
  -moz-transform: translate(@x, @y);
365
239
  -ms-transform: translate(@x, @y);
366
240
  -o-transform: translate(@x, @y);
367
241
  transform: translate(@x, @y);
368
242
  }
369
- .skew(@x: 0, @y: 0) {
243
+ .skew(@x, @y) {
370
244
  -webkit-transform: skew(@x, @y);
371
245
  -moz-transform: skew(@x, @y);
372
246
  -ms-transform: skew(@x, @y);
373
247
  -o-transform: skew(@x, @y);
374
248
  transform: skew(@x, @y);
375
249
  }
376
- .translate3d(@x: 0, @y: 0, @z: 0) {
250
+ .translate3d(@x, @y, @z) {
377
251
  -webkit-transform: translate(@x, @y, @z);
378
252
  -moz-transform: translate(@x, @y, @z);
379
253
  -ms-transform: translate(@x, @y, @z);
@@ -381,6 +255,17 @@
381
255
  transform: translate(@x, @y, @z);
382
256
  }
383
257
 
258
+ // Backface visibility
259
+ // Prevent browsers from flickering when using CSS 3D transforms.
260
+ // Default value is `visible`, but can be changed to `hidden
261
+ // See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples
262
+ .backface-visibility(@visibility){
263
+ -webkit-backface-visibility: @visibility;
264
+ -moz-backface-visibility: @visibility;
265
+ -ms-backface-visibility: @visibility;
266
+ backface-visibility: @visibility;
267
+ }
268
+
384
269
  // Background clipping
385
270
  // Heads up: FF 3.6 and under need "padding" instead of "padding-box"
386
271
  .background-clip(@clip) {
@@ -402,6 +287,7 @@
402
287
  .box-sizing(@boxmodel) {
403
288
  -webkit-box-sizing: @boxmodel;
404
289
  -moz-box-sizing: @boxmodel;
290
+ -ms-box-sizing: @boxmodel;
405
291
  box-sizing: @boxmodel;
406
292
  }
407
293
 
@@ -410,18 +296,19 @@
410
296
  .user-select(@select) {
411
297
  -webkit-user-select: @select;
412
298
  -moz-user-select: @select;
299
+ -ms-user-select: @select;
413
300
  -o-user-select: @select;
414
301
  user-select: @select;
415
302
  }
416
303
 
417
304
  // Resize anything
418
- .resizable(@direction: both) {
305
+ .resizable(@direction) {
419
306
  resize: @direction; // Options: horizontal, vertical, both
420
307
  overflow: auto; // Safari fix
421
308
  }
422
309
 
423
310
  // CSS3 Content Columns
424
- .content-columns(@columnCount, @columnGap: @gridColumnGutter) {
311
+ .content-columns(@columnCount, @columnGap: @gridGutterWidth) {
425
312
  -webkit-column-count: @columnCount;
426
313
  -moz-column-count: @columnCount;
427
314
  column-count: @columnCount;
@@ -430,10 +317,20 @@
430
317
  column-gap: @columnGap;
431
318
  }
432
319
 
320
+ // Optional hyphenation
321
+ .hyphens(@mode: auto) {
322
+ word-wrap: break-word;
323
+ -webkit-hyphens: @mode;
324
+ -moz-hyphens: @mode;
325
+ -ms-hyphens: @mode;
326
+ -o-hyphens: @mode;
327
+ hyphens: @mode;
328
+ }
329
+
433
330
  // Opacity
434
- .opacity(@opacity: 100) {
331
+ .opacity(@opacity) {
435
332
  opacity: @opacity / 100;
436
- filter: e(%("alpha(opacity=%d)", @opacity));
333
+ filter: ~"alpha(opacity=@{opacity})";
437
334
  }
438
335
 
439
336
 
@@ -509,8 +406,8 @@
509
406
  background-image: -webkit-radial-gradient(circle, @innerColor, @outerColor);
510
407
  background-image: -moz-radial-gradient(circle, @innerColor, @outerColor);
511
408
  background-image: -ms-radial-gradient(circle, @innerColor, @outerColor);
409
+ background-image: -o-radial-gradient(circle, @innerColor, @outerColor);
512
410
  background-repeat: no-repeat;
513
- // Opera cannot do radial gradients yet
514
411
  }
515
412
  .striped(@color, @angle: -45deg) {
516
413
  background-color: @color;
@@ -528,16 +425,39 @@
528
425
  }
529
426
 
530
427
 
531
- // Mixin for generating button backgrounds
532
- // ---------------------------------------
428
+
429
+ // COMPONENT MIXINS
430
+ // --------------------------------------------------
431
+
432
+ // Horizontal dividers
433
+ // -------------------------
434
+ // Dividers (basically an hr) within dropdowns and nav lists
435
+ .nav-divider(@top: #e5e5e5, @bottom: @white) {
436
+ // IE7 needs a set width since we gave a height. Restricting just
437
+ // to IE7 to keep the 1px left/right space in other browsers.
438
+ // It is unclear where IE is getting the extra space that we need
439
+ // to negative-margin away, but so it goes.
440
+ *width: 100%;
441
+ height: 1px;
442
+ margin: ((@baseLineHeight / 2) - 1) 1px; // 8px 1px
443
+ *margin: -5px 0 5px;
444
+ overflow: hidden;
445
+ background-color: @top;
446
+ border-bottom: 1px solid @bottom;
447
+ }
448
+
449
+ // Button backgrounds
450
+ // ------------------
533
451
  .buttonBackground(@startColor, @endColor) {
534
452
  // gradientBar will set the background to a pleasing blend of these, to support IE<=9
535
453
  .gradientBar(@startColor, @endColor);
454
+ *background-color: @endColor; /* Darken IE7 buttons by default so they stand out more given they won't have borders */
536
455
  .reset-filter();
537
456
 
538
457
  // in these cases the gradient won't cover the background, so we override
539
458
  &:hover, &:active, &.active, &.disabled, &[disabled] {
540
459
  background-color: @endColor;
460
+ *background-color: darken(@endColor, 5%);
541
461
  }
542
462
 
543
463
  // IE 7 + 8 can't handle box-shadow to show active, so we darken a bit ourselves
@@ -547,44 +467,180 @@
547
467
  }
548
468
  }
549
469
 
470
+ // Navbar vertical align
471
+ // -------------------------
472
+ // Vertically center elements in the navbar.
473
+ // Example: an element has a height of 30px, so write out `.navbarVerticalAlign(30px);` to calculate the appropriate top margin.
474
+ .navbarVerticalAlign(@elementHeight) {
475
+ margin-top: (@navbarHeight - @elementHeight) / 2;
476
+ }
550
477
 
551
- // COMPONENT MIXINS
552
- // --------------------------------------------------
553
-
554
- // POPOVER ARROWS
478
+ // Popover arrows
555
479
  // -------------------------
556
480
  // For tipsies and popovers
557
481
  #popoverArrow {
558
- .top(@arrowWidth: 5px) {
482
+ .top(@arrowWidth: 5px, @color: @black) {
559
483
  bottom: 0;
560
484
  left: 50%;
561
485
  margin-left: -@arrowWidth;
562
486
  border-left: @arrowWidth solid transparent;
563
487
  border-right: @arrowWidth solid transparent;
564
- border-top: @arrowWidth solid @black;
488
+ border-top: @arrowWidth solid @color;
565
489
  }
566
- .left(@arrowWidth: 5px) {
490
+ .left(@arrowWidth: 5px, @color: @black) {
567
491
  top: 50%;
568
492
  right: 0;
569
493
  margin-top: -@arrowWidth;
570
494
  border-top: @arrowWidth solid transparent;
571
495
  border-bottom: @arrowWidth solid transparent;
572
- border-left: @arrowWidth solid @black;
496
+ border-left: @arrowWidth solid @color;
573
497
  }
574
- .bottom(@arrowWidth: 5px) {
498
+ .bottom(@arrowWidth: 5px, @color: @black) {
575
499
  top: 0;
576
500
  left: 50%;
577
501
  margin-left: -@arrowWidth;
578
502
  border-left: @arrowWidth solid transparent;
579
503
  border-right: @arrowWidth solid transparent;
580
- border-bottom: @arrowWidth solid @black;
504
+ border-bottom: @arrowWidth solid @color;
581
505
  }
582
- .right(@arrowWidth: 5px) {
506
+ .right(@arrowWidth: 5px, @color: @black) {
583
507
  top: 50%;
584
508
  left: 0;
585
509
  margin-top: -@arrowWidth;
586
510
  border-top: @arrowWidth solid transparent;
587
511
  border-bottom: @arrowWidth solid transparent;
588
- border-right: @arrowWidth solid @black;
512
+ border-right: @arrowWidth solid @color;
589
513
  }
590
514
  }
515
+
516
+ // Grid System
517
+ // -----------
518
+
519
+ // Centered container element
520
+ .container-fixed() {
521
+ margin-right: auto;
522
+ margin-left: auto;
523
+ .clearfix();
524
+ }
525
+
526
+ // Table columns
527
+ .tableColumns(@columnSpan: 1) {
528
+ float: none; // undo default grid column styles
529
+ width: ((@gridColumnWidth) * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1)) - 16; // 16 is total padding on left and right of table cells
530
+ margin-left: 0; // undo default grid column styles
531
+ }
532
+
533
+ // Make a Grid
534
+ // Use .makeRow and .makeColumn to assign semantic layouts grid system behavior
535
+ .makeRow() {
536
+ margin-left: @gridGutterWidth * -1;
537
+ .clearfix();
538
+ }
539
+ .makeColumn(@columns: 1, @offset: 0) {
540
+ float: left;
541
+ margin-left: (@gridColumnWidth * @offset) + (@gridGutterWidth * (@offset - 1)) + (@gridGutterWidth * 2);
542
+ width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
543
+ }
544
+
545
+ // The Grid
546
+ #grid {
547
+
548
+ .core (@gridColumnWidth, @gridGutterWidth) {
549
+
550
+ .spanX (@index) when (@index > 0) {
551
+ (~".span@{index}") { .span(@index); }
552
+ .spanX(@index - 1);
553
+ }
554
+ .spanX (0) {}
555
+
556
+ .offsetX (@index) when (@index > 0) {
557
+ (~".offset@{index}") { .offset(@index); }
558
+ .offsetX(@index - 1);
559
+ }
560
+ .offsetX (0) {}
561
+
562
+ .offset (@columns) {
563
+ margin-left: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns + 1));
564
+ }
565
+
566
+ .span (@columns) {
567
+ width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
568
+ }
569
+
570
+ .row {
571
+ margin-left: @gridGutterWidth * -1;
572
+ .clearfix();
573
+ }
574
+
575
+ [class*="span"] {
576
+ float: left;
577
+ margin-left: @gridGutterWidth;
578
+ }
579
+
580
+ // Set the container width, and override it for fixed navbars in media queries
581
+ .container,
582
+ .navbar-fixed-top .container,
583
+ .navbar-fixed-bottom .container { .span(@gridColumns); }
584
+
585
+ // generate .spanX and .offsetX
586
+ .spanX (@gridColumns);
587
+ .offsetX (@gridColumns);
588
+
589
+ }
590
+
591
+ .fluid (@fluidGridColumnWidth, @fluidGridGutterWidth) {
592
+
593
+ .spanX (@index) when (@index > 0) {
594
+ (~".span@{index}") { .span(@index); }
595
+ .spanX(@index - 1);
596
+ }
597
+ .spanX (0) {}
598
+
599
+ .span (@columns) {
600
+ width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1));
601
+ *width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%);
602
+ }
603
+
604
+ .row-fluid {
605
+ width: 100%;
606
+ .clearfix();
607
+ [class*="span"] {
608
+ .input-block-level();
609
+ float: left;
610
+ margin-left: @fluidGridGutterWidth;
611
+ *margin-left: @fluidGridGutterWidth - (.5 / @gridRowWidth * 100 * 1%);
612
+ }
613
+ [class*="span"]:first-child {
614
+ margin-left: 0;
615
+ }
616
+
617
+ // generate .spanX
618
+ .spanX (@gridColumns);
619
+ }
620
+
621
+ }
622
+
623
+ .input(@gridColumnWidth, @gridGutterWidth) {
624
+
625
+ .spanX (@index) when (@index > 0) {
626
+ (~"input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index}") { .span(@index); }
627
+ .spanX(@index - 1);
628
+ }
629
+ .spanX (0) {}
630
+
631
+ .span(@columns) {
632
+ width: ((@gridColumnWidth) * @columns) + (@gridGutterWidth * (@columns - 1)) - 10;
633
+ }
634
+
635
+ input,
636
+ textarea,
637
+ .uneditable-input {
638
+ margin-left: 0; // override margin-left from core grid system
639
+ }
640
+
641
+ // generate .spanX
642
+ .spanX (@gridColumns);
643
+
644
+ }
645
+
646
+ }