anjlab-bootstrap-rails 3.0.0.rc1 → 3.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -12
  3. data/Rakefile +3 -2
  4. data/app/assets/javascripts/twitter/bootstrap.js +2 -1
  5. data/app/assets/javascripts/twitter/bootstrap/button.js +4 -2
  6. data/app/assets/javascripts/twitter/bootstrap/carousel.js +6 -2
  7. data/app/assets/javascripts/twitter/bootstrap/collapse.js +2 -2
  8. data/app/assets/javascripts/twitter/bootstrap/modal.js +19 -16
  9. data/app/assets/javascripts/twitter/bootstrap/popover.js +7 -5
  10. data/app/assets/javascripts/twitter/bootstrap/tooltip.js +39 -21
  11. data/app/assets/javascripts/twitter/bootstrap/transition.js +2 -2
  12. data/app/assets/stylesheets/twitter/bootstrap/_alerts.scss +21 -19
  13. data/app/assets/stylesheets/twitter/bootstrap/_badges.scss +5 -5
  14. data/app/assets/stylesheets/twitter/bootstrap/_bootstrap.scss +1 -1
  15. data/app/assets/stylesheets/twitter/bootstrap/_button-groups.scss +96 -23
  16. data/app/assets/stylesheets/twitter/bootstrap/_buttons.scss +24 -18
  17. data/app/assets/stylesheets/twitter/bootstrap/_carousel.scss +10 -11
  18. data/app/assets/stylesheets/twitter/bootstrap/_close.scss +1 -1
  19. data/app/assets/stylesheets/twitter/bootstrap/_code.scss +4 -3
  20. data/app/assets/stylesheets/twitter/bootstrap/_dropdowns.scss +23 -18
  21. data/app/assets/stylesheets/twitter/bootstrap/_forms.scss +65 -160
  22. data/app/assets/stylesheets/twitter/bootstrap/_grid.scss +244 -59
  23. data/app/assets/stylesheets/twitter/bootstrap/_input-groups.scss +127 -0
  24. data/app/assets/stylesheets/twitter/bootstrap/_labels.scss +12 -4
  25. data/app/assets/stylesheets/twitter/bootstrap/_list-group.scss +36 -36
  26. data/app/assets/stylesheets/twitter/bootstrap/_mixins.scss +227 -52
  27. data/app/assets/stylesheets/twitter/bootstrap/_modals.scss +6 -9
  28. data/app/assets/stylesheets/twitter/bootstrap/_navbar.scss +268 -82
  29. data/app/assets/stylesheets/twitter/bootstrap/_navs.scss +10 -18
  30. data/app/assets/stylesheets/twitter/bootstrap/_pagination.scss +5 -41
  31. data/app/assets/stylesheets/twitter/bootstrap/_panels.scss +83 -57
  32. data/app/assets/stylesheets/twitter/bootstrap/_popovers.scss +0 -2
  33. data/app/assets/stylesheets/twitter/bootstrap/_progress-bars.scss +2 -8
  34. data/app/assets/stylesheets/twitter/bootstrap/_responsive-utilities.scss +76 -21
  35. data/app/assets/stylesheets/twitter/bootstrap/_scaffolding.scss +18 -2
  36. data/app/assets/stylesheets/twitter/bootstrap/_tables.scss +1 -1
  37. data/app/assets/stylesheets/twitter/bootstrap/_thumbnails.scss +2 -2
  38. data/app/assets/stylesheets/twitter/bootstrap/_tooltip.scss +1 -1
  39. data/app/assets/stylesheets/twitter/bootstrap/_type.scss +19 -13
  40. data/app/assets/stylesheets/twitter/bootstrap/_utilities.scss +3 -2
  41. data/app/assets/stylesheets/twitter/bootstrap/_variables.scss +86 -46
  42. data/app/assets/stylesheets/twitter/bootstrap/_wells.scss +2 -2
  43. data/lib/bootstrap-rails/version.rb +1 -1
  44. data/vendor/assets/javascripts/holder.js +419 -0
  45. metadata +4 -3
  46. data/app/assets/stylesheets/twitter/bootstrap/_accordion.scss +0 -31
@@ -9,16 +9,16 @@
9
9
  min-width: 10px;
10
10
  padding: 3px 7px;
11
11
  font-size: $font-size-small;
12
- font-weight: bold;
12
+ font-weight: $badge-font-weight;
13
13
  color: $badge-color;
14
- line-height: 1;
15
- vertical-align: middle;
14
+ line-height: $badge-line-height;
15
+ vertical-align: baseline;
16
16
  white-space: nowrap;
17
17
  text-align: center;
18
18
  background-color: $badge-bg;
19
- border-radius: 10px;
19
+ border-radius: $badge-border-radius;
20
20
 
21
- // Empty labels/badges collapse
21
+ // Empty badges collapse automatically (not available in IE8)
22
22
  &:empty {
23
23
  display: none;
24
24
  }
@@ -28,6 +28,7 @@
28
28
 
29
29
  // Components: common
30
30
  @import "component-animations";
31
+ @import "input-groups";
31
32
  @import "dropdowns";
32
33
  @import "list-group";
33
34
  @import "panels";
@@ -54,7 +55,6 @@
54
55
  @import "labels";
55
56
  @import "badges";
56
57
  @import "progress-bars";
57
- @import "accordion";
58
58
  @import "carousel";
59
59
  @import "jumbotron";
60
60
 
@@ -3,11 +3,32 @@
3
3
  // --------------------------------------------------
4
4
 
5
5
  // Button carets
6
- .btn .caret {
7
- border-top-color: $btn-default-color;
6
+ //
7
+ // Match the button text color to the arrow/caret for indicating dropdown-ness.
8
+
9
+ .caret {
10
+ .btn-default & {
11
+ border-top-color: $btn-default-color;
12
+ }
13
+ .btn-primary &,
14
+ .btn-success &,
15
+ .btn-warning &,
16
+ .btn-danger &,
17
+ .btn-info & {
18
+ border-top-color: #fff;
19
+ }
8
20
  }
9
- .dropup .btn .caret {
10
- border-bottom-color: $btn-default-color;
21
+ .dropup .caret {
22
+ .btn-default & {
23
+ border-bottom-color: $btn-default-color;
24
+ }
25
+ .btn-primary &,
26
+ .btn-success &,
27
+ .btn-warning &,
28
+ .btn-danger &,
29
+ .btn-info & {
30
+ border-bottom-color: #fff;
31
+ }
11
32
  }
12
33
 
13
34
  // Make the div behave like a button
@@ -21,15 +42,26 @@
21
42
  float: left;
22
43
  // Bring the "active" button to the front
23
44
  &:hover,
24
- &:active {
45
+ &:focus,
46
+ &:active,
47
+ &.active {
25
48
  z-index: 2;
26
49
  }
50
+ &:focus {
51
+ // Remove focus outline when dropdown JS adds it after closing the menu
52
+ outline: none;
53
+ }
27
54
  }
28
55
  }
29
56
 
30
57
  // Prevent double borders when buttons are next to each other
31
- .btn-group .btn + .btn {
32
- margin-left: -1px;
58
+ .btn-group {
59
+ .btn + .btn,
60
+ .btn + .btn-group,
61
+ .btn-group + .btn,
62
+ .btn-group + .btn-group {
63
+ margin-left: -1px;
64
+ }
33
65
  }
34
66
 
35
67
  // Optional: Group multiple button groups together for a toolbar
@@ -90,6 +122,14 @@
90
122
  }
91
123
 
92
124
 
125
+ // Sizing
126
+ //
127
+ // Remix the default button sizing classes into new ones for easier manipulation.
128
+
129
+ .btn-group-xs > .btn { @include btn-xs(); }
130
+ .btn-group-sm > .btn { @include btn-sm(); }
131
+ .btn-group-lg > .btn { @include btn-lg(); }
132
+
93
133
 
94
134
  // Split button dropdowns
95
135
  // ----------------------
@@ -99,7 +139,7 @@
99
139
  padding-left: 8px;
100
140
  padding-right: 8px;
101
141
  }
102
- .btn-group > .btn-large + .dropdown-toggle {
142
+ .btn-group > .btn-lg + .dropdown-toggle {
103
143
  padding-left: 12px;
104
144
  padding-right: 12px;
105
145
  }
@@ -116,38 +156,70 @@
116
156
  margin-left: 0;
117
157
  }
118
158
  // Carets in other button sizes
119
- .btn-large .caret {
120
- border-width: 5px;
159
+ .btn-lg .caret {
160
+ border-width: $caret-width-large;
121
161
  }
122
162
  // Upside down carets for .dropup
123
- .dropup .btn-large .caret {
124
- border-bottom-width: 5px;
163
+ .dropup .btn-lg .caret {
164
+ border-bottom-width: $caret-width-large;
125
165
  }
126
166
 
127
167
 
128
168
  // Vertical button groups
129
169
  // ----------------------
130
170
 
131
- .btn-group-vertical > .btn {
132
- display: block;
133
- float: none;
134
- width: 100%;
135
- max-width: 100%;
136
- + .btn {
171
+ .btn-group-vertical {
172
+ > .btn,
173
+ > .btn-group {
174
+ display: block;
175
+ float: none;
176
+ width: 100%;
177
+ max-width: 100%;
178
+ }
179
+
180
+ // Clear floats so dropdown menus can be properly placed
181
+ > .btn-group {
182
+ @include clearfix();
183
+ > .btn {
184
+ float: none;
185
+ }
186
+ }
187
+
188
+ > .btn + .btn,
189
+ > .btn + .btn-group,
190
+ > .btn-group + .btn,
191
+ > .btn-group + .btn-group {
137
192
  margin-top: -1px;
193
+ margin-left: 0;
138
194
  }
139
195
  }
140
- .btn-group-vertical .btn {
196
+
197
+ .btn-group-vertical > .btn {
141
198
  &:not(:first-child):not(:last-child) {
142
199
  border-radius: 0;
143
200
  }
144
- &:first-child {
201
+ &:first-child:not(:last-child) {
202
+ border-top-right-radius: $border-radius-base;
145
203
  @include border-bottom-radius(0);
146
204
  }
147
- &:last-child {
205
+ &:last-child:not(:first-child) {
206
+ border-bottom-left-radius: $border-radius-base;
148
207
  @include border-top-radius(0);
149
208
  }
150
209
  }
210
+ .btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
211
+ border-radius: 0;
212
+ }
213
+ .btn-group-vertical > .btn-group:first-child {
214
+ > .btn:last-child,
215
+ > .dropdown-toggle {
216
+ @include border-bottom-radius(0);
217
+ }
218
+ }
219
+ .btn-group-vertical > .btn-group:last-child > .btn:first-child {
220
+ @include border-top-radius(0);
221
+ }
222
+
151
223
 
152
224
 
153
225
  // Justified button groups
@@ -156,6 +228,7 @@
156
228
  .btn-group-justified {
157
229
  display: table;
158
230
  width: 100%;
231
+ table-layout: fixed;
159
232
  .btn {
160
233
  float: none;
161
234
  display: table-cell;
@@ -165,7 +238,7 @@
165
238
 
166
239
 
167
240
  // Checkbox and radio options
168
- .btn-group[data-toggle="buttons"] > .btn > input[type="radio"],
169
- .btn-group[data-toggle="buttons"] > .btn > input[type="checkbox"] {
241
+ [data-toggle="buttons"] > .btn > input[type="radio"],
242
+ [data-toggle="buttons"] > .btn > input[type="checkbox"] {
170
243
  display: none;
171
244
  }
@@ -12,7 +12,7 @@
12
12
  padding: $padding-base-vertical $padding-base-horizontal;
13
13
  margin-bottom: 0; // For input.btn
14
14
  font-size: $font-size-base;
15
- font-weight: 500;
15
+ font-weight: $btn-font-weight;
16
16
  line-height: $line-height-base;
17
17
  text-align: center;
18
18
  vertical-align: middle;
@@ -20,6 +20,7 @@
20
20
  border: 1px solid transparent;
21
21
  border-radius: $border-radius-base;
22
22
  white-space: nowrap;
23
+ @include user-select(none);
23
24
 
24
25
  &:focus {
25
26
  @include tab-focus();
@@ -27,7 +28,7 @@
27
28
 
28
29
  &:hover,
29
30
  &:focus {
30
- color: $btn-hover-color;
31
+ color: $btn-default-color;
31
32
  text-decoration: none;
32
33
  }
33
34
 
@@ -53,26 +54,26 @@
53
54
  // --------------------------------------------------
54
55
 
55
56
  .btn-default {
56
- @include btn-pseudo-states($btn-default-color, $btn-default-bg, $btn-default-border);
57
+ @include button-variant($btn-default-color, $btn-default-bg, $btn-default-border);
57
58
  }
58
59
  .btn-primary {
59
- @include btn-pseudo-states($btn-primary-color, $btn-primary-bg, $btn-primary-border);
60
+ @include button-variant($btn-primary-color, $btn-primary-bg, $btn-primary-border);
60
61
  }
61
62
  // Warning appears as orange
62
63
  .btn-warning {
63
- @include btn-pseudo-states($btn-warning-color, $btn-warning-bg, $btn-warning-border);
64
+ @include button-variant($btn-warning-color, $btn-warning-bg, $btn-warning-border);
64
65
  }
65
66
  // Danger and error appear as red
66
67
  .btn-danger {
67
- @include btn-pseudo-states($btn-danger-color, $btn-danger-bg, $btn-danger-border);
68
+ @include button-variant($btn-danger-color, $btn-danger-bg, $btn-danger-border);
68
69
  }
69
70
  // Success appears as green
70
71
  .btn-success {
71
- @include btn-pseudo-states($btn-success-color, $btn-success-bg, $btn-success-border);
72
+ @include button-variant($btn-success-color, $btn-success-bg, $btn-success-border);
72
73
  }
73
74
  // Info appears as blue-green
74
75
  .btn-info {
75
- @include btn-pseudo-states($btn-info-color, $btn-info-bg, $btn-info-border);
76
+ @include button-variant($btn-info-color, $btn-info-bg, $btn-info-border);
76
77
  }
77
78
 
78
79
 
@@ -109,7 +110,7 @@
109
110
  fieldset[disabled] & {
110
111
  &:hover,
111
112
  &:focus {
112
- color: $gray-dark;
113
+ color: $btn-link-disabled-color;
113
114
  text-decoration: none;
114
115
  }
115
116
  }
@@ -119,17 +120,22 @@
119
120
  // Button Sizes
120
121
  // --------------------------------------------------
121
122
 
122
- .btn-large {
123
- padding: $padding-large-vertical $padding-large-horizontal;
124
- font-size: $font-size-large;
125
- border-radius: $border-radius-large;
123
+ @mixin btn-lg {
124
+ // line-height: ensure even-numbered height of button next to large input
125
+ @include button-size($padding-large-vertical, $padding-large-horizontal, $font-size-large, $line-height-large, $border-radius-large);
126
126
  }
127
- .btn-small {
128
- padding: $padding-small-vertical $padding-small-horizontal;
129
- font-size: $font-size-small;
130
- line-height: 1.5; // ensure proper height of button next to small input
131
- border-radius: $border-radius-small;
127
+ @mixin btn-sm {
128
+ // line-height: ensure proper height of button next to small input
129
+ @include button-size($padding-small-vertical, $padding-small-horizontal, $font-size-small, $line-height-small, $border-radius-small);
132
130
  }
131
+ @mixin btn-xs {
132
+ padding: 3px 5px;
133
+ }
134
+
135
+ .btn-lg {@include btn-lg}
136
+ .btn-sm,
137
+ .btn-xs {@include btn-sm}
138
+ .btn-xs {@include btn-xs}
133
139
 
134
140
 
135
141
  // Block button
@@ -69,9 +69,9 @@
69
69
  top: 0;
70
70
  left: 0;
71
71
  bottom: 0;
72
- width: 15%;
73
- @include opacity(.5);
74
- font-size: 20px;
72
+ width: $carousel-control-width;
73
+ @include opacity($carousel-control-opacity);
74
+ font-size: $carousel-control-font-size;
75
75
  color: $carousel-control-color;
76
76
  text-align: center;
77
77
  text-shadow: $carousel-text-shadow;
@@ -81,13 +81,11 @@
81
81
  // Set gradients for backgrounds
82
82
  &.left {
83
83
  @include gradient-horizontal($start-color: rgba(0,0,0,.5), $end-color: rgba(0,0,0,.0001));
84
- background-color: transparent;
85
84
  }
86
85
  &.right {
87
86
  left: auto;
88
87
  right: 0;
89
88
  @include gradient-horizontal($start-color: rgba(0,0,0,.0001), $end-color: rgba(0,0,0,.5));
90
- background-color: transparent;
91
89
  }
92
90
 
93
91
  // Hover/focus state
@@ -99,7 +97,6 @@
99
97
  }
100
98
 
101
99
  // Toggles
102
- .glyphicon,
103
100
  .icon-prev,
104
101
  .icon-next {
105
102
  position: absolute;
@@ -113,7 +110,7 @@
113
110
  margin-left: -10px;
114
111
  font-family: serif;
115
112
  }
116
- // Non-glyphicon toggles
113
+
117
114
  .icon-prev {
118
115
  &:before {
119
116
  content: '\2039';// SINGLE LEFT-POINTING ANGLE QUOTATION MARK (U+2039)
@@ -127,14 +124,17 @@
127
124
  }
128
125
 
129
126
  // Optional indicator pips
130
- // -----------------------------
127
+ //
128
+ // Add an unordered list with the following class and add a list item for each
129
+ // slide your carousel holds.
130
+
131
131
  .carousel-indicators {
132
132
  position: absolute;
133
133
  bottom: 10px;
134
134
  left: 50%;
135
135
  z-index: 15;
136
- width: 120px;
137
- margin-left: -60px;
136
+ width: 60%;
137
+ margin-left: -30%;
138
138
  padding-left: 0;
139
139
  list-style: none;
140
140
  text-align: center;
@@ -181,7 +181,6 @@
181
181
  @media screen and (min-width: $screen-tablet) {
182
182
 
183
183
  // Scale up the controls a smidge
184
- .carousel-control .glyphicon,
185
184
  .carousel-control .icon-prev,
186
185
  .carousel-control .icon-next {
187
186
  width: 30px;
@@ -6,7 +6,7 @@
6
6
  .close {
7
7
  float: right;
8
8
  font-size: ($font-size-base * 1.5);
9
- font-weight: bold;
9
+ font-weight: $close-font-weight;
10
10
  line-height: 1;
11
11
  color: $close-color;
12
12
  text-shadow: $close-text-shadow;
@@ -16,7 +16,7 @@ code {
16
16
  color: $code-color;
17
17
  background-color: $code-bg;
18
18
  white-space: nowrap;
19
- border-radius: 4px;
19
+ border-radius: $border-radius-base;
20
20
  }
21
21
 
22
22
  // Blocks of code
@@ -28,7 +28,7 @@ pre {
28
28
  line-height: $line-height-base;
29
29
  word-break: break-all;
30
30
  word-wrap: break-word;
31
- color: $gray-dark;
31
+ color: $pre-color;
32
32
  background-color: $pre-bg;
33
33
  border: 1px solid $pre-border-color;
34
34
  border-radius: $border-radius-base;
@@ -41,6 +41,7 @@ pre {
41
41
  // Account for some code outputs that place code tags in pre tags
42
42
  code {
43
43
  padding: 0;
44
+ font-size: inherit;
44
45
  color: inherit;
45
46
  white-space: pre-wrap;
46
47
  background-color: transparent;
@@ -50,6 +51,6 @@ pre {
50
51
 
51
52
  // Enable scrollable blocks of code
52
53
  .pre-scrollable {
53
- max-height: 340px;
54
+ max-height: $pre-scrollable-max-height;
54
55
  overflow-y: scroll;
55
56
  }
@@ -4,21 +4,29 @@
4
4
 
5
5
 
6
6
  // Dropdown arrow/caret
7
- // --------------------
8
7
  .caret {
9
8
  display: inline-block;
10
9
  width: 0;
11
10
  height: 0;
12
11
  margin-left: 2px;
13
12
  vertical-align: middle;
14
- border-top: 4px solid $dropdown-caret-color;
15
- border-right: 4px solid transparent;
16
- border-left: 4px solid transparent;
13
+ border-top: $caret-width-base solid $dropdown-caret-color;
14
+ border-right: $caret-width-base solid transparent;
15
+ border-left: $caret-width-base solid transparent;
17
16
  content: "";
18
17
  }
19
18
 
19
+ // The dropdown wrapper (div)
20
+ .dropdown {
21
+ position: relative;
22
+ }
23
+
24
+ // Prevent the focus on the dropdown toggle when closing dropdowns
25
+ .dropdown-toggle:focus {
26
+ outline: 0;
27
+ }
28
+
20
29
  // The dropdown menu (ul)
21
- // ----------------------
22
30
  .dropdown-menu {
23
31
  position: absolute;
24
32
  top: 100%;
@@ -30,12 +38,13 @@
30
38
  padding: 5px 0;
31
39
  margin: 2px 0 0; // override default ul
32
40
  list-style: none;
41
+ font-size: $font-size-base;
33
42
  background-color: $dropdown-bg;
34
43
  border: 1px solid $dropdown-fallback-border; // IE8 fallback
35
44
  border: 1px solid $dropdown-border;
36
45
  border-radius: $border-radius-base;
37
46
  @include box-shadow(0 6px 12px rgba(0,0,0,.175));
38
- @include background-clip(padding-box);
47
+ background-clip: padding-box;
39
48
 
40
49
  // Aligns the dropdown menu to right
41
50
  &.pull-right {
@@ -61,18 +70,17 @@
61
70
  }
62
71
 
63
72
  // Hover/Focus state
64
- // -----------
65
73
  .dropdown-menu > li > a {
66
74
  &:hover,
67
75
  &:focus {
68
76
  text-decoration: none;
69
77
  color: $dropdown-link-hover-color;
70
78
  @include gradient-vertical($start-color: $dropdown-link-hover-bg, $end-color: darken($dropdown-link-hover-bg, 5%));
79
+ background-color: darken($dropdown-link-hover-bg, 5%);
71
80
  }
72
81
  }
73
82
 
74
83
  // Active state
75
- // ------------
76
84
  .dropdown-menu > .active > a {
77
85
  &,
78
86
  &:hover,
@@ -81,17 +89,19 @@
81
89
  text-decoration: none;
82
90
  outline: 0;
83
91
  @include gradient-vertical($start-color: $dropdown-link-active-bg, $end-color: darken($dropdown-link-active-bg, 5%));
92
+ background-color: darken($dropdown-link-active-bg, 5%);
84
93
  }
85
94
  }
86
95
 
87
96
  // Disabled state
88
- // --------------
97
+ //
89
98
  // Gray out text and ensure the hover/focus state remains gray
99
+
90
100
  .dropdown-menu > .disabled > a {
91
101
  &,
92
102
  &:hover,
93
103
  &:focus {
94
- color: $gray-light;
104
+ color: $dropdown-link-disabled-color;
95
105
  }
96
106
  }
97
107
  // Nuke hover/focus effects
@@ -107,7 +117,6 @@
107
117
  }
108
118
 
109
119
  // Open state for the dropdown
110
- // ---------------------------
111
120
  .open {
112
121
  // Show the menu
113
122
  > .dropdown-menu {
@@ -121,19 +130,15 @@
121
130
  }
122
131
 
123
132
  // Dropdown section headers
124
- // ---------------------------
125
133
  .dropdown-header {
126
134
  display: block;
127
135
  padding: 3px 20px;
128
136
  font-size: $font-size-small;
129
137
  line-height: $line-height-base;
130
- color: $gray-light;
138
+ color: $dropdown-header-color;
131
139
  }
132
140
 
133
-
134
-
135
141
  // Backdrop to catch body clicks on mobile, etc.
136
- // ---------------------------
137
142
  .dropdown-backdrop {
138
143
  position: fixed;
139
144
  left: 0;
@@ -144,16 +149,16 @@
144
149
  }
145
150
 
146
151
  // Right aligned dropdowns
147
- // ---------------------------
148
152
  .pull-right > .dropdown-menu {
149
153
  right: 0;
150
154
  left: auto;
151
155
  }
152
156
 
153
157
  // Allow for dropdowns to go bottom up (aka, dropup-menu)
154
- // ------------------------------------------------------
158
+ //
155
159
  // Just add .dropup after the standard .dropdown class and you're set, bro.
156
160
  // TODO: abstract this so that the navbar fixed styles are not placed here?
161
+
157
162
  .dropup,
158
163
  .navbar-fixed-bottom .dropdown {
159
164
  // Reverse the caret