twitter-bootstrap-rails 2.0 → 2.0.1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of twitter-bootstrap-rails might be problematic. Click here for more details.

Files changed (77) hide show
  1. data/README.md +31 -37
  2. data/Rakefile +11 -0
  3. data/lib/generators/bootstrap/install/install_generator.rb +37 -13
  4. data/lib/generators/bootstrap/install/templates/application.css +0 -1
  5. data/lib/generators/bootstrap/install/templates/bootstrap.coffee +6 -15
  6. data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less +13 -0
  7. data/lib/generators/bootstrap/layout/layout_generator.rb +4 -4
  8. data/lib/generators/bootstrap/layout/templates/layout.html.erb +96 -49
  9. data/lib/generators/bootstrap/layout/templates/layout.html.haml +76 -0
  10. data/lib/generators/bootstrap/layout/templates/layout.html.slim +77 -0
  11. data/lib/generators/bootstrap/themed/templates/_form.html.erb +5 -4
  12. data/lib/generators/bootstrap/themed/templates/_form.html.haml +11 -0
  13. data/lib/generators/bootstrap/themed/templates/_form.html.slim +11 -0
  14. data/lib/generators/bootstrap/themed/templates/edit.html.erb +1 -2
  15. data/lib/generators/bootstrap/themed/templates/edit.html.haml +3 -0
  16. data/lib/generators/bootstrap/themed/templates/edit.html.slim +3 -0
  17. data/lib/generators/bootstrap/themed/templates/index.html.erb +27 -28
  18. data/lib/generators/bootstrap/themed/templates/index.html.haml +25 -0
  19. data/lib/generators/bootstrap/themed/templates/index.html.slim +25 -0
  20. data/lib/generators/bootstrap/themed/templates/new.html.haml +2 -0
  21. data/lib/generators/bootstrap/themed/templates/new.html.slim +2 -0
  22. data/lib/generators/bootstrap/themed/templates/show.html.erb +5 -4
  23. data/lib/generators/bootstrap/themed/templates/show.html.haml +9 -0
  24. data/lib/generators/bootstrap/themed/templates/show.html.slim +9 -0
  25. data/lib/generators/bootstrap/themed/themed_generator.rb +13 -13
  26. data/lib/twitter/bootstrap/rails/version.rb +1 -1
  27. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
  28. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
  29. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-alert.js +16 -7
  30. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-button.js +3 -3
  31. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-carousel.js +7 -4
  32. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-collapse.js +7 -5
  33. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-dropdown.js +16 -7
  34. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-modal.js +12 -7
  35. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-popover.js +5 -5
  36. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-scrollspy.js +4 -3
  37. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tab.js +11 -6
  38. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-tooltip.js +2 -2
  39. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-transition.js +3 -3
  40. data/vendor/assets/javascripts/twitter/bootstrap/bootstrap-typeahead.js +40 -21
  41. data/vendor/toolkit/twitter/bootstrap/accordion.less +5 -4
  42. data/vendor/toolkit/twitter/bootstrap/alerts.less +1 -0
  43. data/vendor/toolkit/twitter/bootstrap/bootstrap.less +10 -8
  44. data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +1 -1
  45. data/vendor/toolkit/twitter/bootstrap/button-groups.less +49 -17
  46. data/vendor/toolkit/twitter/bootstrap/buttons.less +156 -89
  47. data/vendor/toolkit/twitter/bootstrap/carousel.less +12 -5
  48. data/vendor/toolkit/twitter/bootstrap/code.less +57 -0
  49. data/vendor/toolkit/twitter/bootstrap/dropdowns.less +24 -4
  50. data/vendor/toolkit/twitter/bootstrap/forms.less +117 -91
  51. data/vendor/toolkit/twitter/bootstrap/grid.less +8 -0
  52. data/vendor/toolkit/twitter/bootstrap/hero-unit.less +20 -0
  53. data/vendor/toolkit/twitter/bootstrap/labels.less +23 -7
  54. data/vendor/toolkit/twitter/bootstrap/layouts.less +17 -0
  55. data/vendor/toolkit/twitter/bootstrap/mixins.less +253 -36
  56. data/vendor/toolkit/twitter/bootstrap/modals.less +20 -2
  57. data/vendor/toolkit/twitter/bootstrap/navbar.less +82 -34
  58. data/vendor/toolkit/twitter/bootstrap/navs.less +87 -72
  59. data/vendor/toolkit/twitter/bootstrap/pager.less +7 -2
  60. data/vendor/toolkit/twitter/bootstrap/pagination.less +1 -0
  61. data/vendor/toolkit/twitter/bootstrap/popovers.less +25 -25
  62. data/vendor/toolkit/twitter/bootstrap/progress-bars.less +14 -18
  63. data/vendor/toolkit/twitter/bootstrap/reset.less +3 -4
  64. data/vendor/toolkit/twitter/bootstrap/responsive.less +224 -165
  65. data/vendor/toolkit/twitter/bootstrap/scaffolding.less +6 -89
  66. data/vendor/toolkit/twitter/bootstrap/sprites.less +139 -99
  67. data/vendor/toolkit/twitter/bootstrap/tables.less +15 -57
  68. data/vendor/toolkit/twitter/bootstrap/thumbnails.less +4 -2
  69. data/vendor/toolkit/twitter/bootstrap/type.less +15 -44
  70. data/vendor/toolkit/twitter/bootstrap/variables.less +38 -21
  71. data/vendor/toolkit/twitter/bootstrap_base.less +2 -0
  72. metadata +36 -21
  73. data/lib/generators/bootstrap/install/templates/bootstrap.less +0 -5
  74. data/vendor/assets/stylesheets/twitter/bootstrap.css.less +0 -1
  75. data/vendor/toolkit/twitter/bootstrap.less +0 -1
  76. data/vendor/toolkit/twitter/bootstrap/patterns.less +0 -30
  77. data/vendor/toolkit/twitter/bootstrap/print.less +0 -18
@@ -9,15 +9,16 @@
9
9
 
10
10
  // Group == heading + body
11
11
  .accordion-group {
12
- background-color: #f5f5f5;
12
+ margin-bottom: 2px;
13
+ border: 1px solid #e5e5e5;
13
14
  .border-radius(4px);
14
15
  }
15
16
  .accordion-heading {
16
- padding: 8px 15px;
17
17
  border-bottom: 0;
18
18
  }
19
- .accordion-body {
20
- margin-bottom: 2px;
19
+ .accordion-heading .accordion-toggle {
20
+ display: block;
21
+ padding: 8px 15px;
21
22
  }
22
23
 
23
24
  // Inner needs the styles because you can't animate properly with any styles on the element
@@ -18,6 +18,7 @@
18
18
  // Adjust close link position
19
19
  .alert .close {
20
20
  position: relative;
21
+ top: -2px;
21
22
  right: -21px;
22
23
  line-height: 18px;
23
24
  }
@@ -1,12 +1,11 @@
1
1
  /*!
2
- * Bootstrap @VERSION
2
+ * Bootstrap v2.0.1
3
3
  *
4
4
  * Copyright 2012 Twitter, Inc
5
5
  * Licensed under the Apache License v2.0
6
6
  * http://www.apache.org/licenses/LICENSE-2.0
7
7
  *
8
8
  * Designed and built with all the love in the world @twitter by @mdo and @fat.
9
- * Date: @DATE
10
9
  */
11
10
 
12
11
  // CSS Reset
@@ -18,9 +17,12 @@
18
17
 
19
18
  // Grid system and page structure
20
19
  @import "scaffolding.less";
20
+ @import "grid.less";
21
+ @import "layouts.less";
21
22
 
22
23
  // Base CSS
23
24
  @import "type.less";
25
+ @import "code.less";
24
26
  @import "forms.less";
25
27
  @import "tables.less";
26
28
 
@@ -31,6 +33,11 @@
31
33
  @import "component-animations.less";
32
34
  @import "close.less";
33
35
 
36
+ // Components: Buttons & Alerts
37
+ @import "buttons.less";
38
+ @import "button-groups.less";
39
+ @import "alerts.less"; // Note: alerts share common CSS with buttons and thus have styles in buttons.less
40
+
34
41
  // Components: Nav
35
42
  @import "navs.less";
36
43
  @import "navbar.less";
@@ -43,18 +50,13 @@
43
50
  @import "tooltip.less";
44
51
  @import "popovers.less";
45
52
 
46
- // Components: Buttons & Alerts
47
- @import "buttons.less";
48
- @import "button-groups.less";
49
- @import "alerts.less"; // Note: alerts share common CSS with buttons and thus have styles in buttons.less
50
-
51
53
  // Components: Misc
52
54
  @import "thumbnails.less";
53
55
  @import "labels.less";
54
56
  @import "progress-bars.less";
55
57
  @import "accordion.less";
56
58
  @import "carousel.less";
57
- @import "responsive.less";
59
+ @import "hero-unit.less";
58
60
 
59
61
  // Utility classes
60
62
  @import "utilities.less"; // Has to be last to override when necessary
@@ -9,7 +9,7 @@
9
9
  .border-radius(3px);
10
10
  .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 {
@@ -6,6 +6,7 @@
6
6
  .btn-group {
7
7
  position: relative;
8
8
  .clearfix(); // clears the floated buttons
9
+ .ie7-restore-left-whitespace();
9
10
  }
10
11
 
11
12
  // Space out series of button groups
@@ -15,8 +16,11 @@
15
16
 
16
17
  // Optional: Group multiple button groups together for a toolbar
17
18
  .btn-toolbar {
19
+ margin-top: @baseLineHeight / 2;
20
+ margin-bottom: @baseLineHeight / 2;
18
21
  .btn-group {
19
22
  display: inline-block;
23
+ .ie7-inline-block();
20
24
  }
21
25
  }
22
26
 
@@ -69,10 +73,18 @@
69
73
  // On hover/focus/active, bring the proper btn to front
70
74
  .btn-group .btn:hover,
71
75
  .btn-group .btn:focus,
72
- .btn-group .btn:active {
76
+ .btn-group .btn:active,
77
+ .btn-group .btn.active {
73
78
  z-index: 2;
74
79
  }
75
80
 
81
+ // On active and open, don't show outline
82
+ .btn-group .dropdown-toggle:active,
83
+ .btn-group.open .dropdown-toggle {
84
+ outline: 0;
85
+ }
86
+
87
+
76
88
 
77
89
  // Split button dropdowns
78
90
  // ----------------------
@@ -81,36 +93,56 @@
81
93
  .btn-group .dropdown-toggle {
82
94
  padding-left: 8px;
83
95
  padding-right: 8px;
84
- @shadow: inset 1px 0 0 rgba(255,255,255,.125), 0 1px 2px rgba(0,0,0,.05);
96
+ @shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
85
97
  .box-shadow(@shadow);
98
+ *padding-top: 5px;
99
+ *padding-bottom: 5px;
86
100
  }
87
101
 
88
- // Reposition menu on open and round all corners
89
- .btn-group.open .dropdown-menu {
90
- display: block;
91
- margin-top: 1px;
92
- .border-radius(5px);
93
- }
94
- .btn-group.open .dropdown-toggle {
95
- background-image: none;
96
- @shadow: inset 0 1px 6px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
97
- .box-shadow(@shadow);
102
+ .btn-group.open {
103
+ // IE7's z-index only goes to the nearest positioned ancestor, which would
104
+ // make the menu appear below buttons that appeared later on the page
105
+ *z-index: @zindexDropdown;
106
+
107
+ // Reposition menu on open and round all corners
108
+ .dropdown-menu {
109
+ display: block;
110
+ margin-top: 1px;
111
+ .border-radius(5px);
112
+ }
113
+
114
+ .dropdown-toggle {
115
+ background-image: none;
116
+ @shadow: inset 0 1px 6px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
117
+ .box-shadow(@shadow);
118
+ }
98
119
  }
99
120
 
100
121
  // Reposition the caret
101
122
  .btn .caret {
102
- margin-top: 6px;
123
+ margin-top: 7px;
103
124
  margin-left: 0;
104
125
  }
126
+ .btn:hover .caret,
127
+ .open.btn-group .caret {
128
+ .opacity(100);
129
+ }
130
+
105
131
 
106
132
  // Account for other colors
107
- .primary,
108
- .danger,
109
- .info,
110
- .success {
133
+ .btn-primary,
134
+ .btn-danger,
135
+ .btn-info,
136
+ .btn-success,
137
+ .btn-inverse {
111
138
  .caret {
112
139
  border-top-color: @white;
113
140
  .opacity(75);
114
141
  }
115
142
  }
116
143
 
144
+ // Small button dropdowns
145
+ .btn-small .caret {
146
+ margin-top: 4px;
147
+ }
148
+
@@ -1,42 +1,22 @@
1
1
  // BUTTON STYLES
2
2
  // -------------
3
3
 
4
- // Shared colors for buttons and alerts
5
- .btn {
6
- // Set text color
7
- &.danger,
8
- &.danger:hover,
9
- &.success,
10
- &.success:hover,
11
- &.info,
12
- &.info:hover {
13
- text-shadow: 0 -1px 0 rgba(0,0,0,.25);
14
- color: @white
15
- }
16
- // Danger and error appear as red
17
- &.danger {
18
- .gradientBar(#ee5f5b, #c43c35);
19
- }
20
- // Success appears as green
21
- &.success {
22
- .gradientBar(#62c462, #57a957);
23
- }
24
- // Info appears as a neutral blue
25
- &.info {
26
- .gradientBar(#5bc0de, #339bb9);
27
- }
28
- }
29
4
 
30
- // Base .btn styles
5
+ // Base styles
6
+ // --------------------------------------------------
7
+
8
+ // Core
31
9
  .btn {
32
- // Button Base
33
10
  display: inline-block;
34
- padding: 5px 10px 6px;
11
+ padding: 4px 10px 4px;
12
+ margin-bottom: 0; // For input.btn
35
13
  font-size: @baseFontSize;
36
- line-height: normal;
14
+ line-height: @baseLineHeight;
37
15
  color: @grayDark;
16
+ text-align: center;
38
17
  text-shadow: 0 1px 1px rgba(255,255,255,.75);
39
- #gradient > .vertical-three-colors(@white, @white, 25%, darken(@white, 10%)); // Don't use .gradientbar() here since it does a three-color gradient
18
+ vertical-align: middle;
19
+ .buttonBackground(@white, darken(@white, 10%));
40
20
  border: 1px solid #ccc;
41
21
  border-bottom-color: #bbb;
42
22
  .border-radius(4px);
@@ -44,73 +24,160 @@
44
24
  .box-shadow(@shadow);
45
25
  cursor: pointer;
46
26
 
47
- &:hover {
48
- color: @grayDark;
49
- text-decoration: none;
50
- background-position: 0 -15px;
51
- }
27
+ // Give IE7 some love
28
+ .reset-filter();
29
+ .ie7-restore-left-whitespace();
30
+ }
52
31
 
53
- // Focus state for keyboard and accessibility
54
- &:focus {
55
- outline: 1px dotted #666;
56
- }
32
+ // Hover state
33
+ .btn:hover {
34
+ color: @grayDark;
35
+ text-decoration: none;
36
+ background-color: darken(@white, 10%);
37
+ background-position: 0 -15px;
57
38
 
58
- // Primary Button Type
59
- &.primary {
60
- color: @white;
61
- text-shadow: 0 -1px 0 rgba(0,0,0,.25);
62
- .gradientBar(@blue, @blueDark)
63
- }
39
+ // transition is only when going to hover, otherwise the background
40
+ // behind the gradient (there for IE<=9 fallback) gets mismatched
41
+ .transition(background-position .1s linear);
42
+ }
64
43
 
65
- // Transitions
66
- .transition(.1s linear all);
44
+ // Focus state for keyboard and accessibility
45
+ .btn:focus {
46
+ .tab-focus();
47
+ }
67
48
 
68
- // Active and Disabled states
69
- &.active,
70
- &:active {
71
- background-image: none;
72
- @shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
73
- .box-shadow(@shadow);
74
- }
75
- &.disabled {
76
- cursor: default;
77
- background-image: none;
78
- .reset-filter();
79
- .opacity(65);
80
- .box-shadow(none);
81
- }
82
- &[disabled] {
83
- // disabled pseudo can't be included with .disabled
84
- // def because IE8 and below will drop it ;_;
85
- cursor: default;
86
- background-image: none;
87
- .reset-filter();
88
- .opacity(65);
89
- .box-shadow(none);
90
- }
49
+ // Active state
50
+ .btn.active,
51
+ .btn:active {
52
+ background-image: none;
53
+ @shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
54
+ .box-shadow(@shadow);
55
+ background-color: darken(@white, 10%);
56
+ background-color: darken(@white, 15%) e("\9");
57
+ outline: 0;
58
+ }
91
59
 
92
- // Button Sizes
93
- &.large {
94
- padding: 9px 14px 9px;
95
- font-size: @baseFontSize + 2px;
96
- line-height: normal;
97
- .border-radius(5px);
98
- }
99
- &.small {
100
- padding: 7px 9px 7px;
101
- font-size: @baseFontSize - 2px;
102
- }
60
+ // Disabled state
61
+ .btn.disabled,
62
+ .btn[disabled] {
63
+ cursor: default;
64
+ background-image: none;
65
+ background-color: darken(@white, 10%);
66
+ .opacity(65);
67
+ .box-shadow(none);
103
68
  }
104
- // Super jank hack for removing border-radius from IE9 so we can keep filter gradients on alerts and buttons
105
- :root .btn {
106
- border-radius: 0 \0;
69
+
70
+
71
+ // Button Sizes
72
+ // --------------------------------------------------
73
+
74
+ // Large
75
+ .btn-large {
76
+ padding: 9px 14px;
77
+ font-size: @baseFontSize + 2px;
78
+ line-height: normal;
79
+ .border-radius(5px);
107
80
  }
81
+ .btn-large [class^="icon-"] {
82
+ margin-top: 1px;
83
+ }
84
+
85
+ // Small
86
+ .btn-small {
87
+ padding: 5px 9px;
88
+ font-size: @baseFontSize - 2px;
89
+ line-height: @baseLineHeight - 2px;
90
+ }
91
+ .btn-small [class^="icon-"] {
92
+ margin-top: -1px;
93
+ }
94
+
95
+ // Mini
96
+ .btn-mini {
97
+ padding: 2px 6px;
98
+ font-size: @baseFontSize - 2px;
99
+ line-height: @baseLineHeight - 4px;
100
+ }
101
+
102
+
103
+ // Alternate buttons
104
+ // --------------------------------------------------
105
+
106
+ // Set text color
107
+ // -------------------------
108
+ .btn-primary,
109
+ .btn-primary:hover,
110
+ .btn-warning,
111
+ .btn-warning:hover,
112
+ .btn-danger,
113
+ .btn-danger:hover,
114
+ .btn-success,
115
+ .btn-success:hover,
116
+ .btn-info,
117
+ .btn-info:hover,
118
+ .btn-inverse,
119
+ .btn-inverse:hover {
120
+ text-shadow: 0 -1px 0 rgba(0,0,0,.25);
121
+ color: @white;
122
+ }
123
+ // Provide *some* extra contrast for those who can get it
124
+ .btn-primary.active,
125
+ .btn-warning.active,
126
+ .btn-danger.active,
127
+ .btn-success.active,
128
+ .btn-info.active,
129
+ .btn-dark.active {
130
+ color: rgba(255,255,255,.75);
131
+ }
132
+
133
+ // Set the backgrounds
134
+ // -------------------------
135
+ .btn-primary {
136
+ .buttonBackground(@primaryButtonBackground, spin(@primaryButtonBackground, 20));
137
+ }
138
+ // Warning appears are orange
139
+ .btn-warning {
140
+ .buttonBackground(lighten(@orange, 15%), @orange);
141
+ }
142
+ // Danger and error appear as red
143
+ .btn-danger {
144
+ .buttonBackground(#ee5f5b, #bd362f);
145
+ }
146
+ // Success appears as green
147
+ .btn-success {
148
+ .buttonBackground(#62c462, #51a351);
149
+ }
150
+ // Info appears as a neutral blue
151
+ .btn-info {
152
+ .buttonBackground(#5bc0de, #2f96b4);
153
+ }
154
+ // Inverse appears as dark gray
155
+ .btn-inverse {
156
+ .buttonBackground(#454545, #262626);
157
+ }
158
+
159
+
160
+ // Cross-browser Jank
161
+ // --------------------------------------------------
108
162
 
109
- // Help Firefox not be a jerk about adding extra padding to buttons
110
163
  button.btn,
111
- input[type=submit].btn {
164
+ input[type="submit"].btn {
165
+
166
+ // Firefox 3.6 only I believe
112
167
  &::-moz-focus-inner {
113
- padding: 0;
114
- border: 0;
168
+ padding: 0;
169
+ border: 0;
115
170
  }
116
- }
171
+
172
+ // IE7 has some default padding on button controls
173
+ *padding-top: 2px;
174
+ *padding-bottom: 2px;
175
+ &.large {
176
+ *padding-top: 7px;
177
+ *padding-bottom: 7px;
178
+ }
179
+ &.small {
180
+ *padding-top: 3px;
181
+ *padding-bottom: 3px;
182
+ }
183
+ }