compass_twitter_bootstrap 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/CHANGELOG.md +5 -0
  2. data/build/convert.rb +13 -0
  3. data/lib/compass_twitter_bootstrap/version.rb +1 -1
  4. data/stylesheets/_compass_twitter_bootstrap_responsive.scss +11 -6
  5. data/stylesheets/compass_twitter_bootstrap/_breadcrumbs.scss +1 -1
  6. data/stylesheets/compass_twitter_bootstrap/_button-groups.scss +2 -1
  7. data/stylesheets/compass_twitter_bootstrap/_buttons.scss +25 -7
  8. data/stylesheets/compass_twitter_bootstrap/_code.scss +13 -0
  9. data/stylesheets/compass_twitter_bootstrap/_dropdowns.scss +1 -2
  10. data/stylesheets/compass_twitter_bootstrap/_forms.scss +48 -41
  11. data/stylesheets/compass_twitter_bootstrap/_labels.scss +23 -7
  12. data/stylesheets/compass_twitter_bootstrap/_mixins.scss +73 -21
  13. data/stylesheets/compass_twitter_bootstrap/_modals.scss +11 -0
  14. data/stylesheets/compass_twitter_bootstrap/_navbar.scss +11 -4
  15. data/stylesheets/compass_twitter_bootstrap/_navs.scss +20 -11
  16. data/stylesheets/compass_twitter_bootstrap/_reset.scss +1 -1
  17. data/stylesheets/compass_twitter_bootstrap/_sprites.scss +7 -5
  18. data/stylesheets/compass_twitter_bootstrap/_tables.scss +14 -3
  19. data/stylesheets/compass_twitter_bootstrap/_thumbnails.scss +2 -2
  20. data/stylesheets/compass_twitter_bootstrap/_type.scss +3 -2
  21. data/stylesheets/compass_twitter_bootstrap/_variables.scss +61 -53
  22. data/stylesheets_sass/_compass_twitter_bootstrap_responsive.sass +11 -8
  23. data/stylesheets_sass/compass_twitter_bootstrap/_breadcrumbs.sass +1 -1
  24. data/stylesheets_sass/compass_twitter_bootstrap/_button-groups.sass +2 -1
  25. data/stylesheets_sass/compass_twitter_bootstrap/_buttons.sass +23 -7
  26. data/stylesheets_sass/compass_twitter_bootstrap/_code.sass +10 -0
  27. data/stylesheets_sass/compass_twitter_bootstrap/_dropdowns.sass +1 -2
  28. data/stylesheets_sass/compass_twitter_bootstrap/_forms.sass +48 -37
  29. data/stylesheets_sass/compass_twitter_bootstrap/_labels.sass +22 -3
  30. data/stylesheets_sass/compass_twitter_bootstrap/_modals.sass +9 -0
  31. data/stylesheets_sass/compass_twitter_bootstrap/_navbar.sass +12 -3
  32. data/stylesheets_sass/compass_twitter_bootstrap/_navs.sass +21 -11
  33. data/stylesheets_sass/compass_twitter_bootstrap/_reset.sass +1 -1
  34. data/stylesheets_sass/compass_twitter_bootstrap/_sprites.sass +7 -5
  35. data/stylesheets_sass/compass_twitter_bootstrap/_tables.sass +11 -2
  36. data/stylesheets_sass/compass_twitter_bootstrap/_thumbnails.sass +2 -2
  37. data/stylesheets_sass/compass_twitter_bootstrap/_type.sass +3 -2
  38. data/stylesheets_sass/compass_twitter_bootstrap/_variables.sass +61 -53
  39. metadata +10 -4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Overview
2
2
 
3
+ ## 2.0.1
4
+ * Upgrade twitter bootstrap to 2.0.1
5
+ * Use compass @image-url() for sprites (thanks to jpfuentes2)
6
+ * Added !default to variables
7
+
3
8
  ## 2.0.0
4
9
  * Updated twitter bootstrap to 2.0
5
10
  * Updated import script
data/build/convert.rb CHANGED
@@ -13,6 +13,10 @@ class Convert
13
13
  file = fix_progress_bar(file)
14
14
  end
15
15
 
16
+ if name == 'variables.less'
17
+ file = insert_default_vars(file)
18
+ end
19
+
16
20
  save_file(name, file) unless name == 'mixins.less'
17
21
  end
18
22
  end
@@ -77,6 +81,7 @@ private
77
81
  file = replace_includes(file)
78
82
  file = replace_spin(file)
79
83
  file = replace_opacity(file)
84
+ file = replace_image_urls(file)
80
85
 
81
86
  file
82
87
  end
@@ -135,6 +140,14 @@ private
135
140
  scss.gsub(/\@include opacity\((\d+)\)/) {|s| "@include opacity(#{$1.to_f / 100})"}
136
141
  end
137
142
 
143
+ def replace_image_urls(less)
144
+ less.gsub(/background-image: url\((.*)\);/) {|s| "background-image: image-url(\"#{$1.gsub('../img/','')}\");" }
145
+ end
146
+
147
+ def insert_default_vars(scss)
148
+ scss.gsub(/^(\$.+);$/, '\1 !default;')
149
+ end
150
+
138
151
  def convert_scss(file, folder='')
139
152
  sass_files = 'stylesheets_sass'
140
153
  system("sass-convert #{file.path} #{sass_files}/#{folder}#{File.basename(file, 'scss')}sass")
@@ -1,3 +1,3 @@
1
1
  module CompassTwitterBootstrap
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap Responsive v2.0.0
2
+ * Bootstrap Responsive v2.0.1
3
3
  *
4
4
  * Copyright 2012 Twitter, Inc
5
5
  * Licensed under the Apache License v2.0
@@ -8,7 +8,7 @@
8
8
  * Designed and built with all the love in the world @twitter by @mdo and @fat.
9
9
  */
10
10
 
11
- // RESPONSIVE
11
+ // Responsive
12
12
  // For phone and tablet devices
13
13
  // -------------------------------------------------------------
14
14
 
@@ -56,7 +56,7 @@
56
56
  .uneditable-input {
57
57
  display: block;
58
58
  width: 100%;
59
- height: 28px; /* Make inputs at least the height of their button counterpart */
59
+ min-height: 28px; /* Make inputs at least the height of their button counterpart */
60
60
  /* Makes inputs behave like true block-level elements */
61
61
  -webkit-box-sizing: border-box; /* Older Webkit */
62
62
  -moz-box-sizing: border-box; /* Older FF */
@@ -123,7 +123,7 @@
123
123
  // LANDSCAPE PHONE TO SMALL DESKTOP & PORTRAIT TABLET
124
124
  // --------------------------------------------------
125
125
 
126
- @media (max-width: 768px) {
126
+ @media (max-width: 767px) {
127
127
  // GRID & CONTAINERS
128
128
  // -----------------
129
129
  // Remove width from containers
@@ -154,7 +154,7 @@
154
154
  // PORTRAIT TABLET TO DEFAULT DESKTOP
155
155
  // ----------------------------------
156
156
 
157
- @media (min-width: 768px) and (max-width: 980px) {
157
+ @media (min-width: 768px) and (max-width: 979px) {
158
158
 
159
159
  // Fixed grid
160
160
  @include gridSystem-generate(12, 42px, 20px);
@@ -171,7 +171,7 @@
171
171
 
172
172
  // TABLETS AND BELOW
173
173
  // -----------------
174
- @media (max-width: 980px) {
174
+ @media (max-width: 979px) {
175
175
 
176
176
  // UNFIX THE TOPBAR
177
177
  // ----------------
@@ -215,6 +215,10 @@
215
215
  .navbar .nav > .divider-vertical {
216
216
  display: none;
217
217
  }
218
+ .navbar .nav .nav-header {
219
+ color: $navbarText;
220
+ text-shadow: none;
221
+ }
218
222
  // Nav and dropdown links in navbar
219
223
  .navbar .nav > li > a,
220
224
  .navbar .dropdown-menu a {
@@ -319,4 +323,5 @@
319
323
  .thumbnails > li {
320
324
  margin-left: 30px;
321
325
  }
326
+
322
327
  }
@@ -9,7 +9,7 @@
9
9
  @include border-radius(3px);
10
10
  @include box-shadow(inset 0 1px 0 $white);
11
11
  li {
12
- display: inline;
12
+ display: inline-block;
13
13
  text-shadow: 0 1px 0 $white;
14
14
  }
15
15
  .divider {
@@ -133,7 +133,8 @@
133
133
  .btn-primary,
134
134
  .btn-danger,
135
135
  .btn-info,
136
- .btn-success {
136
+ .btn-success,
137
+ .btn-inverse {
137
138
  .caret {
138
139
  border-top-color: $white;
139
140
  @include opacity(0.75);
@@ -9,12 +9,14 @@
9
9
  .btn {
10
10
  display: inline-block;
11
11
  padding: 4px 10px 4px;
12
+ margin-bottom: 0; // For input.btn
12
13
  font-size: $baseFontSize;
13
14
  line-height: $baseLineHeight;
14
15
  color: $grayDark;
15
16
  text-align: center;
16
17
  text-shadow: 0 1px 1px rgba(255,255,255,.75);
17
- @include gradient-vertical-three-colors($white, $white, 25%, darken($white, 10%)); // Don't use @include gradientbar(); here since it does a three-color gradient
18
+ vertical-align: middle;
19
+ @include buttonBackground($white, darken($white, 10%));
18
20
  border: 1px solid #ccc;
19
21
  border-bottom-color: #bbb;
20
22
  @include border-radius(4px);
@@ -23,6 +25,7 @@
23
25
  cursor: pointer;
24
26
 
25
27
  // Give IE7 some love
28
+ @include reset-filter();
26
29
  @include ie7-restore-left-whitespace();
27
30
  }
28
31
 
@@ -51,7 +54,6 @@
51
54
  @include box-shadow($shadow);
52
55
  background-color: darken($white, 10%);
53
56
  background-color: darken($white, 15%) e("\9");
54
- color: rgba(0,0,0,.5);
55
57
  outline: 0;
56
58
  }
57
59
 
@@ -76,7 +78,7 @@
76
78
  line-height: normal;
77
79
  @include border-radius(5px);
78
80
  }
79
- .btn-large .icon {
81
+ .btn-large [class^="icon-"] {
80
82
  margin-top: 1px;
81
83
  }
82
84
 
@@ -86,10 +88,17 @@
86
88
  font-size: $baseFontSize - 2px;
87
89
  line-height: $baseLineHeight - 2px;
88
90
  }
89
- .btn-small .icon {
91
+ .btn-small [class^="icon-"] {
90
92
  margin-top: -1px;
91
93
  }
92
94
 
95
+ // Mini
96
+ .btn-mini {
97
+ padding: 2px 6px;
98
+ font-size: $baseFontSize - 2px;
99
+ line-height: $baseLineHeight - 4px;
100
+ }
101
+
93
102
 
94
103
  // Alternate buttons
95
104
  // --------------------------------------------------
@@ -105,7 +114,9 @@
105
114
  .btn-success,
106
115
  .btn-success:hover,
107
116
  .btn-info,
108
- .btn-info:hover {
117
+ .btn-info:hover,
118
+ .btn-inverse,
119
+ .btn-inverse:hover {
109
120
  text-shadow: 0 -1px 0 rgba(0,0,0,.25);
110
121
  color: $white;
111
122
  }
@@ -114,7 +125,8 @@
114
125
  .btn-warning.active,
115
126
  .btn-danger.active,
116
127
  .btn-success.active,
117
- .btn-info.active {
128
+ .btn-info.active,
129
+ .btn-dark.active {
118
130
  color: rgba(255,255,255,.75);
119
131
  }
120
132
 
@@ -139,6 +151,10 @@
139
151
  .btn-info {
140
152
  @include buttonBackground(#5bc0de, #2f96b4);
141
153
  }
154
+ // Inverse appears as dark gray
155
+ .btn-inverse {
156
+ @include buttonBackground(#454545, #262626);
157
+ }
142
158
 
143
159
 
144
160
  // Cross-browser Jank
@@ -146,8 +162,10 @@
146
162
 
147
163
  button.btn,
148
164
  input[type="submit"].btn {
165
+
166
+ // Firefox 3.6 only I believe
149
167
  &::-moz-focus-inner {
150
- padding: 0;
168
+ padding: 0;
151
169
  border: 0;
152
170
  }
153
171
 
@@ -11,12 +11,16 @@ pre {
11
11
  color: $grayDark;
12
12
  @include border-radius(3px);
13
13
  }
14
+
15
+ // Inline code
14
16
  code {
15
17
  padding: 3px 4px;
16
18
  color: #d14;
17
19
  background-color: #f7f7f9;
18
20
  border: 1px solid #e1e1e8;
19
21
  }
22
+
23
+ // Blocks of code
20
24
  pre {
21
25
  display: block;
22
26
  padding: ($baseLineHeight - 1) / 2;
@@ -30,6 +34,7 @@ pre {
30
34
  white-space: pre;
31
35
  white-space: pre-wrap;
32
36
  word-break: break-all;
37
+ word-wrap: break-word;
33
38
 
34
39
  // Make prettyprint styles more spaced out for readability
35
40
  &.prettyprint {
@@ -39,6 +44,14 @@ pre {
39
44
  // Account for some code outputs that place code tags in pre tags
40
45
  code {
41
46
  padding: 0;
47
+ color: inherit;
42
48
  background-color: transparent;
49
+ border: 0;
43
50
  }
44
51
  }
52
+
53
+ // Enable scrollable blocks of code
54
+ .pre-scrollable {
55
+ max-height: 340px;
56
+ overflow-y: scroll;
57
+ }
@@ -46,7 +46,6 @@
46
46
  float: left;
47
47
  display: none; // none by default, but block on "open" of the menu
48
48
  min-width: 160px;
49
- max-width: 220px;
50
49
  _width: 160px;
51
50
  padding: 4px 0;
52
51
  margin: 0; // override default ul
@@ -93,7 +92,7 @@
93
92
  padding: 3px 15px;
94
93
  clear: both;
95
94
  font-weight: normal;
96
- line-height: 18px;
95
+ line-height: $baseLineHeight;
97
96
  color: $gray;
98
97
  white-space: nowrap;
99
98
  }
@@ -28,6 +28,12 @@ legend {
28
28
  color: $grayDark;
29
29
  border: 0;
30
30
  border-bottom: 1px solid #eee;
31
+
32
+ // Small
33
+ small {
34
+ font-size: $baseLineHeight * .75;
35
+ color: $grayLight;
36
+ }
31
37
  }
32
38
 
33
39
  // Set font for forms
@@ -36,7 +42,13 @@ input,
36
42
  button,
37
43
  select,
38
44
  textarea {
39
- @include font-sans-serif($baseFontSize,normal,$baseLineHeight);
45
+ @include font-shorthand($baseFontSize,normal,$baseLineHeight); // Set size, weight, line-height here
46
+ }
47
+ input,
48
+ button,
49
+ select,
50
+ textarea {
51
+ @include font-family-sans-serif(); // And only set font-family here for those that need it (note the missing label element)
40
52
  }
41
53
 
42
54
  // Identify controls by their labels
@@ -84,13 +96,17 @@ input[type="radio"] {
84
96
  margin: 3px 0;
85
97
  *margin-top: 0; /* IE7 */
86
98
  line-height: normal;
87
- border: 0;
88
99
  cursor: pointer;
89
100
  @include border-radius(0);
101
+ border: 0 \9; /* IE9 and down */
102
+ }
103
+ input[type="image"] {
104
+ border: 0;
90
105
  }
91
106
 
92
107
  // Reset the file input to browser defaults
93
108
  input[type="file"] {
109
+ width: auto;
94
110
  padding: initial;
95
111
  line-height: initial;
96
112
  border: initial;
@@ -115,6 +131,11 @@ input[type="file"] {
115
131
  line-height: 28px;
116
132
  }
117
133
 
134
+ // Reset line-height for IE
135
+ input[type="file"] {
136
+ line-height: 18px \9;
137
+ }
138
+
118
139
  // Chrome on Linux and Mobile Safari need background-color
119
140
  select {
120
141
  width: 220px; // default input width + 10px of padding that doesn't get applied
@@ -165,9 +186,11 @@ input[type="hidden"] {
165
186
  }
166
187
 
167
188
  // Radios and checkboxes on same line
189
+ // TODO v3: Convert .inline to .control-inline
168
190
  .radio.inline,
169
191
  .checkbox.inline {
170
192
  display: inline-block;
193
+ padding-top: 5px;
171
194
  margin-bottom: 0;
172
195
  vertical-align: middle;
173
196
  }
@@ -175,11 +198,6 @@ input[type="hidden"] {
175
198
  .checkbox.inline + .checkbox.inline {
176
199
  margin-left: 10px; // space out consecutive inline controls
177
200
  }
178
- // But don't forget to remove their padding on first-child
179
- .controls > .radio.inline:first-child,
180
- .controls > .checkbox.inline:first-child {
181
- padding-top: 0;
182
- }
183
201
 
184
202
 
185
203
 
@@ -198,9 +216,10 @@ textarea:focus {
198
216
  $shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
199
217
  @include box-shadow($shadow);
200
218
  outline: 0;
201
- outline: thin dotted \9; /* IE6-8 */
219
+ outline: thin dotted \9; /* IE6-9 */
202
220
  }
203
221
  input[type="file"]:focus,
222
+ input[type="radio"]:focus,
204
223
  input[type="checkbox"]:focus,
205
224
  select:focus {
206
225
  @include box-shadow(none); // override for file inputs
@@ -260,33 +279,6 @@ textarea[readonly] {
260
279
  // FORM FIELD FEEDBACK STATES
261
280
  // --------------------------
262
281
 
263
- // Mixin for form field states
264
- @mixin formFieldState($textColor: #555, $borderColor: #ccc, $backgroundColor: #f5f5f5) {
265
- // Set the text color
266
- > label,
267
- .help-block,
268
- .help-inline {
269
- color: $textColor;
270
- }
271
- // Style inputs accordingly
272
- input,
273
- select,
274
- textarea {
275
- color: $textColor;
276
- border-color: $borderColor;
277
- &:focus {
278
- border-color: darken($borderColor, 10%);
279
- @include box-shadow(0 0 6px lighten($borderColor, 20%));
280
- }
281
- }
282
- // Give a small background color for input-prepend/-append
283
- .input-prepend .add-on,
284
- .input-append .add-on {
285
- color: $textColor;
286
- background-color: $backgroundColor;
287
- border-color: $textColor;
288
- }
289
- }
290
282
  // Warning
291
283
  .control-group.warning {
292
284
  @include formFieldState($warningText, $warningText, $warningBackground);
@@ -344,6 +336,7 @@ select:focus:required:invalid {
344
336
  // ---------
345
337
 
346
338
  .help-block {
339
+ display: block; // account for any element using help-block
347
340
  margin-top: 5px;
348
341
  margin-bottom: 0;
349
342
  color: $grayLight;
@@ -412,6 +405,7 @@ select:focus:required:invalid {
412
405
  @include border-radius(3px 0 0 3px);
413
406
  }
414
407
  .uneditable-input {
408
+ border-left-color: #eee;
415
409
  border-right-color: #ccc;
416
410
  }
417
411
  .add-on {
@@ -461,6 +455,10 @@ select:focus:required:invalid {
461
455
  display: inline-block;
462
456
  margin-bottom: 0;
463
457
  }
458
+ // Re-hide hidden elements due to specifity
459
+ .hide {
460
+ display: none;
461
+ }
464
462
  }
465
463
  .form-search label,
466
464
  .form-inline label,
@@ -477,28 +475,37 @@ select:focus:required:invalid {
477
475
  .form-inline .input-prepend .add-on {
478
476
  vertical-align: middle;
479
477
  }
478
+ // Inline checkbox/radio labels
479
+ .form-search .radio,
480
+ .form-inline .radio,
481
+ .form-search .checkbox,
482
+ .form-inline .checkbox {
483
+ margin-bottom: 0;
484
+ vertical-align: middle;
485
+ }
480
486
 
481
487
  // Margin to space out fieldsets
482
488
  .control-group {
483
489
  margin-bottom: $baseLineHeight / 2;
484
490
  }
485
491
 
492
+ // Legend collapses margin, so next element is responsible for spacing
493
+ legend + .control-group {
494
+ margin-top: $baseLineHeight;
495
+ -webkit-margin-top-collapse: separate;
496
+ }
497
+
486
498
  // Horizontal-specific styles
487
499
  // --------------------------
488
500
 
489
501
  .form-horizontal {
490
- // Legend collapses margin, so we're relegated to padding
491
- legend + .control-group {
492
- margin-top: $baseLineHeight;
493
- -webkit-margin-top-collapse: separate;
494
- }
495
502
  // Increase spacing between groups
496
503
  .control-group {
497
504
  margin-bottom: $baseLineHeight;
498
505
  @include clearfix();
499
506
  }
500
507
  // Float the labels left
501
- .control-group > label {
508
+ .control-label {
502
509
  float: left;
503
510
  width: 140px;
504
511
  padding-top: 5px;