bootstrap 4.0.0.beta → 4.0.0.beta2

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 (90) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/Gemfile +1 -1
  4. data/README.md +10 -43
  5. data/Rakefile +1 -1
  6. data/assets/javascripts/bootstrap-sprockets.js +5 -5
  7. data/assets/javascripts/bootstrap.js +1561 -1542
  8. data/assets/javascripts/bootstrap.min.js +6 -5
  9. data/assets/javascripts/bootstrap/alert.js +31 -38
  10. data/assets/javascripts/bootstrap/button.js +23 -30
  11. data/assets/javascripts/bootstrap/carousel.js +72 -81
  12. data/assets/javascripts/bootstrap/collapse.js +72 -68
  13. data/assets/javascripts/bootstrap/dropdown.js +97 -85
  14. data/assets/javascripts/bootstrap/modal.js +104 -101
  15. data/assets/javascripts/bootstrap/popover.js +55 -68
  16. data/assets/javascripts/bootstrap/scrollspy.js +63 -68
  17. data/assets/javascripts/bootstrap/tab.js +54 -49
  18. data/assets/javascripts/bootstrap/tooltip.js +102 -116
  19. data/assets/javascripts/bootstrap/util.js +20 -30
  20. data/assets/stylesheets/_bootstrap-grid.scss +7 -9
  21. data/assets/stylesheets/_bootstrap-reboot.scss +7 -4
  22. data/assets/stylesheets/_bootstrap.scss +2 -1
  23. data/assets/stylesheets/bootstrap/_alert.scss +4 -3
  24. data/assets/stylesheets/bootstrap/_badge.scss +1 -2
  25. data/assets/stylesheets/bootstrap/_breadcrumb.scss +4 -4
  26. data/assets/stylesheets/bootstrap/_button-group.scss +33 -24
  27. data/assets/stylesheets/bootstrap/_buttons.scss +24 -29
  28. data/assets/stylesheets/bootstrap/_card.scss +58 -22
  29. data/assets/stylesheets/bootstrap/_carousel.scss +6 -0
  30. data/assets/stylesheets/bootstrap/_close.scss +2 -2
  31. data/assets/stylesheets/bootstrap/_custom-forms.scss +11 -8
  32. data/assets/stylesheets/bootstrap/_dropdown.scss +16 -41
  33. data/assets/stylesheets/bootstrap/_forms.scss +12 -44
  34. data/assets/stylesheets/bootstrap/_functions.scss +6 -10
  35. data/assets/stylesheets/bootstrap/_grid.scss +0 -1
  36. data/assets/stylesheets/bootstrap/_input-group.scss +17 -7
  37. data/assets/stylesheets/bootstrap/_mixins.scss +1 -0
  38. data/assets/stylesheets/bootstrap/_modal.scss +12 -1
  39. data/assets/stylesheets/bootstrap/_nav.scss +5 -5
  40. data/assets/stylesheets/bootstrap/_navbar.scss +27 -5
  41. data/assets/stylesheets/bootstrap/_pagination.scss +2 -4
  42. data/assets/stylesheets/bootstrap/_popover.scss +16 -17
  43. data/assets/stylesheets/bootstrap/_print.scss +2 -3
  44. data/assets/stylesheets/bootstrap/_progress.scss +4 -6
  45. data/assets/stylesheets/bootstrap/_reboot.scss +39 -16
  46. data/assets/stylesheets/bootstrap/_root.scss +19 -0
  47. data/assets/stylesheets/bootstrap/_tables.scss +40 -28
  48. data/assets/stylesheets/bootstrap/_tooltip.scss +6 -6
  49. data/assets/stylesheets/bootstrap/_transitions.scss +2 -0
  50. data/assets/stylesheets/bootstrap/_type.scss +2 -0
  51. data/assets/stylesheets/bootstrap/_variables.scss +467 -476
  52. data/assets/stylesheets/bootstrap/mixins/_alert.scss +1 -1
  53. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +8 -0
  54. data/assets/stylesheets/bootstrap/mixins/_badge.scss +2 -2
  55. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +18 -4
  56. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +27 -16
  57. data/assets/stylesheets/bootstrap/mixins/_caret.scss +35 -0
  58. data/assets/stylesheets/bootstrap/mixins/_float.scss +2 -0
  59. data/assets/stylesheets/bootstrap/mixins/_forms.scss +31 -4
  60. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +8 -0
  61. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +14 -1
  62. data/assets/stylesheets/bootstrap/mixins/_grid.scss +10 -5
  63. data/assets/stylesheets/bootstrap/mixins/_hover.scss +13 -12
  64. data/assets/stylesheets/bootstrap/mixins/_image.scss +3 -3
  65. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +0 -2
  66. data/assets/stylesheets/bootstrap/mixins/_navbar-align.scss +2 -1
  67. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +1 -2
  68. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +2 -2
  69. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +2 -0
  70. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +2 -0
  71. data/assets/stylesheets/bootstrap/utilities/_align.scss +2 -0
  72. data/assets/stylesheets/bootstrap/utilities/_background.scss +16 -3
  73. data/assets/stylesheets/bootstrap/utilities/_borders.scss +5 -3
  74. data/assets/stylesheets/bootstrap/utilities/_display.scss +3 -0
  75. data/assets/stylesheets/bootstrap/utilities/_flex.scss +2 -0
  76. data/assets/stylesheets/bootstrap/utilities/_position.scss +12 -1
  77. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +2 -0
  78. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +24 -14
  79. data/assets/stylesheets/bootstrap/utilities/_text.scss +7 -4
  80. data/bootstrap.gemspec +2 -3
  81. data/lib/bootstrap.rb +0 -16
  82. data/lib/bootstrap/version.rb +2 -2
  83. data/tasks/updater/js.rb +31 -4
  84. data/tasks/updater/scss.rb +0 -12
  85. data/test/dummy_rails/config/application.rb +0 -1
  86. metadata +16 -27
  87. data/templates/project/_bootstrap-variables.scss +0 -834
  88. data/templates/project/manifest.rb +0 -18
  89. data/templates/project/styles.scss +0 -10
  90. data/test/compass_test.rb +0 -14
@@ -1,6 +1,6 @@
1
1
  @mixin alert-variant($background, $border, $color) {
2
2
  color: $color;
3
- background-color: $background;
3
+ @include gradient-bg($background);
4
4
  border-color: $border;
5
5
 
6
6
  hr {
@@ -1,3 +1,5 @@
1
+ // stylelint-disable declaration-no-important
2
+
1
3
  // Contextual backgrounds
2
4
 
3
5
  @mixin bg-variant($parent, $color) {
@@ -10,3 +12,9 @@
10
12
  }
11
13
  }
12
14
  }
15
+
16
+ @mixin bg-gradient-variant($parent, $color) {
17
+ #{$parent} {
18
+ background: $color linear-gradient(180deg, mix($body-bg, $color, 15%), $color) repeat-x !important;
19
+ }
20
+ }
@@ -1,10 +1,10 @@
1
1
  @mixin badge-variant($bg) {
2
- @include color-yiq($bg);
2
+ color: color-yiq($bg);
3
3
  background-color: $bg;
4
4
 
5
5
  &[href] {
6
6
  @include hover-focus {
7
- @include color-yiq($bg);
7
+ color: color-yiq($bg);
8
8
  text-decoration: none;
9
9
  background-color: darken($bg, 10%);
10
10
  }
@@ -81,8 +81,18 @@
81
81
  $min: breakpoint-min($lower, $breakpoints);
82
82
  $max: breakpoint-max($upper, $breakpoints);
83
83
 
84
- @media (min-width: $min) and (max-width: $max) {
85
- @content;
84
+ @if $min != null and $max != null {
85
+ @media (min-width: $min) and (max-width: $max) {
86
+ @content;
87
+ }
88
+ } @else if $max == null {
89
+ @include media-breakpoint-up($lower) {
90
+ @content;
91
+ }
92
+ } @else if $min == null {
93
+ @include media-breakpoint-down($upper) {
94
+ @content;
95
+ }
86
96
  }
87
97
  }
88
98
 
@@ -98,8 +108,12 @@
98
108
  @content;
99
109
  }
100
110
  } @else if $max == null {
101
- @include media-breakpoint-up($name)
111
+ @include media-breakpoint-up($name) {
112
+ @content;
113
+ }
102
114
  } @else if $min == null {
103
- @include media-breakpoint-down($name)
115
+ @include media-breakpoint-down($name) {
116
+ @content;
117
+ }
104
118
  }
105
119
  }
@@ -3,25 +3,25 @@
3
3
  // Easily pump out default styles, as well as :hover, :focus, :active,
4
4
  // and disabled options for all buttons
5
5
 
6
- @mixin button-variant($background, $border, $active-background: darken($background, 7.5%), $active-border: darken($border, 10%)) {
7
- @include color-yiq($background);
8
- background-color: $background;
6
+ @mixin button-variant($background, $border, $hover-background: darken($background, 7.5%), $hover-border: darken($border, 10%), $active-background: darken($background, 10%), $active-border: darken($border, 12.5%)) {
7
+ color: color-yiq($background);
8
+ @include gradient-bg($background);
9
9
  border-color: $border;
10
10
  @include box-shadow($btn-box-shadow);
11
11
 
12
- &:hover {
13
- @include color-yiq($background);
14
- background-color: $active-background;
15
- border-color: $active-border;
12
+ @include hover {
13
+ color: color-yiq($hover-background);
14
+ @include gradient-bg($hover-background);
15
+ border-color: $hover-border;
16
16
  }
17
17
 
18
18
  &:focus,
19
19
  &.focus {
20
20
  // Avoid using mixin so we can pass custom focus shadow properly
21
21
  @if $enable-shadows {
22
- box-shadow: $btn-box-shadow, 0 0 0 3px rgba($border, .5);
22
+ box-shadow: $btn-box-shadow, 0 0 0 $input-btn-focus-width rgba($border, .5);
23
23
  } @else {
24
- box-shadow: 0 0 0 3px rgba($border, .5);
24
+ box-shadow: 0 0 0 $input-btn-focus-width rgba($border, .5);
25
25
  }
26
26
  }
27
27
 
@@ -32,13 +32,22 @@
32
32
  border-color: $border;
33
33
  }
34
34
 
35
- &:active,
36
- &.active,
35
+ &:not([disabled]):not(.disabled):active,
36
+ &:not([disabled]):not(.disabled).active,
37
37
  .show > &.dropdown-toggle {
38
+ color: color-yiq($active-background);
38
39
  background-color: $active-background;
39
- background-image: none; // Remove the gradient for the pressed/active state
40
+ @if $enable-gradients {
41
+ background-image: none; // Remove the gradient for the pressed/active state
42
+ }
40
43
  border-color: $active-border;
41
- @include box-shadow($btn-active-box-shadow);
44
+
45
+ // Avoid using mixin so we can pass custom focus shadow properly
46
+ @if $enable-shadows {
47
+ box-shadow: $btn-active-box-shadow, 0 0 0 $input-btn-focus-width rgba($border, .5);
48
+ } @else {
49
+ box-shadow: 0 0 0 $input-btn-focus-width rgba($border, .5);
50
+ }
42
51
  }
43
52
  }
44
53
 
@@ -56,7 +65,7 @@
56
65
 
57
66
  &:focus,
58
67
  &.focus {
59
- box-shadow: 0 0 0 3px rgba($color, .5);
68
+ box-shadow: 0 0 0 $input-btn-focus-width rgba($color, .5);
60
69
  }
61
70
 
62
71
  &.disabled,
@@ -65,12 +74,14 @@
65
74
  background-color: transparent;
66
75
  }
67
76
 
68
- &:active,
69
- &.active,
77
+ &:not([disabled]):not(.disabled):active,
78
+ &:not([disabled]):not(.disabled).active,
70
79
  .show > &.dropdown-toggle {
71
80
  color: $color-hover;
72
81
  background-color: $color;
73
82
  border-color: $color;
83
+ // Avoid using mixin so we can pass custom focus shadow properly
84
+ box-shadow: 0 0 0 $input-btn-focus-width rgba($color, .5);
74
85
  }
75
86
  }
76
87
 
@@ -0,0 +1,35 @@
1
+ @mixin caret-down {
2
+ border-top: $caret-width solid;
3
+ border-right: $caret-width solid transparent;
4
+ border-bottom: 0;
5
+ border-left: $caret-width solid transparent;
6
+ }
7
+
8
+ @mixin caret-up {
9
+ border-top: 0;
10
+ border-right: $caret-width solid transparent;
11
+ border-bottom: $caret-width solid;
12
+ border-left: $caret-width solid transparent;
13
+ }
14
+
15
+ @mixin caret($direction: down) {
16
+ @if $enable-caret {
17
+ &::after {
18
+ display: inline-block;
19
+ width: 0;
20
+ height: 0;
21
+ margin-left: $caret-width * .85;
22
+ vertical-align: $caret-width * .85;
23
+ content: "";
24
+ @if $direction == down {
25
+ @include caret-down;
26
+ } @else if $direction == up {
27
+ @include caret-up;
28
+ }
29
+ }
30
+
31
+ &:empty::after {
32
+ margin-left: 0;
33
+ }
34
+ }
35
+ }
@@ -1,3 +1,5 @@
1
+ // stylelint-disable declaration-no-important
2
+
1
3
  @mixin float-left {
2
4
  float: left !important;
3
5
  }
@@ -1,7 +1,7 @@
1
1
  // Form control focus state
2
2
  //
3
3
  // Generate a customized focus state and for any input with the specified color,
4
- // which defaults to the `@input-border-color-focus` variable.
4
+ // which defaults to the `$input-focus-border-color` variable.
5
5
  //
6
6
  // We highly encourage you to not customize the default value, but instead use
7
7
  // this to tweak colors on an as-needed basis. This aesthetic change is based on
@@ -16,13 +16,40 @@
16
16
  background-color: $input-focus-bg;
17
17
  border-color: $input-focus-border-color;
18
18
  outline: none;
19
- @include box-shadow($input-focus-box-shadow);
19
+ // Avoid using mixin so we can pass custom focus shadow properly
20
+ @if $enable-shadows {
21
+ box-shadow: $input-box-shadow, $input-btn-focus-box-shadow;
22
+ } @else {
23
+ box-shadow: $input-btn-focus-box-shadow;
24
+ }
20
25
  }
21
26
  }
22
27
 
23
28
 
24
29
  @mixin form-validation-state($state, $color) {
25
30
 
31
+ .#{$state}-feedback {
32
+ display: none;
33
+ margin-top: .25rem;
34
+ font-size: .875rem;
35
+ color: $color;
36
+ }
37
+
38
+ .#{$state}-tooltip {
39
+ position: absolute;
40
+ top: 100%;
41
+ z-index: 5;
42
+ display: none;
43
+ width: 250px;
44
+ padding: .5rem;
45
+ margin-top: .1rem;
46
+ font-size: .875rem;
47
+ line-height: 1;
48
+ color: #fff;
49
+ background-color: rgba($color,.8);
50
+ border-radius: .2rem;
51
+ }
52
+
26
53
  .form-control,
27
54
  .custom-select {
28
55
  .was-validated &:#{$state},
@@ -33,8 +60,8 @@
33
60
  box-shadow: 0 0 0 .2rem rgba($color,.25);
34
61
  }
35
62
 
36
- ~ .invalid-feedback,
37
- ~ .invalid-tooltip {
63
+ ~ .#{$state}-feedback,
64
+ ~ .#{$state}-tooltip {
38
65
  display: block;
39
66
  }
40
67
  }
@@ -1,5 +1,13 @@
1
1
  // Gradients
2
2
 
3
+ @mixin gradient-bg($color) {
4
+ @if $enable-gradients {
5
+ background: $color linear-gradient(180deg, mix($body-bg, $color, 15%), $color) repeat-x;
6
+ } @else {
7
+ background-color: $color;
8
+ }
9
+ }
10
+
3
11
  // Horizontal gradient, from left to right
4
12
  //
5
13
  // Creates two color stops, start and end, by specifying a color and position for each color stop.
@@ -10,7 +10,7 @@
10
10
  width: 100%;
11
11
  min-height: 1px; // Prevent columns from collapsing when empty
12
12
  padding-right: ($gutter / 2);
13
- padding-left: ($gutter / 2);
13
+ padding-left: ($gutter / 2);
14
14
  }
15
15
 
16
16
  @each $breakpoint in map-keys($breakpoints) {
@@ -46,11 +46,24 @@
46
46
  }
47
47
  }
48
48
 
49
+ .order#{$infix}-first {
50
+ order: -1;
51
+ }
52
+
49
53
  @for $i from 1 through $columns {
50
54
  .order#{$infix}-#{$i} {
51
55
  order: $i;
52
56
  }
53
57
  }
58
+
59
+ // `$columns - 1` because offsetting by the width of an entire row isn't possible
60
+ @for $i from 0 through ($columns - 1) {
61
+ @if not ($infix == "" and $i == 0) { // Avoid emitting useless .offset-0
62
+ .offset#{$infix}-#{$i} {
63
+ @include make-col-offset($i, $columns);
64
+ }
65
+ }
66
+ }
54
67
  }
55
68
  }
56
69
  }
@@ -3,11 +3,11 @@
3
3
  // Generate semantic grid columns with these mixins.
4
4
 
5
5
  @mixin make-container() {
6
+ width: 100%;
7
+ padding-right: ($grid-gutter-width / 2);
8
+ padding-left: ($grid-gutter-width / 2);
6
9
  margin-right: auto;
7
10
  margin-left: auto;
8
- padding-right: ($grid-gutter-width / 2);
9
- padding-left: ($grid-gutter-width / 2);
10
- width: 100%;
11
11
  }
12
12
 
13
13
 
@@ -24,7 +24,7 @@
24
24
  display: flex;
25
25
  flex-wrap: wrap;
26
26
  margin-right: ($grid-gutter-width / -2);
27
- margin-left: ($grid-gutter-width / -2);
27
+ margin-left: ($grid-gutter-width / -2);
28
28
  }
29
29
 
30
30
  @mixin make-col-ready() {
@@ -35,7 +35,7 @@
35
35
  width: 100%;
36
36
  min-height: 1px; // Prevent collapsing
37
37
  padding-right: ($grid-gutter-width / 2);
38
- padding-left: ($grid-gutter-width / 2);
38
+ padding-left: ($grid-gutter-width / 2);
39
39
  }
40
40
 
41
41
  @mixin make-col($size, $columns: $grid-columns) {
@@ -45,3 +45,8 @@
45
45
  // do not appear to require this.
46
46
  max-width: percentage($size / $columns);
47
47
  }
48
+
49
+ @mixin make-col-offset($size, $columns: $grid-columns) {
50
+ $num: $size / $columns;
51
+ margin-left: if($num == 0, 0, percentage($num));
52
+ }
@@ -1,3 +1,4 @@
1
+ // stylelint-disable indentation
1
2
  @mixin hover {
2
3
  // TODO: re-enable along with mq4-hover-shim
3
4
  // @if $enable-hover-media-query {
@@ -8,21 +9,21 @@
8
9
  // }
9
10
  // }
10
11
  // @else {
11
- // scss-lint:disable Indentation
12
- &:hover { @content }
13
- // scss-lint:enable Indentation
12
+ &:hover { @content; }
14
13
  // }
15
14
  }
16
15
 
17
16
 
18
17
  @mixin hover-focus {
19
18
  @if $enable-hover-media-query {
20
- &:focus { @content }
21
- @include hover { @content }
19
+ &:focus {
20
+ @content;
21
+ }
22
+ @include hover { @content; }
22
23
  } @else {
23
24
  &:focus,
24
25
  &:hover {
25
- @content
26
+ @content;
26
27
  }
27
28
  }
28
29
  }
@@ -31,14 +32,14 @@
31
32
  @if $enable-hover-media-query {
32
33
  &,
33
34
  &:focus {
34
- @content
35
+ @content;
35
36
  }
36
- @include hover { @content }
37
+ @include hover { @content; }
37
38
  } @else {
38
39
  &,
39
40
  &:focus,
40
41
  &:hover {
41
- @content
42
+ @content;
42
43
  }
43
44
  }
44
45
  }
@@ -47,14 +48,14 @@
47
48
  @if $enable-hover-media-query {
48
49
  &:focus,
49
50
  &:active {
50
- @content
51
+ @content;
51
52
  }
52
- @include hover { @content }
53
+ @include hover { @content; }
53
54
  } @else {
54
55
  &:focus,
55
56
  &:active,
56
57
  &:hover {
57
- @content
58
+ @content;
58
59
  }
59
60
  }
60
61
  }
@@ -20,15 +20,15 @@
20
20
  //
21
21
  // Short retina mixin for setting background-image and -size.
22
22
 
23
+ // stylelint-disable indentation, media-query-list-comma-newline-after
23
24
  @mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) {
24
25
  background-image: url($file-1x);
25
26
 
26
27
  // Autoprefixer takes care of adding -webkit-min-device-pixel-ratio and -o-min-device-pixel-ratio,
27
28
  // but doesn't convert dppx=>dpi.
28
29
  // There's no such thing as unprefixed min-device-pixel-ratio since it's nonstandard.
29
- // Compatibility info: http://caniuse.com/#feat=css-media-resolution
30
- @media
31
- only screen and (min-resolution: 192dpi), // IE9-11 don't support dppx
30
+ // Compatibility info: https://caniuse.com/#feat=css-media-resolution
31
+ @media only screen and (min-resolution: 192dpi), // IE9-11 don't support dppx
32
32
  only screen and (min-resolution: 2dppx) { // Standardized
33
33
  background-image: url($file-2x);
34
34
  background-size: $width-1x $height-1x;
@@ -6,7 +6,6 @@
6
6
  background-color: $background;
7
7
  }
8
8
 
9
- //scss-lint:disable QualifyingElement
10
9
  a.list-group-item-#{$state},
11
10
  button.list-group-item-#{$state} {
12
11
  color: $color;
@@ -22,5 +21,4 @@
22
21
  border-color: $color;
23
22
  }
24
23
  }
25
- // scss-lint:enable QualifyingElement
26
24
  }