bootstrap 4.0.0.alpha1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bootstrap might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/.gitattributes +14 -0
- data/.gitignore +19 -0
- data/.travis.yml +16 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile +13 -0
- data/LICENSE +21 -0
- data/README.md +143 -0
- data/Rakefile +75 -0
- data/assets/javascripts/bootstrap-sprockets.js +11 -0
- data/assets/javascripts/bootstrap.js +3560 -0
- data/assets/javascripts/bootstrap.min.js +220 -0
- data/assets/javascripts/bootstrap/alert.js +192 -0
- data/assets/javascripts/bootstrap/button.js +172 -0
- data/assets/javascripts/bootstrap/carousel.js +478 -0
- data/assets/javascripts/bootstrap/collapse.js +364 -0
- data/assets/javascripts/bootstrap/dropdown.js +293 -0
- data/assets/javascripts/bootstrap/modal.js +536 -0
- data/assets/javascripts/bootstrap/popover.js +201 -0
- data/assets/javascripts/bootstrap/scrollspy.js +320 -0
- data/assets/javascripts/bootstrap/tab.js +263 -0
- data/assets/javascripts/bootstrap/tooltip.js +619 -0
- data/assets/javascripts/bootstrap/util.js +157 -0
- data/assets/stylesheets/_bootstrap-flex.scss +8 -0
- data/assets/stylesheets/_bootstrap-grid.scss +62 -0
- data/assets/stylesheets/_bootstrap-reboot.scss +10 -0
- data/assets/stylesheets/_bootstrap.scss +55 -0
- data/assets/stylesheets/bootstrap/_alert.scss +65 -0
- data/assets/stylesheets/bootstrap/_animation.scss +27 -0
- data/assets/stylesheets/bootstrap/_breadcrumb.scss +23 -0
- data/assets/stylesheets/bootstrap/_button-group.scss +224 -0
- data/assets/stylesheets/bootstrap/_buttons.scss +174 -0
- data/assets/stylesheets/bootstrap/_card.scss +293 -0
- data/assets/stylesheets/bootstrap/_carousel.scss +252 -0
- data/assets/stylesheets/bootstrap/_close.scss +28 -0
- data/assets/stylesheets/bootstrap/_code.scss +58 -0
- data/assets/stylesheets/bootstrap/_custom-forms.scss +225 -0
- data/assets/stylesheets/bootstrap/_dropdown.scss +191 -0
- data/assets/stylesheets/bootstrap/_forms.scss +454 -0
- data/assets/stylesheets/bootstrap/_grid.scss +76 -0
- data/assets/stylesheets/bootstrap/_images.scss +28 -0
- data/assets/stylesheets/bootstrap/_input-group.scss +181 -0
- data/assets/stylesheets/bootstrap/_jumbotron.scss +22 -0
- data/assets/stylesheets/bootstrap/_labels.scss +75 -0
- data/assets/stylesheets/bootstrap/_list-group.scss +128 -0
- data/assets/stylesheets/bootstrap/_media.scss +90 -0
- data/assets/stylesheets/bootstrap/_mixins.scss +54 -0
- data/assets/stylesheets/bootstrap/_modal.scss +146 -0
- data/assets/stylesheets/bootstrap/_nav.scss +155 -0
- data/assets/stylesheets/bootstrap/_navbar.scss +230 -0
- data/assets/stylesheets/bootstrap/_normalize.scss +428 -0
- data/assets/stylesheets/bootstrap/_pager.scss +57 -0
- data/assets/stylesheets/bootstrap/_pagination.scss +82 -0
- data/assets/stylesheets/bootstrap/_popover.scss +140 -0
- data/assets/stylesheets/bootstrap/_print.scss +88 -0
- data/assets/stylesheets/bootstrap/_progress.scss +156 -0
- data/assets/stylesheets/bootstrap/_reboot.scss +298 -0
- data/assets/stylesheets/bootstrap/_responsive-embed.scss +38 -0
- data/assets/stylesheets/bootstrap/_tables.scss +193 -0
- data/assets/stylesheets/bootstrap/_tooltip.scss +85 -0
- data/assets/stylesheets/bootstrap/_type.scss +192 -0
- data/assets/stylesheets/bootstrap/_utilities-responsive.scss +49 -0
- data/assets/stylesheets/bootstrap/_utilities-spacing.scss +78 -0
- data/assets/stylesheets/bootstrap/_utilities.scss +117 -0
- data/assets/stylesheets/bootstrap/_variables.scss +632 -0
- data/assets/stylesheets/bootstrap/mixins/_alert.scss +14 -0
- data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +13 -0
- data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +35 -0
- data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +76 -0
- data/assets/stylesheets/bootstrap/mixins/_buttons.scss +100 -0
- data/assets/stylesheets/bootstrap/mixins/_center-block.scss +7 -0
- data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +7 -0
- data/assets/stylesheets/bootstrap/mixins/_forms.scss +89 -0
- data/assets/stylesheets/bootstrap/mixins/_gradients.scss +43 -0
- data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +44 -0
- data/assets/stylesheets/bootstrap/mixins/_grid.scss +75 -0
- data/assets/stylesheets/bootstrap/mixins/_hover.scss +59 -0
- data/assets/stylesheets/bootstrap/mixins/_image.scss +33 -0
- data/assets/stylesheets/bootstrap/mixins/_label.scss +11 -0
- data/assets/stylesheets/bootstrap/mixins/_list-group.scss +30 -0
- data/assets/stylesheets/bootstrap/mixins/_lists.scss +7 -0
- data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +10 -0
- data/assets/stylesheets/bootstrap/mixins/_navbar-align.scss +9 -0
- data/assets/stylesheets/bootstrap/mixins/_pagination.scss +24 -0
- data/assets/stylesheets/bootstrap/mixins/_progress.scss +18 -0
- data/assets/stylesheets/bootstrap/mixins/_pulls.scss +6 -0
- data/assets/stylesheets/bootstrap/mixins/_reset-filter.scss +8 -0
- data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +18 -0
- data/assets/stylesheets/bootstrap/mixins/_resize.scss +6 -0
- data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +32 -0
- data/assets/stylesheets/bootstrap/mixins/_size.scss +6 -0
- data/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +9 -0
- data/assets/stylesheets/bootstrap/mixins/_table-row.scss +30 -0
- data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +12 -0
- data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +8 -0
- data/assets/stylesheets/bootstrap/mixins/_text-truncate.scss +8 -0
- data/bootstrap.gemspec +36 -0
- data/lib/bootstrap.rb +76 -0
- data/lib/bootstrap/engine.rb +11 -0
- data/lib/bootstrap/version.rb +4 -0
- data/tasks/updater.rb +67 -0
- data/tasks/updater/js.rb +37 -0
- data/tasks/updater/logger.rb +57 -0
- data/tasks/updater/network.rb +101 -0
- data/tasks/updater/scss.rb +34 -0
- data/templates/project/_bootstrap-variables.scss +633 -0
- data/templates/project/manifest.rb +18 -0
- data/templates/project/styles.scss +10 -0
- data/test/compass_test.rb +9 -0
- data/test/dummy_rails/README.rdoc +3 -0
- data/test/dummy_rails/Rakefile +6 -0
- data/test/dummy_rails/app/assets/images/.keep +0 -0
- data/test/dummy_rails/app/assets/javascripts/application.js +7 -0
- data/test/dummy_rails/app/assets/stylesheets/application.sass +1 -0
- data/test/dummy_rails/app/controllers/application_controller.rb +5 -0
- data/test/dummy_rails/app/controllers/pages_controller.rb +4 -0
- data/test/dummy_rails/app/helpers/application_helper.rb +2 -0
- data/test/dummy_rails/app/views/layouts/application.html.erb +14 -0
- data/test/dummy_rails/app/views/pages/root.html.slim +58 -0
- data/test/dummy_rails/config.ru +4 -0
- data/test/dummy_rails/config/application.rb +34 -0
- data/test/dummy_rails/config/boot.rb +5 -0
- data/test/dummy_rails/config/environment.rb +5 -0
- data/test/dummy_rails/config/environments/development.rb +23 -0
- data/test/dummy_rails/config/environments/production.rb +82 -0
- data/test/dummy_rails/config/environments/test.rb +38 -0
- data/test/dummy_rails/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy_rails/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy_rails/config/initializers/inflections.rb +16 -0
- data/test/dummy_rails/config/initializers/mime_types.rb +5 -0
- data/test/dummy_rails/config/initializers/secret_token.rb +18 -0
- data/test/dummy_rails/config/initializers/session_store.rb +3 -0
- data/test/dummy_rails/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy_rails/config/locales/en.yml +3 -0
- data/test/dummy_rails/config/locales/es.yml +3 -0
- data/test/dummy_rails/config/routes.rb +3 -0
- data/test/dummy_rails/log/.keep +0 -0
- data/test/gemfiles/rails_4_2.gemfile +11 -0
- data/test/gemfiles/rails_head.gemfile +19 -0
- data/test/rails_test.rb +19 -0
- data/test/support/dummy_rails_integration.rb +22 -0
- data/test/support/reporting.rb +27 -0
- data/test/test_helper.rb +35 -0
- data/test/test_helper_rails.rb +6 -0
- metadata +433 -0
@@ -0,0 +1,191 @@
|
|
1
|
+
// The dropdown wrapper (div)
|
2
|
+
.dropup,
|
3
|
+
.dropdown {
|
4
|
+
position: relative;
|
5
|
+
}
|
6
|
+
|
7
|
+
.dropdown-toggle {
|
8
|
+
// Generate the caret automatically
|
9
|
+
&::after {
|
10
|
+
display: inline-block;
|
11
|
+
width: 0;
|
12
|
+
height: 0;
|
13
|
+
margin-left: .25rem;
|
14
|
+
vertical-align: middle;
|
15
|
+
content: "";
|
16
|
+
border-top: $caret-width solid;
|
17
|
+
border-right: $caret-width solid transparent;
|
18
|
+
border-left: $caret-width solid transparent;
|
19
|
+
}
|
20
|
+
|
21
|
+
// Prevent the focus on the dropdown toggle when closing dropdowns
|
22
|
+
&:focus {
|
23
|
+
outline: 0;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
.dropup {
|
28
|
+
.dropdown-toggle {
|
29
|
+
&::after {
|
30
|
+
border-top: 0;
|
31
|
+
border-bottom: $caret-width solid;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
// The dropdown menu (ul)
|
37
|
+
.dropdown-menu {
|
38
|
+
position: absolute;
|
39
|
+
top: 100%;
|
40
|
+
left: 0;
|
41
|
+
z-index: $zindex-dropdown;
|
42
|
+
display: none; // none by default, but block on "open" of the menu
|
43
|
+
float: left;
|
44
|
+
min-width: 160px;
|
45
|
+
padding: 5px 0;
|
46
|
+
margin: 2px 0 0; // override default ul
|
47
|
+
font-size: $font-size-base;
|
48
|
+
text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)
|
49
|
+
list-style: none;
|
50
|
+
background-color: $dropdown-bg;
|
51
|
+
background-clip: padding-box;
|
52
|
+
border: 1px solid $dropdown-border;
|
53
|
+
@include border-radius($border-radius);
|
54
|
+
@include box-shadow(0 6px 12px rgba(0,0,0,.175));
|
55
|
+
}
|
56
|
+
|
57
|
+
// Dividers (basically an hr) within the dropdown
|
58
|
+
.dropdown-divider {
|
59
|
+
@include nav-divider($dropdown-divider-bg);
|
60
|
+
}
|
61
|
+
|
62
|
+
// Links, buttons, and more within the dropdown menu
|
63
|
+
//
|
64
|
+
// `<button>`-specific styles are denoted with `// for <button>s`
|
65
|
+
.dropdown-item {
|
66
|
+
display: block;
|
67
|
+
width: 100%; // For `<button>`s
|
68
|
+
padding: 3px 20px;
|
69
|
+
clear: both;
|
70
|
+
font-weight: normal;
|
71
|
+
line-height: $line-height;
|
72
|
+
color: $dropdown-link-color;
|
73
|
+
text-align: inherit; // For `<button>`s
|
74
|
+
white-space: nowrap; // prevent links from randomly breaking onto new lines
|
75
|
+
background: none; // For `<button>`s
|
76
|
+
border: 0; // For `<button>`s
|
77
|
+
|
78
|
+
@include hover-focus {
|
79
|
+
color: $dropdown-link-hover-color;
|
80
|
+
text-decoration: none;
|
81
|
+
background-color: $dropdown-link-hover-bg;
|
82
|
+
}
|
83
|
+
|
84
|
+
// Active state
|
85
|
+
&.active {
|
86
|
+
@include plain-hover-focus {
|
87
|
+
color: $dropdown-link-active-color;
|
88
|
+
text-decoration: none;
|
89
|
+
background-color: $dropdown-link-active-bg;
|
90
|
+
outline: 0;
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
// Disabled state
|
95
|
+
//
|
96
|
+
// Gray out text and ensure the hover/focus state remains gray
|
97
|
+
&.disabled {
|
98
|
+
@include plain-hover-focus {
|
99
|
+
color: $dropdown-link-disabled-color;
|
100
|
+
}
|
101
|
+
|
102
|
+
// Nuke hover/focus effects
|
103
|
+
@include hover-focus {
|
104
|
+
text-decoration: none;
|
105
|
+
cursor: $cursor-disabled;
|
106
|
+
background-color: transparent;
|
107
|
+
background-image: none; // Remove CSS gradient
|
108
|
+
@include reset-filter();
|
109
|
+
}
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
// Open state for the dropdown
|
114
|
+
.open {
|
115
|
+
// Show the menu
|
116
|
+
> .dropdown-menu {
|
117
|
+
display: block;
|
118
|
+
}
|
119
|
+
|
120
|
+
// Remove the outline when :focus is triggered
|
121
|
+
> a {
|
122
|
+
outline: 0;
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
// Menu positioning
|
127
|
+
//
|
128
|
+
// Add extra class to `.dropdown-menu` to flip the alignment of the dropdown
|
129
|
+
// menu with the parent.
|
130
|
+
.dropdown-menu-right {
|
131
|
+
right: 0;
|
132
|
+
left: auto; // Reset the default from `.dropdown-menu`
|
133
|
+
}
|
134
|
+
// With v3, we enabled auto-flipping if you have a dropdown within a right
|
135
|
+
// aligned nav component. To enable the undoing of that, we provide an override
|
136
|
+
// to restore the default dropdown menu alignment.
|
137
|
+
//
|
138
|
+
// This is only for left-aligning a dropdown menu within a `.navbar-right` or
|
139
|
+
// `.pull-right` nav component.
|
140
|
+
.dropdown-menu-left {
|
141
|
+
right: auto;
|
142
|
+
left: 0;
|
143
|
+
}
|
144
|
+
|
145
|
+
// Dropdown section headers
|
146
|
+
.dropdown-header {
|
147
|
+
display: block;
|
148
|
+
padding: 3px 20px;
|
149
|
+
font-size: $font-size-sm;
|
150
|
+
line-height: $line-height;
|
151
|
+
color: $dropdown-header-color;
|
152
|
+
white-space: nowrap; // as with > li > a
|
153
|
+
}
|
154
|
+
|
155
|
+
// Backdrop to catch body clicks on mobile, etc.
|
156
|
+
.dropdown-backdrop {
|
157
|
+
position: fixed;
|
158
|
+
top: 0;
|
159
|
+
right: 0;
|
160
|
+
bottom: 0;
|
161
|
+
left: 0;
|
162
|
+
z-index: ($zindex-dropdown - 10);
|
163
|
+
}
|
164
|
+
|
165
|
+
// Right aligned dropdowns
|
166
|
+
.pull-right > .dropdown-menu {
|
167
|
+
right: 0;
|
168
|
+
left: auto;
|
169
|
+
}
|
170
|
+
|
171
|
+
// Allow for dropdowns to go bottom up (aka, dropup-menu)
|
172
|
+
//
|
173
|
+
// Just add .dropup after the standard .dropdown class and you're set, bro.
|
174
|
+
// TODO: abstract this so that the navbar fixed styles are not placed here?
|
175
|
+
|
176
|
+
.dropup,
|
177
|
+
.navbar-fixed-bottom .dropdown {
|
178
|
+
// Reverse the caret
|
179
|
+
.caret {
|
180
|
+
content: "";
|
181
|
+
border-top: 0;
|
182
|
+
border-bottom: $caret-width solid;
|
183
|
+
}
|
184
|
+
|
185
|
+
// Different positioning for bottom up menu
|
186
|
+
.dropdown-menu {
|
187
|
+
top: auto;
|
188
|
+
bottom: 100%;
|
189
|
+
margin-bottom: 2px;
|
190
|
+
}
|
191
|
+
}
|
@@ -0,0 +1,454 @@
|
|
1
|
+
//
|
2
|
+
// Textual form controls
|
3
|
+
//
|
4
|
+
|
5
|
+
.form-control {
|
6
|
+
display: block;
|
7
|
+
width: 100%;
|
8
|
+
// // Make inputs at least the height of their button counterpart (base line-height + padding + border)
|
9
|
+
// height: $input-height;
|
10
|
+
padding: $input-padding-y $input-padding-x;
|
11
|
+
font-size: $font-size-base;
|
12
|
+
line-height: $line-height;
|
13
|
+
color: $input-color;
|
14
|
+
background-color: $input-bg;
|
15
|
+
// Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214.
|
16
|
+
background-image: none;
|
17
|
+
border: $border-width solid $input-border;
|
18
|
+
// Note: This has no effect on <select>s in some browsers, due to the limited stylability of `<select>`s in CSS.
|
19
|
+
@include border-radius($input-border-radius);
|
20
|
+
@include box-shadow($input-box-shadow);
|
21
|
+
@include transition(border-color ease-in-out .15s, box-shadow ease-in-out .15s);
|
22
|
+
|
23
|
+
// Make inputs at least the height of their button counterpart (base line-height + padding + border).
|
24
|
+
// Only apply the height to textual inputs and some selects.
|
25
|
+
// &:not(textarea),
|
26
|
+
// &:not(select[size]),
|
27
|
+
// &:not(select[multiple]) {
|
28
|
+
// height: $input-height;
|
29
|
+
// }
|
30
|
+
|
31
|
+
// Unstyle the caret on `<select>`s in IE10+.
|
32
|
+
&::-ms-expand {
|
33
|
+
background-color: transparent;
|
34
|
+
border: 0;
|
35
|
+
}
|
36
|
+
|
37
|
+
// Customize the `:focus` state to imitate native WebKit styles.
|
38
|
+
@include form-control-focus();
|
39
|
+
|
40
|
+
// Placeholder
|
41
|
+
&::placeholder {
|
42
|
+
color: $input-color-placeholder;
|
43
|
+
// Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526.
|
44
|
+
opacity: 1;
|
45
|
+
}
|
46
|
+
|
47
|
+
// Disabled and read-only inputs
|
48
|
+
//
|
49
|
+
// HTML5 says that controls under a fieldset > legend:first-child won't be
|
50
|
+
// disabled if the fieldset is disabled. Due to implementation difficulty, we
|
51
|
+
// don't honor that edge case; we style them as disabled anyway.
|
52
|
+
&:disabled,
|
53
|
+
&[readonly] {
|
54
|
+
background-color: $input-bg-disabled;
|
55
|
+
// iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
|
56
|
+
opacity: 1;
|
57
|
+
}
|
58
|
+
|
59
|
+
&:disabled {
|
60
|
+
cursor: $cursor-disabled;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
|
65
|
+
// Make file inputs better match text inputs by forcing them to new lines.
|
66
|
+
.form-control-file,
|
67
|
+
.form-control-range {
|
68
|
+
display: block;
|
69
|
+
}
|
70
|
+
|
71
|
+
|
72
|
+
//
|
73
|
+
// Labels
|
74
|
+
//
|
75
|
+
|
76
|
+
// For use with horizontal and inline forms, when you need the label text to
|
77
|
+
// align with the form controls.
|
78
|
+
.form-control-label {
|
79
|
+
padding: $input-padding-y $input-padding-x;
|
80
|
+
margin-bottom: 0; // Override the `<label>` default
|
81
|
+
}
|
82
|
+
|
83
|
+
|
84
|
+
// Todo: clear this up
|
85
|
+
|
86
|
+
// Special styles for iOS temporal inputs
|
87
|
+
//
|
88
|
+
// In Mobile Safari, setting `display: block` on temporal inputs causes the
|
89
|
+
// text within the input to become vertically misaligned. As a workaround, we
|
90
|
+
// set a pixel line-height that matches the given height of the input, but only
|
91
|
+
// for Safari. See https://bugs.webkit.org/show_bug.cgi?id=139848
|
92
|
+
//
|
93
|
+
// Note that as of 8.3, iOS doesn't support `datetime` or `week`.
|
94
|
+
|
95
|
+
@media screen and (-webkit-min-device-pixel-ratio: 0) {
|
96
|
+
input[type="date"],
|
97
|
+
input[type="time"],
|
98
|
+
input[type="datetime-local"],
|
99
|
+
input[type="month"] {
|
100
|
+
&.form-control {
|
101
|
+
line-height: $input-height;
|
102
|
+
}
|
103
|
+
|
104
|
+
&.input-sm,
|
105
|
+
.input-group-sm &.form-control {
|
106
|
+
line-height: $input-height-sm;
|
107
|
+
}
|
108
|
+
|
109
|
+
&.input-lg,
|
110
|
+
.input-group-lg &.form-control {
|
111
|
+
line-height: $input-height-lg;
|
112
|
+
}
|
113
|
+
}
|
114
|
+
}
|
115
|
+
|
116
|
+
|
117
|
+
// Static form control text
|
118
|
+
//
|
119
|
+
// Apply class to an element to make any string of text align with labels in a
|
120
|
+
// horizontal form layout.
|
121
|
+
|
122
|
+
.form-control-static {
|
123
|
+
min-height: $input-height;
|
124
|
+
// Size it appropriately next to real form controls
|
125
|
+
padding-top: $input-padding-y;
|
126
|
+
padding-bottom: $input-padding-y;
|
127
|
+
// Remove default margin from `p`
|
128
|
+
margin-bottom: 0;
|
129
|
+
|
130
|
+
&.form-control-sm,
|
131
|
+
&.form-control-lg {
|
132
|
+
padding-right: 0;
|
133
|
+
padding-left: 0;
|
134
|
+
}
|
135
|
+
}
|
136
|
+
|
137
|
+
|
138
|
+
// Form control sizing
|
139
|
+
//
|
140
|
+
// Build on `.form-control` with modifier classes to decrease or increase the
|
141
|
+
// height and font-size of form controls.
|
142
|
+
//
|
143
|
+
// The `.form-group-* form-control` variations are sadly duplicated to avoid the
|
144
|
+
// issue documented in https://github.com/twbs/bootstrap/issues/15074.
|
145
|
+
|
146
|
+
.form-control-sm {
|
147
|
+
// height: $input-height-sm;
|
148
|
+
padding: $input-padding-y-sm $input-padding-x-sm;
|
149
|
+
font-size: $font-size-sm;
|
150
|
+
line-height: $line-height-sm;
|
151
|
+
@include border-radius($input-border-radius-sm);
|
152
|
+
}
|
153
|
+
|
154
|
+
.form-control-lg {
|
155
|
+
// height: $input-height-lg;
|
156
|
+
padding: $input-padding-y-lg $input-padding-x-lg;
|
157
|
+
font-size: $font-size-lg;
|
158
|
+
line-height: $line-height-lg;
|
159
|
+
@include border-radius($input-border-radius-lg);
|
160
|
+
}
|
161
|
+
|
162
|
+
|
163
|
+
// Form groups
|
164
|
+
//
|
165
|
+
// Designed to help with the organization and spacing of vertical forms. For
|
166
|
+
// horizontal forms, use the predefined grid classes.
|
167
|
+
|
168
|
+
.form-group {
|
169
|
+
margin-bottom: $form-group-margin-bottom;
|
170
|
+
}
|
171
|
+
|
172
|
+
|
173
|
+
// Checkboxes and radios
|
174
|
+
//
|
175
|
+
// Indent the labels to position radios/checkboxes as hanging controls.
|
176
|
+
|
177
|
+
.radio,
|
178
|
+
.checkbox {
|
179
|
+
position: relative;
|
180
|
+
display: block;
|
181
|
+
// margin-top: ($spacer * .75);
|
182
|
+
margin-bottom: ($spacer * .75);
|
183
|
+
|
184
|
+
label {
|
185
|
+
padding-left: 1.25rem;
|
186
|
+
margin-bottom: 0;
|
187
|
+
font-weight: normal;
|
188
|
+
cursor: pointer;
|
189
|
+
|
190
|
+
// When there's no labels, don't position the input.
|
191
|
+
input:only-child {
|
192
|
+
position: static;
|
193
|
+
}
|
194
|
+
}
|
195
|
+
}
|
196
|
+
.radio input[type="radio"],
|
197
|
+
.radio-inline input[type="radio"],
|
198
|
+
.checkbox input[type="checkbox"],
|
199
|
+
.checkbox-inline input[type="checkbox"] {
|
200
|
+
position: absolute;
|
201
|
+
margin-top: .25rem;
|
202
|
+
// margin-top: 4px \9;
|
203
|
+
margin-left: -1.25rem;
|
204
|
+
}
|
205
|
+
|
206
|
+
.radio + .radio,
|
207
|
+
.checkbox + .checkbox {
|
208
|
+
// Move up sibling radios or checkboxes for tighter spacing
|
209
|
+
margin-top: -.25rem;
|
210
|
+
}
|
211
|
+
|
212
|
+
// Radios and checkboxes on same line
|
213
|
+
.radio-inline,
|
214
|
+
.checkbox-inline {
|
215
|
+
position: relative;
|
216
|
+
display: inline-block;
|
217
|
+
padding-left: 1.25rem;
|
218
|
+
margin-bottom: 0;
|
219
|
+
font-weight: normal;
|
220
|
+
vertical-align: middle;
|
221
|
+
cursor: pointer;
|
222
|
+
}
|
223
|
+
.radio-inline + .radio-inline,
|
224
|
+
.checkbox-inline + .checkbox-inline {
|
225
|
+
margin-top: 0;
|
226
|
+
margin-left: .75rem;
|
227
|
+
}
|
228
|
+
|
229
|
+
// Apply same disabled cursor tweak as for inputs
|
230
|
+
// Some special care is needed because <label>s don't inherit their parent's `cursor`.
|
231
|
+
//
|
232
|
+
// Note: Neither radios nor checkboxes can be readonly.
|
233
|
+
input[type="radio"],
|
234
|
+
input[type="checkbox"] {
|
235
|
+
&:disabled,
|
236
|
+
&.disabled {
|
237
|
+
cursor: $cursor-disabled;
|
238
|
+
}
|
239
|
+
}
|
240
|
+
// These classes are used directly on <label>s
|
241
|
+
.radio-inline,
|
242
|
+
.checkbox-inline {
|
243
|
+
&.disabled {
|
244
|
+
cursor: $cursor-disabled;
|
245
|
+
}
|
246
|
+
}
|
247
|
+
// These classes are used on elements with <label> descendants
|
248
|
+
.radio,
|
249
|
+
.checkbox {
|
250
|
+
&.disabled {
|
251
|
+
label {
|
252
|
+
cursor: $cursor-disabled;
|
253
|
+
}
|
254
|
+
}
|
255
|
+
}
|
256
|
+
|
257
|
+
|
258
|
+
// Form control feedback states
|
259
|
+
//
|
260
|
+
// Apply contextual and semantic states to individual form controls.
|
261
|
+
|
262
|
+
.form-control-success,
|
263
|
+
.form-control-warning,
|
264
|
+
.form-control-error {
|
265
|
+
padding-right: ($input-padding-x * 3);
|
266
|
+
background-repeat: no-repeat;
|
267
|
+
background-position: center right ($input-height * .25);
|
268
|
+
background-size: ($input-height * .65) ($input-height * .65);
|
269
|
+
}
|
270
|
+
|
271
|
+
// Form validation states
|
272
|
+
.has-success {
|
273
|
+
@include form-control-validation($brand-success);
|
274
|
+
|
275
|
+
.form-control-success {
|
276
|
+
background-image: url($form-icon-success);
|
277
|
+
}
|
278
|
+
}
|
279
|
+
|
280
|
+
.has-warning {
|
281
|
+
@include form-control-validation($brand-warning);
|
282
|
+
|
283
|
+
.form-control-warning {
|
284
|
+
background-image: url($form-icon-warning);
|
285
|
+
}
|
286
|
+
}
|
287
|
+
|
288
|
+
.has-error {
|
289
|
+
@include form-control-validation($brand-danger);
|
290
|
+
|
291
|
+
.form-control-error {
|
292
|
+
background-image: url($form-icon-error);
|
293
|
+
}
|
294
|
+
}
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
// .form-control-success {
|
300
|
+
// background-image: url("#{$form-icon-success}");
|
301
|
+
// border-color: $brand-success;
|
302
|
+
// }
|
303
|
+
//
|
304
|
+
// .form-control-warning {
|
305
|
+
// background-image: url("#{$form-icon-warning}");
|
306
|
+
// border-color: $brand-warning;
|
307
|
+
// }
|
308
|
+
//
|
309
|
+
// .form-control-error {
|
310
|
+
// background-image: url("#{$form-icon-danger}");
|
311
|
+
// border-color: $brand-danger;
|
312
|
+
// }
|
313
|
+
|
314
|
+
|
315
|
+
// .has-feedback {
|
316
|
+
// // Enable absolute positioning
|
317
|
+
// position: relative;
|
318
|
+
//
|
319
|
+
// // Ensure icons don't overlap text
|
320
|
+
// .form-control {
|
321
|
+
// padding-right: ($input-height * 1.25);
|
322
|
+
// }
|
323
|
+
// }
|
324
|
+
// // Feedback icon
|
325
|
+
// .form-control-feedback {
|
326
|
+
// position: absolute;
|
327
|
+
// top: 0;
|
328
|
+
// right: 0;
|
329
|
+
// z-index: 2; // Ensure icon is above input groups
|
330
|
+
// display: block;
|
331
|
+
// width: $input-height;
|
332
|
+
// height: $input-height;
|
333
|
+
// line-height: $input-height;
|
334
|
+
// text-align: center;
|
335
|
+
// pointer-events: none;
|
336
|
+
// }
|
337
|
+
// .input-lg + .form-control-feedback,
|
338
|
+
// .input-group-lg + .form-control-feedback {
|
339
|
+
// width: $input-height-lg;
|
340
|
+
// height: $input-height-lg;
|
341
|
+
// line-height: $input-height-lg;
|
342
|
+
// }
|
343
|
+
// .input-sm + .form-control-feedback,
|
344
|
+
// .input-group-sm + .form-control-feedback {
|
345
|
+
// width: $input-height-sm;
|
346
|
+
// height: $input-height-sm;
|
347
|
+
// line-height: $input-height-sm;
|
348
|
+
// }
|
349
|
+
//
|
350
|
+
// // Form validation states
|
351
|
+
// .has-success {
|
352
|
+
// @include form-control-validation($state-success-text, $state-success-text, $state-success-bg);
|
353
|
+
// }
|
354
|
+
// .has-warning {
|
355
|
+
// @include form-control-validation($state-warning-text, $state-warning-text, $state-warning-bg);
|
356
|
+
// }
|
357
|
+
// .has-error {
|
358
|
+
// @include form-control-validation($state-danger-text, $state-danger-text, $state-danger-bg);
|
359
|
+
// }
|
360
|
+
//
|
361
|
+
// // Reposition feedback icon if input has visible label above
|
362
|
+
// .has-feedback label {
|
363
|
+
//
|
364
|
+
// ~ .form-control-feedback {
|
365
|
+
// // TODO: redo this since we nuked the `$line-height-computed`
|
366
|
+
// top: 0; // Height of the `label` and its margin
|
367
|
+
// }
|
368
|
+
//
|
369
|
+
// &.sr-only ~ .form-control-feedback {
|
370
|
+
// top: 0;
|
371
|
+
// }
|
372
|
+
// }
|
373
|
+
|
374
|
+
|
375
|
+
// Inline forms
|
376
|
+
//
|
377
|
+
// Make forms appear inline(-block) by adding the `.form-inline` class. Inline
|
378
|
+
// forms begin stacked on extra small (mobile) devices and then go inline when
|
379
|
+
// viewports reach <768px.
|
380
|
+
//
|
381
|
+
// Requires wrapping inputs and labels with `.form-group` for proper display of
|
382
|
+
// default HTML form controls and our custom form controls (e.g., input groups).
|
383
|
+
//
|
384
|
+
// Heads up! This is mixin-ed into `.navbar-form` in _navbar.scss.
|
385
|
+
|
386
|
+
.form-inline {
|
387
|
+
|
388
|
+
// Kick in the inline
|
389
|
+
@include media-breakpoint-up(sm) {
|
390
|
+
// Inline-block all the things for "inline"
|
391
|
+
.form-group {
|
392
|
+
display: inline-block;
|
393
|
+
margin-bottom: 0;
|
394
|
+
vertical-align: middle;
|
395
|
+
}
|
396
|
+
|
397
|
+
// In navbar-form, allow folks to *not* use `.form-group`
|
398
|
+
.form-control {
|
399
|
+
display: inline-block;
|
400
|
+
width: auto; // Prevent labels from stacking above inputs in `.form-group`
|
401
|
+
vertical-align: middle;
|
402
|
+
}
|
403
|
+
|
404
|
+
// Make static controls behave like regular ones
|
405
|
+
.form-control-static {
|
406
|
+
display: inline-block;
|
407
|
+
}
|
408
|
+
|
409
|
+
.input-group {
|
410
|
+
display: inline-table;
|
411
|
+
vertical-align: middle;
|
412
|
+
|
413
|
+
.input-group-addon,
|
414
|
+
.input-group-btn,
|
415
|
+
.form-control {
|
416
|
+
width: auto;
|
417
|
+
}
|
418
|
+
}
|
419
|
+
|
420
|
+
// Input groups need that 100% width though
|
421
|
+
.input-group > .form-control {
|
422
|
+
width: 100%;
|
423
|
+
}
|
424
|
+
|
425
|
+
.form-control-label {
|
426
|
+
margin-bottom: 0;
|
427
|
+
vertical-align: middle;
|
428
|
+
}
|
429
|
+
|
430
|
+
// Remove default margin on radios/checkboxes that were used for stacking, and
|
431
|
+
// then undo the floating of radios and checkboxes to match.
|
432
|
+
.radio,
|
433
|
+
.checkbox {
|
434
|
+
display: inline-block;
|
435
|
+
margin-top: 0;
|
436
|
+
margin-bottom: 0;
|
437
|
+
vertical-align: middle;
|
438
|
+
|
439
|
+
label {
|
440
|
+
padding-left: 0;
|
441
|
+
}
|
442
|
+
}
|
443
|
+
.radio input[type="radio"],
|
444
|
+
.checkbox input[type="checkbox"] {
|
445
|
+
position: relative;
|
446
|
+
margin-left: 0;
|
447
|
+
}
|
448
|
+
|
449
|
+
// Re-override the feedback icon.
|
450
|
+
.has-feedback .form-control-feedback {
|
451
|
+
top: 0;
|
452
|
+
}
|
453
|
+
}
|
454
|
+
}
|