bootstrap 4.0.0.alpha5 → 4.0.0.alpha6

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.

Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -4
  3. data/assets/javascripts/bootstrap.js +312 -207
  4. data/assets/javascripts/bootstrap.min.js +4 -4
  5. data/assets/javascripts/bootstrap/alert.js +9 -5
  6. data/assets/javascripts/bootstrap/button.js +5 -5
  7. data/assets/javascripts/bootstrap/carousel.js +52 -28
  8. data/assets/javascripts/bootstrap/collapse.js +19 -11
  9. data/assets/javascripts/bootstrap/dropdown.js +21 -19
  10. data/assets/javascripts/bootstrap/modal.js +69 -43
  11. data/assets/javascripts/bootstrap/popover.js +4 -4
  12. data/assets/javascripts/bootstrap/scrollspy.js +20 -11
  13. data/assets/javascripts/bootstrap/tab.js +19 -14
  14. data/assets/javascripts/bootstrap/tooltip.js +54 -22
  15. data/assets/javascripts/bootstrap/util.js +7 -12
  16. data/assets/stylesheets/_bootstrap-grid.scss +23 -3
  17. data/assets/stylesheets/_bootstrap-reboot.scss +2 -3
  18. data/assets/stylesheets/_bootstrap.scss +6 -6
  19. data/assets/stylesheets/bootstrap/_alert.scss +3 -4
  20. data/assets/stylesheets/bootstrap/_badge.scss +77 -0
  21. data/assets/stylesheets/bootstrap/_button-group.scss +18 -51
  22. data/assets/stylesheets/bootstrap/_buttons.scss +14 -20
  23. data/assets/stylesheets/bootstrap/_card.scss +30 -76
  24. data/assets/stylesheets/bootstrap/_carousel.scss +96 -171
  25. data/assets/stylesheets/bootstrap/_close.scss +3 -3
  26. data/assets/stylesheets/bootstrap/_code.scss +7 -0
  27. data/assets/stylesheets/bootstrap/_custom-forms.scss +13 -12
  28. data/assets/stylesheets/bootstrap/_dropdown.scss +17 -36
  29. data/assets/stylesheets/bootstrap/_forms.scss +61 -47
  30. data/assets/stylesheets/bootstrap/_grid.scss +13 -0
  31. data/assets/stylesheets/bootstrap/_images.scss +2 -2
  32. data/assets/stylesheets/bootstrap/_input-group.scss +17 -27
  33. data/assets/stylesheets/bootstrap/_list-group.scss +79 -63
  34. data/assets/stylesheets/bootstrap/_media.scss +5 -78
  35. data/assets/stylesheets/bootstrap/_mixins.scss +8 -5
  36. data/assets/stylesheets/bootstrap/_modal.scss +21 -13
  37. data/assets/stylesheets/bootstrap/_nav.scss +30 -68
  38. data/assets/stylesheets/bootstrap/_navbar.scss +131 -178
  39. data/assets/stylesheets/bootstrap/_normalize.scss +133 -94
  40. data/assets/stylesheets/bootstrap/_pagination.scss +16 -22
  41. data/assets/stylesheets/bootstrap/_popover.scss +3 -3
  42. data/assets/stylesheets/bootstrap/_print.scss +5 -8
  43. data/assets/stylesheets/bootstrap/_progress.scss +14 -127
  44. data/assets/stylesheets/bootstrap/_reboot.scss +16 -15
  45. data/assets/stylesheets/bootstrap/_responsive-embed.scss +18 -5
  46. data/assets/stylesheets/bootstrap/_tables.scss +13 -56
  47. data/assets/stylesheets/bootstrap/_tooltip.scss +1 -1
  48. data/assets/stylesheets/bootstrap/{_animation.scss → _transitions.scss} +6 -8
  49. data/assets/stylesheets/bootstrap/_type.scss +5 -12
  50. data/assets/stylesheets/bootstrap/_utilities.scss +2 -0
  51. data/assets/stylesheets/bootstrap/_variables.scss +320 -216
  52. data/assets/stylesheets/bootstrap/mixins/{_tag.scss → _badge.scss} +2 -2
  53. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +25 -16
  54. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +31 -58
  55. data/assets/stylesheets/bootstrap/mixins/_cards.scss +3 -0
  56. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +1 -1
  57. data/assets/stylesheets/bootstrap/mixins/_float.scss +3 -0
  58. data/assets/stylesheets/bootstrap/mixins/_forms.scss +3 -5
  59. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +1 -7
  60. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +19 -23
  61. data/assets/stylesheets/bootstrap/mixins/_grid.scss +19 -26
  62. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +3 -5
  63. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +1 -1
  64. data/assets/stylesheets/bootstrap/mixins/_transforms.scss +14 -0
  65. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +5 -0
  66. data/assets/stylesheets/bootstrap/utilities/_align.scss +5 -5
  67. data/assets/stylesheets/bootstrap/utilities/_background.scss +1 -1
  68. data/assets/stylesheets/bootstrap/utilities/_borders.scss +10 -3
  69. data/assets/stylesheets/bootstrap/utilities/_display.scss +13 -8
  70. data/assets/stylesheets/bootstrap/utilities/_flex.scss +42 -31
  71. data/assets/stylesheets/bootstrap/utilities/_float.scss +5 -9
  72. data/assets/stylesheets/bootstrap/utilities/_position.scss +23 -0
  73. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +10 -0
  74. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +36 -37
  75. data/assets/stylesheets/bootstrap/utilities/_text.scss +14 -12
  76. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +1 -1
  77. data/lib/bootstrap/version.rb +2 -2
  78. data/tasks/updater/scss.rb +3 -5
  79. data/templates/project/_bootstrap-variables.scss +321 -217
  80. metadata +10 -10
  81. data/assets/stylesheets/_bootstrap-flex.scss +0 -8
  82. data/assets/stylesheets/bootstrap/_tags.scss +0 -77
  83. data/assets/stylesheets/bootstrap/mixins/_progress.scss +0 -23
  84. data/assets/stylesheets/bootstrap/mixins/_reset-filter.scss +0 -8
  85. data/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +0 -9
@@ -16,7 +16,7 @@
16
16
  background-color: $thumbnail-bg;
17
17
  border: $thumbnail-border-width solid $thumbnail-border-color;
18
18
  @include border-radius($thumbnail-border-radius);
19
- transition: all .2s ease-in-out;
19
+ @include transition($thumbnail-transition);
20
20
  @include box-shadow($thumbnail-box-shadow);
21
21
 
22
22
  // Keep them at most 100% wide
@@ -39,5 +39,5 @@
39
39
 
40
40
  .figure-caption {
41
41
  font-size: $figure-caption-font-size;
42
- color: $gray-light;
42
+ color: $figure-caption-color;
43
43
  }
@@ -4,45 +4,34 @@
4
4
 
5
5
  .input-group {
6
6
  position: relative;
7
+ display: flex;
7
8
  width: 100%;
8
9
 
9
- @if $enable-flex {
10
- display: flex;
11
- } @else {
12
- display: table;
13
- // Prevent input groups from inheriting border styles from table cells when
14
- // placed within a table.
15
- border-collapse: separate;
16
- }
17
-
18
10
  .form-control {
19
11
  // Ensure that the input is always above the *appended* addon button for
20
12
  // proper border colors.
21
13
  position: relative;
22
14
  z-index: 2;
15
+ flex: 1 1 auto;
16
+ // Add width 1% and flex-basis auto to ensure that button will not wrap out
17
+ // the column. Applies to IE Edge+ and Firefox. Chrome does not require this.
18
+ width: 1%;
19
+ margin-bottom: 0;
20
+
23
21
  // Bring the "active" form control to the front
24
22
  @include hover-focus-active {
25
23
  z-index: 3;
26
24
  }
27
- @if $enable-flex {
28
- flex: 1;
29
- } @else {
30
- // IE9 fubars the placeholder attribute in text inputs and the arrows on
31
- // select elements in input groups. To fix it, we float the input. Details:
32
- // https://github.com/twbs/bootstrap/issues/11561#issuecomment-28936855
33
- float: left;
34
- width: 100%;
35
- }
36
- margin-bottom: 0;
37
25
  }
38
26
  }
39
27
 
40
28
  .input-group-addon,
41
29
  .input-group-btn,
42
30
  .input-group .form-control {
43
- @if not $enable-flex {
44
- display: table-cell;
45
- }
31
+ // Vertically centers the content of the addons within the input group
32
+ display: flex;
33
+ flex-direction: column;
34
+ justify-content: center;
46
35
 
47
36
  &:not(:first-child):not(:last-child) {
48
37
  @include border-radius(0);
@@ -51,9 +40,6 @@
51
40
 
52
41
  .input-group-addon,
53
42
  .input-group-btn {
54
- @if not $enable-flex {
55
- width: 1%;
56
- }
57
43
  white-space: nowrap;
58
44
  vertical-align: middle; // Match the inputs
59
45
  }
@@ -83,8 +69,8 @@
83
69
  .input-group-addon {
84
70
  padding: $input-padding-y $input-padding-x;
85
71
  margin-bottom: 0; // Allow use of <label> elements by overriding our default margin-bottom
86
- font-size: $font-size-base;
87
- font-weight: normal;
72
+ font-size: $font-size-base; // Match inputs
73
+ font-weight: $font-weight-normal;
88
74
  line-height: $input-line-height;
89
75
  color: $input-color;
90
76
  text-align: center;
@@ -158,9 +144,13 @@
158
144
  // element above the siblings.
159
145
  > .btn {
160
146
  position: relative;
147
+ // Vertically stretch the button and center its content
148
+ flex: 1;
149
+
161
150
  + .btn {
162
151
  margin-left: (-$input-btn-border-width);
163
152
  }
153
+
164
154
  // Bring the "active" button to the front
165
155
  @include hover-focus-active {
166
156
  z-index: 3;
@@ -3,19 +3,52 @@
3
3
  // Easily usable on <ul>, <ol>, or <div>.
4
4
 
5
5
  .list-group {
6
+ display: flex;
7
+ flex-direction: column;
8
+
6
9
  // No need to set list-style: none; since .list-group-item is block level
7
10
  padding-left: 0; // reset padding because ul and ol
8
11
  margin-bottom: 0;
9
12
  }
10
13
 
11
14
 
15
+ // Interactive list items
16
+ //
17
+ // Use anchor or button elements instead of `li`s or `div`s to create interactive
18
+ // list items. Includes an extra `.active` modifier class for selected items.
19
+
20
+ .list-group-item-action {
21
+ width: 100%; // For `<button>`s (anchors become 100% by default though)
22
+ color: $list-group-link-color;
23
+ text-align: inherit; // For `<button>`s (anchors inherit)
24
+
25
+ .list-group-item-heading {
26
+ color: $list-group-link-heading-color;
27
+ }
28
+
29
+ // Hover state
30
+ @include hover-focus {
31
+ color: $list-group-link-hover-color;
32
+ text-decoration: none;
33
+ background-color: $list-group-hover-bg;
34
+ }
35
+
36
+ &:active {
37
+ color: $list-group-link-active-color;
38
+ background-color: $list-group-link-active-bg;
39
+ }
40
+ }
41
+
42
+
12
43
  // Individual list items
13
44
  //
14
45
  // Use on `li`s or `div`s within the `.list-group` parent.
15
46
 
16
47
  .list-group-item {
17
48
  position: relative;
18
- display: block;
49
+ display: flex;
50
+ flex-flow: row wrap;
51
+ align-items: center;
19
52
  padding: $list-group-item-padding-y $list-group-item-padding-x;
20
53
  // Place the border on the list items and negative margin up for better styling
21
54
  margin-bottom: -$list-group-border-width;
@@ -31,71 +64,68 @@
31
64
  @include border-bottom-radius($list-group-border-radius);
32
65
  }
33
66
 
34
- &.disabled {
35
- @include plain-hover-focus {
36
- color: $list-group-disabled-color;
37
- cursor: $cursor-disabled;
38
- background-color: $list-group-disabled-bg;
39
-
40
- // Force color to inherit for custom content
41
- .list-group-item-heading {
42
- color: inherit;
43
- }
44
- .list-group-item-text {
45
- color: $list-group-disabled-text-color;
46
- }
67
+ @include hover-focus {
68
+ text-decoration: none;
69
+ }
70
+
71
+ &.disabled,
72
+ &:disabled {
73
+ color: $list-group-disabled-color;
74
+ cursor: $cursor-disabled;
75
+ background-color: $list-group-disabled-bg;
76
+
77
+ // Force color to inherit for custom content
78
+ .list-group-item-heading {
79
+ color: inherit;
80
+ }
81
+ .list-group-item-text {
82
+ color: $list-group-disabled-text-color;
47
83
  }
48
84
  }
49
85
 
86
+ // Include both here for `<a>`s and `<button>`s
50
87
  &.active {
51
- @include plain-hover-focus {
52
- z-index: 2; // Place active items above their siblings for proper border styling
53
- color: $list-group-active-color;
54
- text-decoration: none; // Repeat here because it inherits global a:hover otherwise
55
- background-color: $list-group-active-bg;
56
- border-color: $list-group-active-border;
57
-
58
- // Force color to inherit for custom content
59
- .list-group-item-heading,
60
- .list-group-item-heading > small,
61
- .list-group-item-heading > .small {
62
- color: inherit;
63
- }
64
- .list-group-item-text {
65
- color: $list-group-active-text-color;
66
- }
88
+ z-index: 2; // Place active items above their siblings for proper border styling
89
+ color: $list-group-active-color;
90
+ background-color: $list-group-active-bg;
91
+ border-color: $list-group-active-border;
92
+
93
+ // Force color to inherit for custom content
94
+ .list-group-item-heading,
95
+ .list-group-item-heading > small,
96
+ .list-group-item-heading > .small {
97
+ color: inherit;
98
+ }
99
+
100
+ .list-group-item-text {
101
+ color: $list-group-active-text-color;
67
102
  }
68
103
  }
69
104
  }
70
105
 
106
+
107
+ // Flush list items
108
+ //
109
+ // Remove borders and border-radius to keep list group items edge-to-edge. Most
110
+ // useful within other components (e.g., cards).
111
+
71
112
  .list-group-flush {
72
113
  .list-group-item {
73
114
  border-right: 0;
74
115
  border-left: 0;
75
116
  border-radius: 0;
76
117
  }
77
- }
78
-
79
118
 
80
- // Interactive list items
81
- //
82
- // Use anchor or button elements instead of `li`s or `div`s to create interactive
83
- // list items. Includes an extra `.active` modifier class for selected items.
84
-
85
- .list-group-item-action {
86
- width: 100%; // For `<button>`s (anchors become 100% by default though)
87
- color: $list-group-link-color;
88
- text-align: inherit; // For `<button>`s (anchors inherit)
89
-
90
- .list-group-item-heading {
91
- color: $list-group-link-heading-color;
119
+ &:first-child {
120
+ .list-group-item:first-child {
121
+ border-top: 0;
122
+ }
92
123
  }
93
124
 
94
- // Hover state
95
- @include hover-focus {
96
- color: $list-group-link-hover-color;
97
- text-decoration: none;
98
- background-color: $list-group-hover-bg;
125
+ &:last-child {
126
+ .list-group-item:last-child {
127
+ border-bottom: 0;
128
+ }
99
129
  }
100
130
  }
101
131
 
@@ -109,17 +139,3 @@
109
139
  @include list-group-item-variant(info, $state-info-bg, $state-info-text);
110
140
  @include list-group-item-variant(warning, $state-warning-bg, $state-warning-text);
111
141
  @include list-group-item-variant(danger, $state-danger-bg, $state-danger-text);
112
-
113
-
114
- // Custom content options
115
- //
116
- // Extra classes for creating well-formatted content within `.list-group-item`s.
117
-
118
- .list-group-item-heading {
119
- margin-top: 0;
120
- margin-bottom: $list-group-item-heading-margin-bottom;
121
- }
122
- .list-group-item-text {
123
- margin-bottom: 0;
124
- line-height: 1.3;
125
- }
@@ -1,81 +1,8 @@
1
- @if $enable-flex {
2
- .media {
3
- display: flex;
4
- }
5
- .media-body {
6
- flex: 1;
7
- }
8
- .media-middle {
9
- align-self: center;
10
- }
11
- .media-bottom {
12
- align-self: flex-end;
13
- }
14
- } @else {
15
- .media,
16
- .media-body {
17
- overflow: hidden;
18
- }
19
- .media-body {
20
- width: 10000px;
21
- }
22
- .media-left,
23
- .media-right,
24
- .media-body {
25
- display: table-cell;
26
- vertical-align: top;
27
- }
28
- .media-middle {
29
- vertical-align: middle;
30
- }
31
- .media-bottom {
32
- vertical-align: bottom;
33
- }
1
+ .media {
2
+ display: flex;
3
+ align-items: flex-start;
34
4
  }
35
5
 
36
-
37
- //
38
- // Images/elements as the media anchor
39
- //
40
-
41
- .media-object {
42
- display: block;
43
-
44
- // Fix collapse in webkit from max-width: 100% and display: table-cell.
45
- &.img-thumbnail {
46
- max-width: none;
47
- }
48
- }
49
-
50
-
51
- //
52
- // Alignment
53
- //
54
-
55
- .media-right {
56
- padding-left: $media-alignment-padding-x;
57
- }
58
-
59
- .media-left {
60
- padding-right: $media-alignment-padding-x;
61
- }
62
-
63
-
64
- //
65
- // Headings
66
- //
67
-
68
- .media-heading {
69
- margin-top: 0;
70
- margin-bottom: $media-heading-margin-bottom;
71
- }
72
-
73
-
74
- //
75
- // Media list variation
76
- //
77
-
78
- .media-list {
79
- padding-left: 0;
80
- list-style: none;
6
+ .media-body {
7
+ flex: 1;
81
8
  }
@@ -10,7 +10,11 @@
10
10
 
11
11
  @mixin transition($transition...) {
12
12
  @if $enable-transitions {
13
- transition: $transition;
13
+ @if length($transition) == 0 {
14
+ transition: $transition-base;
15
+ } @else {
16
+ transition: $transition;
17
+ }
14
18
  }
15
19
  }
16
20
 
@@ -18,16 +22,16 @@
18
22
  @import "mixins/breakpoints";
19
23
  @import "mixins/hover";
20
24
  @import "mixins/image";
21
- @import "mixins/tag";
22
- @import "mixins/reset-filter";
25
+ @import "mixins/badge";
23
26
  @import "mixins/resize";
24
27
  @import "mixins/screen-reader";
25
28
  @import "mixins/size";
26
- @import "mixins/tab-focus";
27
29
  @import "mixins/reset-text";
28
30
  @import "mixins/text-emphasis";
29
31
  @import "mixins/text-hide";
30
32
  @import "mixins/text-truncate";
33
+ @import "mixins/transforms";
34
+ @import "mixins/visibility";
31
35
 
32
36
  // // Components
33
37
  @import "mixins/alert";
@@ -38,7 +42,6 @@
38
42
  @import "mixins/list-group";
39
43
  @import "mixins/nav-divider";
40
44
  @import "mixins/forms";
41
- @import "mixins/progress";
42
45
  @import "mixins/table-row";
43
46
 
44
47
  // // Skins
@@ -28,10 +28,10 @@
28
28
 
29
29
  // When fading in the modal, animate it to slide down
30
30
  &.fade .modal-dialog {
31
- transition: transform .3s ease-out;
31
+ @include transition($modal-transition);
32
32
  transform: translate(0, -25%);
33
33
  }
34
- &.in .modal-dialog { transform: translate(0, 0); }
34
+ &.show .modal-dialog { transform: translate(0, 0); }
35
35
  }
36
36
  .modal-open .modal {
37
37
  overflow-x: hidden;
@@ -48,6 +48,8 @@
48
48
  // Actual modal
49
49
  .modal-content {
50
50
  position: relative;
51
+ display: flex;
52
+ flex-direction: column;
51
53
  background-color: $modal-content-bg;
52
54
  background-clip: padding-box;
53
55
  border: $modal-content-border-width solid $modal-content-border-color;
@@ -64,29 +66,27 @@
64
66
  right: 0;
65
67
  bottom: 0;
66
68
  left: 0;
67
- z-index: $zindex-modal-bg;
69
+ z-index: $zindex-modal-backdrop;
68
70
  background-color: $modal-backdrop-bg;
69
71
 
70
72
  // Fade for backdrop
71
73
  &.fade { opacity: 0; }
72
- &.in { opacity: $modal-backdrop-opacity; }
74
+ &.show { opacity: $modal-backdrop-opacity; }
73
75
  }
74
76
 
75
77
  // Modal header
76
78
  // Top section of the modal w/ title and dismiss
77
79
  .modal-header {
78
- padding: $modal-title-padding;
80
+ display: flex;
81
+ align-items: center; // vertically center it
82
+ justify-content: space-between; // Put modal header elements (title and dismiss) on opposite ends
83
+ padding: $modal-header-padding;
79
84
  border-bottom: $modal-header-border-width solid $modal-header-border-color;
80
- @include clearfix;
81
- }
82
- // Close icon
83
- .modal-header .close {
84
- margin-top: -2px;
85
85
  }
86
86
 
87
87
  // Title text within header
88
88
  .modal-title {
89
- margin: 0;
89
+ margin-bottom: 0;
90
90
  line-height: $modal-title-line-height;
91
91
  }
92
92
 
@@ -94,15 +94,23 @@
94
94
  // Where all modal content resides (sibling of .modal-header and .modal-footer)
95
95
  .modal-body {
96
96
  position: relative;
97
+ // Enable `flex-grow: 1` so that the body take up as much space as possible
98
+ // when should there be a fixed height on `.modal-dialog`.
99
+ flex: 1 1 auto;
97
100
  padding: $modal-inner-padding;
98
101
  }
99
102
 
100
103
  // Footer (for actions)
101
104
  .modal-footer {
105
+ display: flex;
106
+ align-items: center; // vertically center
107
+ justify-content: flex-end; // Right align buttons with flex property because text-align doesn't work on flex items
102
108
  padding: $modal-inner-padding;
103
- text-align: right; // right align buttons
104
109
  border-top: $modal-footer-border-width solid $modal-footer-border-color;
105
- @include clearfix(); // clear it in case folks use .pull-* classes on buttons
110
+
111
+ // Easily place margin between footer elements
112
+ > :not(:first-child) { margin-left: .25rem; }
113
+ > :not(:last-child) { margin-right: .25rem; }
106
114
  }
107
115
 
108
116
  // Measure scrollbar width for padding body during modal show/hide