anjlab-bootstrap-rails 3.0.0.0.alpha1 → 3.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -27
- data/Rakefile +11 -35
- data/{vendor → app}/assets/javascripts/twitter/bootstrap.js +6 -6
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/affix.js +9 -3
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/alert.js +4 -2
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/button.js +6 -4
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/carousel.js +22 -12
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/collapse.js +69 -43
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/dropdown.js +22 -13
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/modal.js +37 -38
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/popover.js +11 -5
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/scrollspy.js +6 -4
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/tab.js +4 -2
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/tooltip.js +49 -38
- data/{vendor → app}/assets/javascripts/twitter/bootstrap/transition.js +10 -1
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap.scss +0 -0
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_accordion.scss +7 -10
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_alerts.scss +11 -34
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_badges.scss +8 -15
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_bootstrap.scss +0 -1
- data/app/assets/stylesheets/twitter/bootstrap/_breadcrumbs.scss +23 -0
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_button-groups.scss +23 -22
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_buttons.scss +21 -24
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_carousel.scss +46 -32
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_close.scss +3 -3
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_code.scss +6 -12
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_component-animations.scss +10 -4
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_dropdowns.scss +46 -101
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_forms.scss +139 -179
- data/app/assets/stylesheets/twitter/bootstrap/_grid.scss +155 -0
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_jumbotron.scss +1 -4
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_labels.scss +7 -31
- data/app/assets/stylesheets/twitter/bootstrap/_list-group.scss +89 -0
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_media.scss +8 -6
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_mixins.scss +152 -131
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_modals.scss +11 -12
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_navbar.scss +90 -66
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_navs.scss +56 -68
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_normalize.scss +0 -0
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_pager.scss +4 -3
- data/app/assets/stylesheets/twitter/bootstrap/_pagination.scss +108 -0
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_panels.scss +8 -2
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_popovers.scss +22 -20
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_print.scss +26 -0
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_progress-bars.scss +5 -18
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_responsive-utilities.scss +25 -25
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_scaffolding.scss +24 -8
- data/app/assets/stylesheets/twitter/bootstrap/_tables.scss +211 -0
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_thumbnails.scss +2 -3
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_tooltip.scss +26 -2
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_type.scss +31 -49
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_utilities.scss +0 -0
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_variables.scss +201 -54
- data/{vendor → app}/assets/stylesheets/twitter/bootstrap/_wells.scss +0 -0
- data/bootstrap-rails.gemspec +0 -1
- data/lib/bootstrap-rails/version.rb +1 -1
- metadata +54 -60
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.eot +0 -0
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.otf +0 -0
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.svg +0 -175
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.ttf +0 -0
- data/vendor/assets/fonts/twitter/glyphiconshalflings-regular.woff +0 -0
- data/vendor/assets/stylesheets/twitter/bootstrap/_breadcrumbs.scss +0 -28
- data/vendor/assets/stylesheets/twitter/bootstrap/_glyphicons.scss +0 -200
- data/vendor/assets/stylesheets/twitter/bootstrap/_grid.scss +0 -65
- data/vendor/assets/stylesheets/twitter/bootstrap/_list-group.scss +0 -96
- data/vendor/assets/stylesheets/twitter/bootstrap/_pagination.scss +0 -87
- data/vendor/assets/stylesheets/twitter/bootstrap/_tables.scss +0 -242
@@ -8,13 +8,13 @@
|
|
8
8
|
font-size: ($font-size-base * 1.5);
|
9
9
|
font-weight: bold;
|
10
10
|
line-height: 1;
|
11
|
-
color:
|
12
|
-
text-shadow:
|
11
|
+
color: $close-color;
|
12
|
+
text-shadow: $close-text-shadow;
|
13
13
|
@include opacity(.2);
|
14
14
|
|
15
15
|
&:hover,
|
16
16
|
&:focus {
|
17
|
-
color:
|
17
|
+
color: $close-color;
|
18
18
|
text-decoration: none;
|
19
19
|
cursor: pointer;
|
20
20
|
@include opacity(.5);
|
@@ -6,20 +6,17 @@
|
|
6
6
|
// Inline and block code styles
|
7
7
|
code,
|
8
8
|
pre {
|
9
|
-
padding: 0 3px 2px;
|
10
9
|
font-family: $font-family-monospace;
|
11
|
-
font-size: ($font-size-base - 2);
|
12
|
-
color: $gray-dark;
|
13
|
-
border-radius: 4px;
|
14
10
|
}
|
15
11
|
|
16
12
|
// Inline code
|
17
13
|
code {
|
18
14
|
padding: 2px 4px;
|
19
15
|
font-size: 90%;
|
20
|
-
color:
|
21
|
-
background-color:
|
16
|
+
color: $code-color;
|
17
|
+
background-color: $code-bg;
|
22
18
|
white-space: nowrap;
|
19
|
+
border-radius: 4px;
|
23
20
|
}
|
24
21
|
|
25
22
|
// Blocks of code
|
@@ -31,11 +28,9 @@ pre {
|
|
31
28
|
line-height: $line-height-base;
|
32
29
|
word-break: break-all;
|
33
30
|
word-wrap: break-word;
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
border: 1px solid #ccc; // IE8 fallback
|
38
|
-
border: 1px solid rgba(0,0,0,.15);
|
31
|
+
color: $gray-dark;
|
32
|
+
background-color: $pre-bg;
|
33
|
+
border: 1px solid $pre-border-color;
|
39
34
|
border-radius: $border-radius-base;
|
40
35
|
|
41
36
|
// Make prettyprint styles more spaced out for readability
|
@@ -47,7 +42,6 @@ pre {
|
|
47
42
|
code {
|
48
43
|
padding: 0;
|
49
44
|
color: inherit;
|
50
|
-
white-space: pre;
|
51
45
|
white-space: pre-wrap;
|
52
46
|
background-color: transparent;
|
53
47
|
border: 0;
|
@@ -2,6 +2,10 @@
|
|
2
2
|
// Component animations
|
3
3
|
// --------------------------------------------------
|
4
4
|
|
5
|
+
// Heads up!
|
6
|
+
//
|
7
|
+
// We don't use the `.opacity()` mixin here since it causes a bug with text
|
8
|
+
// fields in IE7-8. Source: https://github.com/twitter/bootstrap/pull/3552.
|
5
9
|
|
6
10
|
.fade {
|
7
11
|
opacity: 0;
|
@@ -12,12 +16,14 @@
|
|
12
16
|
}
|
13
17
|
|
14
18
|
.collapse {
|
19
|
+
display: none;
|
20
|
+
&.in {
|
21
|
+
display: block;
|
22
|
+
}
|
23
|
+
}
|
24
|
+
.collapsing {
|
15
25
|
position: relative;
|
16
26
|
height: 0;
|
17
27
|
overflow: hidden;
|
18
28
|
@include transition(height .35s ease);
|
19
|
-
|
20
|
-
&.in {
|
21
|
-
height: auto;
|
22
|
-
}
|
23
29
|
}
|
@@ -11,7 +11,7 @@
|
|
11
11
|
height: 0;
|
12
12
|
margin-left: 2px;
|
13
13
|
vertical-align: middle;
|
14
|
-
border-top: 4px solid
|
14
|
+
border-top: 4px solid $dropdown-caret-color;
|
15
15
|
border-right: 4px solid transparent;
|
16
16
|
border-left: 4px solid transparent;
|
17
17
|
content: "";
|
@@ -31,7 +31,7 @@
|
|
31
31
|
margin: 2px 0 0; // override default ul
|
32
32
|
list-style: none;
|
33
33
|
background-color: $dropdown-bg;
|
34
|
-
border: 1px solid
|
34
|
+
border: 1px solid $dropdown-fallback-border; // IE8 fallback
|
35
35
|
border: 1px solid $dropdown-border;
|
36
36
|
border-radius: $border-radius-base;
|
37
37
|
@include box-shadow(0 6px 12px rgba(0,0,0,.175));
|
@@ -45,7 +45,7 @@
|
|
45
45
|
|
46
46
|
// Dividers (basically an hr) within the dropdown
|
47
47
|
.divider {
|
48
|
-
@include nav-divider($dropdown-divider-
|
48
|
+
@include nav-divider($dropdown-divider-bg);
|
49
49
|
}
|
50
50
|
|
51
51
|
// Links within the dropdown menu
|
@@ -62,42 +62,48 @@
|
|
62
62
|
|
63
63
|
// Hover/Focus state
|
64
64
|
// -----------
|
65
|
-
.dropdown-menu > li > a
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
65
|
+
.dropdown-menu > li > a {
|
66
|
+
&:hover,
|
67
|
+
&:focus {
|
68
|
+
text-decoration: none;
|
69
|
+
color: $dropdown-link-hover-color;
|
70
|
+
@include gradient-vertical($start-color: $dropdown-link-hover-bg, $end-color: darken($dropdown-link-hover-bg, 5%));
|
71
|
+
}
|
72
72
|
}
|
73
73
|
|
74
74
|
// Active state
|
75
75
|
// ------------
|
76
|
-
.dropdown-menu > .active > a
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
76
|
+
.dropdown-menu > .active > a {
|
77
|
+
&,
|
78
|
+
&:hover,
|
79
|
+
&:focus {
|
80
|
+
color: $dropdown-link-active-color;
|
81
|
+
text-decoration: none;
|
82
|
+
outline: 0;
|
83
|
+
@include gradient-vertical($start-color: $dropdown-link-active-bg, $end-color: darken($dropdown-link-active-bg, 5%));
|
84
|
+
}
|
83
85
|
}
|
84
86
|
|
85
87
|
// Disabled state
|
86
88
|
// --------------
|
87
89
|
// Gray out text and ensure the hover/focus state remains gray
|
88
|
-
.dropdown-menu > .disabled > a
|
89
|
-
|
90
|
-
|
91
|
-
|
90
|
+
.dropdown-menu > .disabled > a {
|
91
|
+
&,
|
92
|
+
&:hover,
|
93
|
+
&:focus {
|
94
|
+
color: $gray-light;
|
95
|
+
}
|
92
96
|
}
|
93
97
|
// Nuke hover/focus effects
|
94
|
-
.dropdown-menu > .disabled > a
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
98
|
+
.dropdown-menu > .disabled > a {
|
99
|
+
&:hover,
|
100
|
+
&:focus {
|
101
|
+
text-decoration: none;
|
102
|
+
background-color: transparent;
|
103
|
+
background-image: none; // Remove CSS gradient
|
104
|
+
@include reset-filter();
|
105
|
+
cursor: not-allowed;
|
106
|
+
}
|
101
107
|
}
|
102
108
|
|
103
109
|
// Open state for the dropdown
|
@@ -114,6 +120,17 @@
|
|
114
120
|
}
|
115
121
|
}
|
116
122
|
|
123
|
+
// Dropdown section headers
|
124
|
+
// ---------------------------
|
125
|
+
.dropdown-header {
|
126
|
+
display: block;
|
127
|
+
padding: 3px 20px;
|
128
|
+
font-size: $font-size-small;
|
129
|
+
line-height: $line-height-base;
|
130
|
+
color: $gray-light;
|
131
|
+
}
|
132
|
+
|
133
|
+
|
117
134
|
|
118
135
|
// Backdrop to catch body clicks on mobile, etc.
|
119
136
|
// ---------------------------
|
@@ -142,7 +159,7 @@
|
|
142
159
|
// Reverse the caret
|
143
160
|
.caret {
|
144
161
|
border-top: 0;
|
145
|
-
border-bottom: 4px solid
|
162
|
+
border-bottom: 4px solid $dropdown-caret-color;
|
146
163
|
content: "";
|
147
164
|
}
|
148
165
|
// Different positioning for bottom up menu
|
@@ -152,75 +169,3 @@
|
|
152
169
|
margin-bottom: 1px;
|
153
170
|
}
|
154
171
|
}
|
155
|
-
|
156
|
-
// Sub menus
|
157
|
-
// ---------------------------
|
158
|
-
.dropdown-submenu {
|
159
|
-
position: relative;
|
160
|
-
}
|
161
|
-
// Default dropdowns
|
162
|
-
.dropdown-submenu > .dropdown-menu {
|
163
|
-
top: 0;
|
164
|
-
left: 100%;
|
165
|
-
margin-top: -6px;
|
166
|
-
margin-left: -1px;
|
167
|
-
border-top-left-radius: 0; // Nuke the closest corner as appropriate
|
168
|
-
}
|
169
|
-
.dropdown-submenu:hover > .dropdown-menu {
|
170
|
-
display: block;
|
171
|
-
}
|
172
|
-
|
173
|
-
// Dropups
|
174
|
-
.dropup .dropdown-submenu > .dropdown-menu {
|
175
|
-
top: auto;
|
176
|
-
bottom: 0;
|
177
|
-
margin-top: 0;
|
178
|
-
margin-bottom: -2px;
|
179
|
-
border-bottom-left-radius: 0; // Nuke the closest corner as appropriate
|
180
|
-
}
|
181
|
-
|
182
|
-
// Caret to indicate there is a submenu
|
183
|
-
.dropdown-submenu > a:after {
|
184
|
-
display: block;
|
185
|
-
content: " ";
|
186
|
-
float: right;
|
187
|
-
width: 0;
|
188
|
-
height: 0;
|
189
|
-
border-color: transparent;
|
190
|
-
border-style: solid;
|
191
|
-
border-width: 5px 0 5px 5px;
|
192
|
-
border-left-color: darken($dropdown-bg, 20%);
|
193
|
-
margin-top: 5px;
|
194
|
-
margin-right: -10px;
|
195
|
-
}
|
196
|
-
.dropdown-submenu:hover > a:after {
|
197
|
-
border-left-color: $dropdown-link-hover-color;
|
198
|
-
}
|
199
|
-
|
200
|
-
// Left aligned submenus
|
201
|
-
.dropdown-submenu.pull-left {
|
202
|
-
// Undo the float
|
203
|
-
// Yes, this is awkward since .pull-left adds a float, but it sticks to our conventions elsewhere.
|
204
|
-
float: none;
|
205
|
-
|
206
|
-
// Positioning the submenu
|
207
|
-
> .dropdown-menu {
|
208
|
-
left: -100%;
|
209
|
-
margin-left: 10px;
|
210
|
-
border-top-right-radius: 0; // Remove the rounded corner here
|
211
|
-
}
|
212
|
-
}
|
213
|
-
|
214
|
-
// Tweak nav headers
|
215
|
-
// ---------------------------
|
216
|
-
// Increase padding from 15px to 20px on sides
|
217
|
-
.dropdown .dropdown-menu .nav-header {
|
218
|
-
padding-left: 20px;
|
219
|
-
padding-right: 20px;
|
220
|
-
}
|
221
|
-
|
222
|
-
// Typeahead
|
223
|
-
// ---------------------------
|
224
|
-
.typeahead {
|
225
|
-
z-index: 1051;
|
226
|
-
}
|
@@ -3,12 +3,9 @@
|
|
3
3
|
// --------------------------------------------------
|
4
4
|
|
5
5
|
|
6
|
-
//
|
7
|
-
//
|
8
|
-
|
9
|
-
form {
|
10
|
-
margin: 0;
|
11
|
-
}
|
6
|
+
// Normalize non-controls
|
7
|
+
//
|
8
|
+
// Restyle and baseline non-control form elements.
|
12
9
|
|
13
10
|
fieldset {
|
14
11
|
padding: 0;
|
@@ -25,7 +22,7 @@ legend {
|
|
25
22
|
line-height: inherit;
|
26
23
|
color: $gray-dark;
|
27
24
|
border: 0;
|
28
|
-
border-bottom: 1px solid
|
25
|
+
border-bottom: 1px solid $legend-border-color;
|
29
26
|
}
|
30
27
|
|
31
28
|
label {
|
@@ -34,75 +31,14 @@ label {
|
|
34
31
|
font-weight: bold;
|
35
32
|
}
|
36
33
|
|
37
|
-
// Form controls
|
38
|
-
// -------------------------
|
39
|
-
|
40
|
-
// Shared size and type resets
|
41
|
-
select,
|
42
|
-
textarea,
|
43
|
-
input[type="text"],
|
44
|
-
input[type="password"],
|
45
|
-
input[type="datetime"],
|
46
|
-
input[type="datetime-local"],
|
47
|
-
input[type="date"],
|
48
|
-
input[type="month"],
|
49
|
-
input[type="time"],
|
50
|
-
input[type="week"],
|
51
|
-
input[type="number"],
|
52
|
-
input[type="email"],
|
53
|
-
input[type="url"],
|
54
|
-
input[type="search"],
|
55
|
-
input[type="tel"],
|
56
|
-
input[type="color"] {
|
57
|
-
display: block;
|
58
|
-
min-height: $input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
|
59
|
-
padding: $padding-base-vertical $padding-base-horizontal;
|
60
|
-
font-size: $font-size-base;
|
61
|
-
line-height: $line-height-base;
|
62
|
-
color: $gray;
|
63
|
-
vertical-align: middle;
|
64
|
-
background-color: $input-bg;
|
65
|
-
border: 1px solid $input-border;
|
66
|
-
border-radius: $input-border-radius;
|
67
|
-
@include box-shadow(inset 0 1px 1px rgba(0,0,0,.075));
|
68
|
-
@include transition((border-color ease-in-out .15s, box-shadow ease-in-out .15s));
|
69
|
-
|
70
|
-
&:focus {
|
71
|
-
border-color: rgba(82,168,236,.8);
|
72
|
-
outline: 0;
|
73
|
-
@include box-shadow((inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6)));
|
74
|
-
}
|
75
|
-
}
|
76
34
|
|
77
|
-
//
|
78
|
-
// Can't be on input[type=*] selectors or it's too specific
|
79
|
-
input,
|
80
|
-
select,
|
81
|
-
textarea {
|
82
|
-
width: 100%;
|
83
|
-
}
|
84
|
-
|
85
|
-
// Reset width of input images, buttons, radios, checkboxes
|
86
|
-
input[type="file"],
|
87
|
-
input[type="image"],
|
88
|
-
input[type="submit"],
|
89
|
-
input[type="reset"],
|
90
|
-
input[type="button"],
|
91
|
-
input[type="radio"],
|
92
|
-
input[type="checkbox"] {
|
93
|
-
width: auto; // Override of generic input selector
|
94
|
-
}
|
35
|
+
// Normalize form controls
|
95
36
|
|
96
37
|
// Override content-box in Normalize (* isn't specific enough)
|
97
38
|
input[type="search"] {
|
98
39
|
@include box-sizing(border-box);
|
99
40
|
}
|
100
41
|
|
101
|
-
// Reset height since textareas have rows
|
102
|
-
textarea {
|
103
|
-
height: auto;
|
104
|
-
}
|
105
|
-
|
106
42
|
// Position radios and checkboxes better
|
107
43
|
input[type="radio"],
|
108
44
|
input[type="checkbox"] {
|
@@ -112,10 +48,8 @@ input[type="checkbox"] {
|
|
112
48
|
}
|
113
49
|
|
114
50
|
// Set the height of select and file controls to match text inputs
|
115
|
-
select,
|
116
51
|
input[type="file"] {
|
117
|
-
|
118
|
-
line-height: $input-height-base;
|
52
|
+
display: block;
|
119
53
|
}
|
120
54
|
|
121
55
|
// Make multiple select elements height not fixed
|
@@ -124,7 +58,7 @@ select[size] {
|
|
124
58
|
height: auto;
|
125
59
|
}
|
126
60
|
|
127
|
-
// Fix optgroup Firefox bug per https://github.com/
|
61
|
+
// Fix optgroup Firefox bug per https://github.com/twbs/bootstrap/issues/7611
|
128
62
|
select optgroup {
|
129
63
|
font-size: inherit;
|
130
64
|
font-style: inherit;
|
@@ -138,21 +72,101 @@ input[type="checkbox"]:focus {
|
|
138
72
|
@include tab-focus();
|
139
73
|
}
|
140
74
|
|
75
|
+
// Fix for Chrome number input
|
76
|
+
// Setting certain font-sizes causes the `I` bar to appear on hover of the bottom increment button.
|
77
|
+
// See https://github.com/twbs/bootstrap/issues/8350 for more.
|
78
|
+
input[type="number"] {
|
79
|
+
&::-webkit-outer-spin-button,
|
80
|
+
&::-webkit-inner-spin-button {
|
81
|
+
height: auto;
|
82
|
+
}
|
83
|
+
}
|
141
84
|
|
142
|
-
// Placeholder
|
143
|
-
// -------------------------
|
144
85
|
|
145
|
-
// Placeholder
|
146
|
-
|
147
|
-
|
86
|
+
// Placeholder
|
87
|
+
//
|
88
|
+
// Placeholder text gets special styles because when browsers invalidate entire
|
89
|
+
// lines if it doesn't understand a selector/
|
90
|
+
.form-control {
|
148
91
|
@include placeholder();
|
149
92
|
}
|
150
93
|
|
151
94
|
|
152
|
-
//
|
153
|
-
//
|
95
|
+
// Common form controls
|
96
|
+
//
|
97
|
+
// Shared size and type resets for form controls. Apply `.form-control` to any
|
98
|
+
// of the following form controls:
|
99
|
+
//
|
100
|
+
// select
|
101
|
+
// textarea
|
102
|
+
// input[type="text"]
|
103
|
+
// input[type="password"]
|
104
|
+
// input[type="datetime"]
|
105
|
+
// input[type="datetime-local"]
|
106
|
+
// input[type="date"]
|
107
|
+
// input[type="month"]
|
108
|
+
// input[type="time"]
|
109
|
+
// input[type="week"]
|
110
|
+
// input[type="number"]
|
111
|
+
// input[type="email"]
|
112
|
+
// input[type="url"]
|
113
|
+
// input[type="search"]
|
114
|
+
// input[type="tel"]
|
115
|
+
// input[type="color"]
|
116
|
+
|
117
|
+
.form-control {
|
118
|
+
display: block;
|
119
|
+
width: 100%;
|
120
|
+
height: $input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
|
121
|
+
padding: $padding-base-vertical $padding-base-horizontal;
|
122
|
+
font-size: $font-size-base;
|
123
|
+
line-height: $line-height-base;
|
124
|
+
color: $gray;
|
125
|
+
vertical-align: middle;
|
126
|
+
background-color: $input-bg;
|
127
|
+
border: 1px solid $input-border;
|
128
|
+
border-radius: $input-border-radius;
|
129
|
+
@include box-shadow(inset 0 1px 1px rgba(0,0,0,.075));
|
130
|
+
@include transition((border-color ease-in-out .15s, box-shadow ease-in-out .15s));
|
131
|
+
|
132
|
+
&:focus {
|
133
|
+
border-color: rgba(82,168,236,.8);
|
134
|
+
outline: 0;
|
135
|
+
@include box-shadow((inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6)));
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
// Disabled and read-only inputs
|
140
|
+
// Note: HTML5 says that inputs under a fieldset > legend:first-child won't be
|
141
|
+
// disabled if the fieldset is disabled. Due to implementation difficulty,
|
142
|
+
// we don't honor that edge case; we style them as disabled anyway.
|
143
|
+
.form-control[disabled],
|
144
|
+
.form-control[readonly],
|
145
|
+
fieldset[disabled] .form-control {
|
146
|
+
cursor: not-allowed;
|
147
|
+
background-color: $input-bg-disabled;
|
148
|
+
}
|
149
|
+
|
150
|
+
// Reset height for `textarea`s
|
151
|
+
textarea.form-control {
|
152
|
+
height: auto;
|
153
|
+
}
|
154
|
+
|
155
|
+
|
156
|
+
// Form groups
|
157
|
+
//
|
158
|
+
// Designed to help with the organization and spacing of vertical forms. For
|
159
|
+
// horizontal forms, use the predefined grid classes.
|
160
|
+
|
161
|
+
.form-group {
|
162
|
+
margin-bottom: 15px;
|
163
|
+
}
|
164
|
+
|
165
|
+
|
166
|
+
// Checkboxes and radios
|
167
|
+
//
|
168
|
+
// Indent the labels to position radios/checkboxes as hanging controls.
|
154
169
|
|
155
|
-
// Indent the labels to position radios/checkboxes as hanging
|
156
170
|
.radio,
|
157
171
|
.checkbox {
|
158
172
|
display: block;
|
@@ -180,19 +194,10 @@ textarea {
|
|
180
194
|
margin-top: -5px; // Move up sibling radios or checkboxes for tighter spacing
|
181
195
|
}
|
182
196
|
|
183
|
-
/*
|
184
|
-
// Move the options list down to align with labels
|
185
|
-
.controls > .radio:first-child,
|
186
|
-
.controls > .checkbox:first-child {
|
187
|
-
padding-top: 5px; // has to be padding because margin collaspes
|
188
|
-
}
|
189
|
-
*/
|
190
|
-
|
191
197
|
// Radios and checkboxes on same line
|
192
198
|
.radio-inline,
|
193
199
|
.checkbox-inline {
|
194
200
|
display: inline-block;
|
195
|
-
// padding-top: 5px;
|
196
201
|
padding-left: 20px;
|
197
202
|
margin-bottom: 0;
|
198
203
|
vertical-align: middle;
|
@@ -207,104 +212,60 @@ textarea {
|
|
207
212
|
|
208
213
|
|
209
214
|
|
210
|
-
//
|
211
|
-
//
|
215
|
+
// Form control sizing
|
216
|
+
//
|
217
|
+
// Relative text size, padding, and border-radii changes for form controls. For
|
218
|
+
// horizontal sizing, wrap controls in the predefined grid classes. `<select>`
|
219
|
+
// element gets special love because it's special, and that's a fact!
|
212
220
|
|
213
|
-
|
214
|
-
textarea,
|
215
|
-
input[type="text"],
|
216
|
-
input[type="password"],
|
217
|
-
input[type="datetime"],
|
218
|
-
input[type="datetime-local"],
|
219
|
-
input[type="date"],
|
220
|
-
input[type="month"],
|
221
|
-
input[type="time"],
|
222
|
-
input[type="week"],
|
223
|
-
input[type="number"],
|
224
|
-
input[type="email"],
|
225
|
-
input[type="url"],
|
226
|
-
input[type="search"],
|
227
|
-
input[type="tel"],
|
228
|
-
input[type="color"] {
|
221
|
+
.form-control {
|
229
222
|
&.input-large {
|
223
|
+
height: $input-height-large;
|
230
224
|
padding: $padding-large-vertical $padding-large-horizontal;
|
231
225
|
font-size: $font-size-large;
|
232
226
|
border-radius: $border-radius-large;
|
233
227
|
}
|
234
228
|
&.input-small {
|
235
|
-
|
229
|
+
height: $input-height-small;
|
236
230
|
padding: $padding-small-vertical $padding-small-horizontal;
|
237
231
|
font-size: $font-size-small;
|
238
232
|
border-radius: $border-radius-small;
|
239
233
|
}
|
240
234
|
}
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
// Disabled and read-only inputs
|
247
|
-
// Note: HTML5 says that inputs under a fieldset > legend:first-child won't be
|
248
|
-
// disabled if the fieldset is disabled. Due to implementation difficulty,
|
249
|
-
// we don't honor that edge case; we style them as disabled anyway.
|
250
|
-
input,
|
251
|
-
select,
|
252
|
-
textarea {
|
253
|
-
&[disabled],
|
254
|
-
&[readonly],
|
255
|
-
fieldset[disabled] & {
|
256
|
-
cursor: not-allowed;
|
257
|
-
background-color: $input-bg-disabled;
|
235
|
+
select {
|
236
|
+
&.input-large {
|
237
|
+
height: $input-height-large;
|
238
|
+
line-height: $input-height-large;
|
258
239
|
}
|
259
|
-
|
260
|
-
|
261
|
-
input
|
262
|
-
input[type="checkbox"] {
|
263
|
-
&[disabled],
|
264
|
-
&[readonly],
|
265
|
-
fieldset[disabled] & {
|
266
|
-
background-color: transparent;
|
240
|
+
&.input-small {
|
241
|
+
height: $input-height-small;
|
242
|
+
line-height: $input-height-small;
|
267
243
|
}
|
268
244
|
}
|
269
245
|
|
270
246
|
|
271
|
-
|
272
|
-
|
273
|
-
//
|
274
|
-
// --------------------------
|
247
|
+
// Form control feedback states
|
248
|
+
//
|
249
|
+
// Apply contextual and semantic states to individual form controls.
|
275
250
|
|
276
251
|
// Warning
|
277
252
|
.has-warning {
|
278
|
-
@include form-
|
253
|
+
@include form-control-validation($state-warning-text, $state-warning-text, $state-warning-bg);
|
279
254
|
}
|
280
255
|
// Error
|
281
256
|
.has-error {
|
282
|
-
@include form-
|
257
|
+
@include form-control-validation($state-danger-text, $state-danger-text, $state-danger-bg);
|
283
258
|
}
|
284
259
|
// Success
|
285
260
|
.has-success {
|
286
|
-
@include form-
|
261
|
+
@include form-control-validation($state-success-text, $state-success-text, $state-success-bg);
|
287
262
|
}
|
288
263
|
|
289
|
-
// HTML5 invalid states
|
290
|
-
// Shares styles with the .control-group.error above
|
291
|
-
input:focus:invalid,
|
292
|
-
textarea:focus:invalid,
|
293
|
-
select:focus:invalid {
|
294
|
-
color: #b94a48;
|
295
|
-
border-color: #ee5f5b;
|
296
|
-
&:focus {
|
297
|
-
border-color: darken(#ee5f5b, 10%);
|
298
|
-
$shadow: 0 0 6px lighten(#ee5f5b, 20%);
|
299
|
-
@include box-shadow($shadow);
|
300
|
-
}
|
301
|
-
}
|
302
|
-
|
303
|
-
|
304
|
-
|
305
264
|
|
306
|
-
//
|
307
|
-
//
|
265
|
+
// Help text
|
266
|
+
//
|
267
|
+
// Apply to any element you wish to create light text for placement immediately
|
268
|
+
// below a form control. Use for general help, formatting, or instructional text.
|
308
269
|
|
309
270
|
.help-block {
|
310
271
|
display: block; // account for any element using help-block
|
@@ -322,6 +283,7 @@ select:focus:invalid {
|
|
322
283
|
// -------------------------
|
323
284
|
.input-group {
|
324
285
|
display: table;
|
286
|
+
border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table
|
325
287
|
|
326
288
|
// Undo padding and float of grid classes
|
327
289
|
&.col {
|
@@ -330,8 +292,7 @@ select:focus:invalid {
|
|
330
292
|
padding-right: 0;
|
331
293
|
}
|
332
294
|
|
333
|
-
|
334
|
-
select {
|
295
|
+
.form-control {
|
335
296
|
width: 100%;
|
336
297
|
margin-bottom: 0;
|
337
298
|
}
|
@@ -341,7 +302,7 @@ select:focus:invalid {
|
|
341
302
|
// -------------------------
|
342
303
|
.input-group-addon,
|
343
304
|
.input-group-btn,
|
344
|
-
.input-group
|
305
|
+
.input-group .form-control {
|
345
306
|
display: table-cell;
|
346
307
|
|
347
308
|
&:not(:first-child):not(:last-child) {
|
@@ -352,6 +313,7 @@ select:focus:invalid {
|
|
352
313
|
.input-group-addon,
|
353
314
|
.input-group-btn {
|
354
315
|
width: 1%;
|
316
|
+
white-space: nowrap;
|
355
317
|
vertical-align: middle; // Match the inputs
|
356
318
|
}
|
357
319
|
|
@@ -359,14 +321,13 @@ select:focus:invalid {
|
|
359
321
|
// -------------------------
|
360
322
|
.input-group-addon {
|
361
323
|
@include box-sizing(border-box);
|
362
|
-
padding:
|
324
|
+
padding: $padding-base-vertical $padding-base-horizontal;
|
363
325
|
font-size: $font-size-base;
|
364
326
|
font-weight: normal;
|
365
327
|
line-height: $line-height-base;
|
366
328
|
text-align: center;
|
367
|
-
text-shadow: 0 1px 0 #fff;
|
368
329
|
background-color: $gray-lighter;
|
369
|
-
border: 1px solid
|
330
|
+
border: 1px solid $input-group-addon-border-color;
|
370
331
|
border-radius: $border-radius-base;
|
371
332
|
|
372
333
|
&.input-small {
|
@@ -382,7 +343,7 @@ select:focus:invalid {
|
|
382
343
|
}
|
383
344
|
|
384
345
|
// Reset rounded corners
|
385
|
-
.input-group
|
346
|
+
.input-group .form-control:first-child,
|
386
347
|
.input-group-addon:first-child,
|
387
348
|
.input-group-btn:first-child > .btn,
|
388
349
|
.input-group-btn:first-child > .dropdown-toggle,
|
@@ -392,7 +353,7 @@ select:focus:invalid {
|
|
392
353
|
.input-group-addon:first-child {
|
393
354
|
border-right: 0;
|
394
355
|
}
|
395
|
-
.input-group
|
356
|
+
.input-group .form-control:last-child,
|
396
357
|
.input-group-addon:last-child,
|
397
358
|
.input-group-btn:last-child > .btn,
|
398
359
|
.input-group-btn:last-child > .dropdown-toggle,
|
@@ -411,9 +372,9 @@ select:focus:invalid {
|
|
411
372
|
}
|
412
373
|
.input-group-btn > .btn {
|
413
374
|
position: relative;
|
414
|
-
|
375
|
+
// Jankily prevent input button groups from wrapping
|
415
376
|
+ .btn {
|
416
|
-
margin-left: -
|
377
|
+
margin-left: -4px;
|
417
378
|
}
|
418
379
|
// Bring the "active" button to the front
|
419
380
|
&:hover,
|
@@ -427,9 +388,7 @@ select:focus:invalid {
|
|
427
388
|
// --------------------------------------------------
|
428
389
|
|
429
390
|
@mixin form-inline {
|
430
|
-
|
431
|
-
select,
|
432
|
-
textarea,
|
391
|
+
.form-control,
|
433
392
|
.radio,
|
434
393
|
.checkbox {
|
435
394
|
display: inline-block;
|
@@ -447,17 +406,18 @@ select:focus:invalid {
|
|
447
406
|
// --------------------------------------------------
|
448
407
|
// Horizontal forms are built on grid classes.
|
449
408
|
|
409
|
+
.form-horizontal .control-label {
|
410
|
+
padding-top: 6px;
|
411
|
+
}
|
412
|
+
|
450
413
|
.form-horizontal {
|
451
|
-
.
|
452
|
-
|
453
|
-
}
|
454
|
-
.control-label {
|
455
|
-
padding-top: 6px;
|
414
|
+
.form-group {
|
415
|
+
@include make-row();
|
456
416
|
}
|
457
417
|
}
|
458
418
|
|
459
|
-
// Only right
|
460
|
-
@media (min-width:
|
419
|
+
// Only right align form labels here when the columns stop stacking
|
420
|
+
@media (min-width: $screen-tablet) {
|
461
421
|
.form-horizontal .control-label {
|
462
422
|
text-align: right;
|
463
423
|
}
|