bootstrap 4.0.0.alpha6 → 4.0.0.beta

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 (97) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/Gemfile +2 -4
  4. data/README.md +20 -22
  5. data/assets/javascripts/bootstrap.js +657 -361
  6. data/assets/javascripts/bootstrap.min.js +2 -3
  7. data/assets/javascripts/bootstrap/alert.js +8 -8
  8. data/assets/javascripts/bootstrap/button.js +16 -9
  9. data/assets/javascripts/bootstrap/carousel.js +48 -21
  10. data/assets/javascripts/bootstrap/collapse.js +42 -33
  11. data/assets/javascripts/bootstrap/dropdown.js +196 -52
  12. data/assets/javascripts/bootstrap/modal.js +71 -29
  13. data/assets/javascripts/bootstrap/popover.js +25 -13
  14. data/assets/javascripts/bootstrap/scrollspy.js +23 -21
  15. data/assets/javascripts/bootstrap/tab.js +14 -18
  16. data/assets/javascripts/bootstrap/tooltip.js +139 -83
  17. data/assets/javascripts/bootstrap/util.js +10 -8
  18. data/assets/stylesheets/_bootstrap-grid.scss +2 -8
  19. data/assets/stylesheets/_bootstrap-reboot.scss +1 -2
  20. data/assets/stylesheets/_bootstrap.scss +2 -15
  21. data/assets/stylesheets/bootstrap/_alert.scss +4 -11
  22. data/assets/stylesheets/bootstrap/_badge.scss +4 -33
  23. data/assets/stylesheets/bootstrap/_breadcrumb.scss +1 -1
  24. data/assets/stylesheets/bootstrap/_button-group.scss +11 -15
  25. data/assets/stylesheets/bootstrap/_buttons.scss +13 -42
  26. data/assets/stylesheets/bootstrap/_card.scss +27 -80
  27. data/assets/stylesheets/bootstrap/_carousel.scss +24 -17
  28. data/assets/stylesheets/bootstrap/_close.scss +0 -2
  29. data/assets/stylesheets/bootstrap/_custom-forms.scss +27 -36
  30. data/assets/stylesheets/bootstrap/_dropdown.scss +15 -48
  31. data/assets/stylesheets/bootstrap/_forms.scss +70 -68
  32. data/assets/stylesheets/bootstrap/_functions.scss +90 -0
  33. data/assets/stylesheets/bootstrap/_grid.scss +3 -2
  34. data/assets/stylesheets/bootstrap/_images.scss +1 -1
  35. data/assets/stylesheets/bootstrap/_input-group.scss +6 -8
  36. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -4
  37. data/assets/stylesheets/bootstrap/_list-group.scss +9 -36
  38. data/assets/stylesheets/bootstrap/_mixins.scss +2 -18
  39. data/assets/stylesheets/bootstrap/_modal.scss +3 -3
  40. data/assets/stylesheets/bootstrap/_nav.scss +15 -16
  41. data/assets/stylesheets/bootstrap/_navbar.scss +70 -54
  42. data/assets/stylesheets/bootstrap/_pagination.scss +3 -4
  43. data/assets/stylesheets/bootstrap/_popover.scss +96 -72
  44. data/assets/stylesheets/bootstrap/_print.scss +1 -9
  45. data/assets/stylesheets/bootstrap/_progress.scss +4 -4
  46. data/assets/stylesheets/bootstrap/_reboot.scss +187 -95
  47. data/assets/stylesheets/bootstrap/_tables.scss +34 -19
  48. data/assets/stylesheets/bootstrap/_tooltip.scss +52 -35
  49. data/assets/stylesheets/bootstrap/_type.scss +8 -28
  50. data/assets/stylesheets/bootstrap/_utilities.scss +1 -0
  51. data/assets/stylesheets/bootstrap/_variables.scss +286 -410
  52. data/assets/stylesheets/bootstrap/mixins/_alert.scss +4 -5
  53. data/assets/stylesheets/bootstrap/mixins/_badge.scss +6 -5
  54. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +3 -3
  55. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +5 -0
  56. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +23 -13
  57. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +11 -14
  58. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +1 -1
  59. data/assets/stylesheets/bootstrap/mixins/_forms.scss +57 -55
  60. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +1 -1
  61. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +9 -18
  62. data/assets/stylesheets/bootstrap/mixins/_grid.scss +12 -65
  63. data/assets/stylesheets/bootstrap/mixins/_hover.scss +6 -6
  64. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +2 -4
  65. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +3 -3
  66. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +1 -0
  67. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +4 -3
  68. data/assets/stylesheets/bootstrap/mixins/_resize.scss +1 -1
  69. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +5 -2
  70. data/assets/stylesheets/bootstrap/mixins/_text-truncate.scss +1 -1
  71. data/assets/stylesheets/bootstrap/mixins/_transition.scss +9 -0
  72. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +2 -2
  73. data/assets/stylesheets/bootstrap/utilities/_background.scss +4 -17
  74. data/assets/stylesheets/bootstrap/utilities/_borders.scss +20 -5
  75. data/assets/stylesheets/bootstrap/utilities/_display.scss +36 -1
  76. data/assets/stylesheets/bootstrap/{_responsive-embed.scss → utilities/_embed.scss} +0 -0
  77. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -4
  78. data/assets/stylesheets/bootstrap/utilities/_position.scss +5 -3
  79. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +10 -12
  80. data/assets/stylesheets/bootstrap/utilities/_text.scss +5 -17
  81. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +4 -48
  82. data/bootstrap.gemspec +2 -0
  83. data/lib/bootstrap.rb +2 -0
  84. data/lib/bootstrap/version.rb +2 -2
  85. data/tasks/updater/js.rb +7 -9
  86. data/tasks/updater/scss.rb +1 -4
  87. data/templates/project/_bootstrap-variables.scss +289 -396
  88. data/test/dummy_rails/app/assets/javascripts/application.js +1 -1
  89. data/test/dummy_rails/config/application.rb +0 -1
  90. data/test/gemfiles/rails_4_2.gemfile +0 -4
  91. data/test/gemfiles/rails_5_0.gemfile +0 -4
  92. data/test/gemfiles/rails_5_1.gemfile +8 -0
  93. metadata +23 -8
  94. data/assets/stylesheets/bootstrap/_custom.scss +0 -4
  95. data/assets/stylesheets/bootstrap/_normalize.scss +0 -461
  96. data/assets/stylesheets/bootstrap/mixins/_cards.scss +0 -47
  97. data/assets/stylesheets/bootstrap/mixins/_transforms.scss +0 -14
@@ -0,0 +1,90 @@
1
+ // Bootstrap functions
2
+ //
3
+ // Utility mixins and functions for evalutating source code across our variables, maps, and mixins.
4
+
5
+ // Ascending
6
+ // Used to evaluate Sass maps like our grid breakpoints.
7
+ @mixin _assert-ascending($map, $map-name) {
8
+ $prev-key: null;
9
+ $prev-num: null;
10
+ @each $key, $num in $map {
11
+ @if $prev-num == null {
12
+ // Do nothing
13
+ } @else if not comparable($prev-num, $num) {
14
+ @warn "Potentially invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} whose unit makes it incomparable to #{$prev-num}, the value of the previous key '#{$prev-key}' !";
15
+ } @else if $prev-num >= $num {
16
+ @warn "Invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} which isn't greater than #{$prev-num}, the value of the previous key '#{$prev-key}' !";
17
+ }
18
+ $prev-key: $key;
19
+ $prev-num: $num;
20
+ }
21
+ }
22
+
23
+ // Starts at zero
24
+ // Another grid mixin that ensures the min-width of the lowest breakpoint starts at 0.
25
+ @mixin _assert-starts-at-zero($map) {
26
+ $values: map-values($map);
27
+ $first-value: nth($values, 1);
28
+ @if $first-value != 0 {
29
+ @warn "First breakpoint in `$grid-breakpoints` must start at 0, but starts at #{$first-value}.";
30
+ }
31
+ }
32
+
33
+ // Replace `$search` with `$replace` in `$string`
34
+ // Used on our SVG icon backgrounds for custom forms.
35
+ //
36
+ // @author Hugo Giraudel
37
+ // @param {String} $string - Initial string
38
+ // @param {String} $search - Substring to replace
39
+ // @param {String} $replace ('') - New value
40
+ // @return {String} - Updated string
41
+ @function str-replace($string, $search, $replace: "") {
42
+ $index: str-index($string, $search);
43
+
44
+ @if $index {
45
+ @return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
46
+ }
47
+
48
+ @return $string;
49
+ }
50
+
51
+ // Color contrast
52
+ @mixin color-yiq($color) {
53
+ $r: red($color);
54
+ $g: green($color);
55
+ $b: blue($color);
56
+
57
+ $yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
58
+
59
+ @if ($yiq >= 150) {
60
+ color: #111;
61
+ } @else {
62
+ color: #fff;
63
+ }
64
+ }
65
+
66
+ // Retreive color Sass maps
67
+ @function color($key: "blue") {
68
+ @return map-get($colors, $key);
69
+ }
70
+
71
+ @function theme-color($key: "primary") {
72
+ @return map-get($theme-colors, $key);
73
+ }
74
+
75
+ @function grayscale($key: "100") {
76
+ @return map-get($grays, $key);
77
+ }
78
+
79
+ // Request a theme color level
80
+ @function theme-color-level($color-name: "primary", $level: 0) {
81
+ $color: theme-color($color-name);
82
+ $color-base: if($level > 0, #000, #fff);
83
+
84
+ @if $level < 0 {
85
+ // Lighter values need a quick double negative for the Sass math to work
86
+ @return mix($color-base, $color, $level * -1 * $theme-color-interval);
87
+ } @else {
88
+ @return mix($color-base, $color, $level * $theme-color-interval);
89
+ }
90
+ }
@@ -11,11 +11,12 @@
11
11
 
12
12
  // Fluid container
13
13
  //
14
- // Utilizes the mixin meant for fixed width containers, but without any defined
15
- // width for fluid, full width layouts.
14
+ // Utilizes the mixin meant for fixed width containers, but with 100% width for
15
+ // fluid, full width layouts.
16
16
 
17
17
  @if $enable-grid-classes {
18
18
  .container-fluid {
19
+ width: 100%;
19
20
  @include make-container();
20
21
  }
21
22
  }
@@ -33,7 +33,7 @@
33
33
  }
34
34
 
35
35
  .figure-img {
36
- margin-bottom: ($spacer-y / 2);
36
+ margin-bottom: ($spacer / 2);
37
37
  line-height: 1;
38
38
  }
39
39
 
@@ -30,8 +30,7 @@
30
30
  .input-group .form-control {
31
31
  // Vertically centers the content of the addons within the input group
32
32
  display: flex;
33
- flex-direction: column;
34
- justify-content: center;
33
+ align-items: center;
35
34
 
36
35
  &:not(:first-child):not(:last-child) {
37
36
  @include border-radius(0);
@@ -67,11 +66,11 @@
67
66
  //
68
67
 
69
68
  .input-group-addon {
70
- padding: $input-padding-y $input-padding-x;
69
+ padding: $input-btn-padding-y $input-btn-padding-x;
71
70
  margin-bottom: 0; // Allow use of <label> elements by overriding our default margin-bottom
72
71
  font-size: $font-size-base; // Match inputs
73
72
  font-weight: $font-weight-normal;
74
- line-height: $input-line-height;
73
+ line-height: $input-btn-line-height;
75
74
  color: $input-color;
76
75
  text-align: center;
77
76
  background-color: $input-group-addon-bg;
@@ -80,12 +79,13 @@
80
79
 
81
80
  // Sizing
82
81
  &.form-control-sm {
83
- padding: $input-padding-y-sm $input-padding-x-sm;
82
+ padding: $input-btn-padding-y-sm $input-btn-padding-x-sm;
84
83
  font-size: $font-size-sm;
85
84
  @include border-radius($input-border-radius-sm);
86
85
  }
86
+
87
87
  &.form-control-lg {
88
- padding: $input-padding-y-lg $input-padding-x-lg;
88
+ padding: $input-btn-padding-y-lg $input-btn-padding-x-lg;
89
89
  font-size: $font-size-lg;
90
90
  @include border-radius($input-border-radius-lg);
91
91
  }
@@ -144,8 +144,6 @@
144
144
  // element above the siblings.
145
145
  > .btn {
146
146
  position: relative;
147
- // Vertically stretch the button and center its content
148
- flex: 1;
149
147
 
150
148
  + .btn {
151
149
  margin-left: (-$input-btn-border-width);
@@ -9,10 +9,6 @@
9
9
  }
10
10
  }
11
11
 
12
- .jumbotron-hr {
13
- border-top-color: darken($jumbotron-bg, 10%);
14
- }
15
-
16
12
  .jumbotron-fluid {
17
13
  padding-right: 0;
18
14
  padding-left: 0;
@@ -19,23 +19,19 @@
19
19
 
20
20
  .list-group-item-action {
21
21
  width: 100%; // For `<button>`s (anchors become 100% by default though)
22
- color: $list-group-link-color;
22
+ color: $list-group-action-color;
23
23
  text-align: inherit; // For `<button>`s (anchors inherit)
24
24
 
25
- .list-group-item-heading {
26
- color: $list-group-link-heading-color;
27
- }
28
-
29
25
  // Hover state
30
26
  @include hover-focus {
31
- color: $list-group-link-hover-color;
27
+ color: $list-group-action-hover-color;
32
28
  text-decoration: none;
33
29
  background-color: $list-group-hover-bg;
34
30
  }
35
31
 
36
32
  &:active {
37
- color: $list-group-link-active-color;
38
- background-color: $list-group-link-active-bg;
33
+ color: $list-group-action-active-color;
34
+ background-color: $list-group-action-active-bg;
39
35
  }
40
36
  }
41
37
 
@@ -46,9 +42,7 @@
46
42
 
47
43
  .list-group-item {
48
44
  position: relative;
49
- display: flex;
50
- flex-flow: row wrap;
51
- align-items: center;
45
+ display: block;
52
46
  padding: $list-group-item-padding-y $list-group-item-padding-x;
53
47
  // Place the border on the list items and negative margin up for better styling
54
48
  margin-bottom: -$list-group-border-width;
@@ -71,16 +65,7 @@
71
65
  &.disabled,
72
66
  &:disabled {
73
67
  color: $list-group-disabled-color;
74
- cursor: $cursor-disabled;
75
68
  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;
83
- }
84
69
  }
85
70
 
86
71
  // Include both here for `<a>`s and `<button>`s
@@ -88,18 +73,7 @@
88
73
  z-index: 2; // Place active items above their siblings for proper border styling
89
74
  color: $list-group-active-color;
90
75
  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;
102
- }
76
+ border-color: $list-group-active-border-color;
103
77
  }
104
78
  }
105
79
 
@@ -135,7 +109,6 @@
135
109
  // Add modifier classes to change text and background color on individual items.
136
110
  // Organizationally, this must come after the `:hover` states.
137
111
 
138
- @include list-group-item-variant(success, $state-success-bg, $state-success-text);
139
- @include list-group-item-variant(info, $state-info-bg, $state-info-text);
140
- @include list-group-item-variant(warning, $state-warning-bg, $state-warning-text);
141
- @include list-group-item-variant(danger, $state-danger-bg, $state-danger-text);
112
+ @each $color, $value in $theme-colors {
113
+ @include list-group-item-variant($color, theme-color-level($color, -9), theme-color-level($color, 6));
114
+ }
@@ -2,22 +2,6 @@
2
2
  //
3
3
  // Used in conjunction with global variables to enable certain theme features.
4
4
 
5
- @mixin box-shadow($shadow...) {
6
- @if $enable-shadows {
7
- box-shadow: $shadow;
8
- }
9
- }
10
-
11
- @mixin transition($transition...) {
12
- @if $enable-transitions {
13
- @if length($transition) == 0 {
14
- transition: $transition-base;
15
- } @else {
16
- transition: $transition;
17
- }
18
- }
19
- }
20
-
21
5
  // Utilities
22
6
  @import "mixins/breakpoints";
23
7
  @import "mixins/hover";
@@ -30,13 +14,11 @@
30
14
  @import "mixins/text-emphasis";
31
15
  @import "mixins/text-hide";
32
16
  @import "mixins/text-truncate";
33
- @import "mixins/transforms";
34
17
  @import "mixins/visibility";
35
18
 
36
19
  // // Components
37
20
  @import "mixins/alert";
38
21
  @import "mixins/buttons";
39
- @import "mixins/cards";
40
22
  @import "mixins/pagination";
41
23
  @import "mixins/lists";
42
24
  @import "mixins/list-group";
@@ -47,7 +29,9 @@
47
29
  // // Skins
48
30
  @import "mixins/background-variant";
49
31
  @import "mixins/border-radius";
32
+ @import "mixins/box-shadow";
50
33
  @import "mixins/gradients";
34
+ @import "mixins/transition";
51
35
 
52
36
  // // Layout
53
37
  @import "mixins/clearfix";
@@ -54,7 +54,7 @@
54
54
  background-clip: padding-box;
55
55
  border: $modal-content-border-width solid $modal-content-border-color;
56
56
  @include border-radius($border-radius-lg);
57
- @include box-shadow($modal-content-xs-box-shadow);
57
+ @include box-shadow($modal-content-box-shadow-xs);
58
58
  // Remove focus outline from opened modal
59
59
  outline: 0;
60
60
  }
@@ -127,11 +127,11 @@
127
127
  // Automatically set modal's width for larger viewports
128
128
  .modal-dialog {
129
129
  max-width: $modal-md;
130
- margin: $modal-dialog-sm-up-margin-y auto;
130
+ margin: $modal-dialog-margin-y-sm-up auto;
131
131
  }
132
132
 
133
133
  .modal-content {
134
- @include box-shadow($modal-content-sm-up-box-shadow);
134
+ @include box-shadow($modal-content-box-shadow-sm-up);
135
135
  }
136
136
 
137
137
  .modal-sm { max-width: $modal-sm; }
@@ -5,6 +5,7 @@
5
5
 
6
6
  .nav {
7
7
  display: flex;
8
+ flex-wrap: wrap;
8
9
  padding-left: 0;
9
10
  margin-bottom: 0;
10
11
  list-style: none;
@@ -12,20 +13,18 @@
12
13
 
13
14
  .nav-link {
14
15
  display: block;
15
- padding: $nav-link-padding;
16
+ padding: $nav-link-padding-y $nav-link-padding-x;
16
17
 
17
18
  @include hover-focus {
18
19
  text-decoration: none;
19
20
  }
20
21
 
21
- // Disabled state lightens text and removes hover/tab effects
22
+ // Disabled state lightens text
22
23
  &.disabled {
23
- color: $nav-disabled-link-color;
24
- cursor: $cursor-disabled;
24
+ color: $nav-link-disabled-color;
25
25
  }
26
26
  }
27
27
 
28
-
29
28
  //
30
29
  // Tabs
31
30
  //
@@ -46,7 +45,7 @@
46
45
  }
47
46
 
48
47
  &.disabled {
49
- color: $nav-disabled-link-color;
48
+ color: $nav-link-disabled-color;
50
49
  background-color: transparent;
51
50
  border-color: transparent;
52
51
  }
@@ -54,9 +53,9 @@
54
53
 
55
54
  .nav-link.active,
56
55
  .nav-item.show .nav-link {
57
- color: $nav-tabs-active-link-hover-color;
58
- background-color: $nav-tabs-active-link-hover-bg;
59
- border-color: $nav-tabs-active-link-hover-border-color $nav-tabs-active-link-hover-border-color $nav-tabs-active-link-hover-bg;
56
+ color: $nav-tabs-link-active-color;
57
+ background-color: $nav-tabs-link-active-bg;
58
+ border-color: $nav-tabs-link-active-border-color $nav-tabs-link-active-border-color $nav-tabs-link-active-bg;
60
59
  }
61
60
 
62
61
  .dropdown-menu {
@@ -75,13 +74,12 @@
75
74
  .nav-pills {
76
75
  .nav-link {
77
76
  @include border-radius($nav-pills-border-radius);
78
- }
79
77
 
80
- .nav-link.active,
81
- .nav-item.show .nav-link {
82
- color: $nav-pills-active-link-color;
83
- cursor: default;
84
- background-color: $nav-pills-active-link-bg;
78
+ &.active,
79
+ .show > & {
80
+ color: $nav-pills-link-active-color;
81
+ background-color: $nav-pills-link-active-bg;
82
+ }
85
83
  }
86
84
  }
87
85
 
@@ -99,7 +97,8 @@
99
97
 
100
98
  .nav-justified {
101
99
  .nav-item {
102
- flex: 1 1 100%;
100
+ flex-basis: 0;
101
+ flex-grow: 1;
103
102
  text-align: center;
104
103
  }
105
104
  }
@@ -18,8 +18,20 @@
18
18
  .navbar {
19
19
  position: relative;
20
20
  display: flex;
21
- flex-direction: column;
21
+ flex-wrap: wrap; // allow us to do the line break for collapsing content
22
+ align-items: center;
23
+ justify-content: space-between; // space out brand from logo
22
24
  padding: $navbar-padding-y $navbar-padding-x;
25
+
26
+ // Because flex properties aren't inherited, we need to redeclare these first
27
+ // few properities so that content nested within behave properly.
28
+ > .container,
29
+ > .container-fluid {
30
+ display: flex;
31
+ flex-wrap: wrap;
32
+ align-items: center;
33
+ justify-content: space-between;
34
+ }
23
35
  }
24
36
 
25
37
 
@@ -29,10 +41,10 @@
29
41
 
30
42
  .navbar-brand {
31
43
  display: inline-block;
32
- padding-top: .25rem;
33
- padding-bottom: .25rem;
44
+ padding-top: $navbar-brand-padding-y;
45
+ padding-bottom: $navbar-brand-padding-y;
34
46
  margin-right: $navbar-padding-x;
35
- font-size: $font-size-lg;
47
+ font-size: $navbar-brand-font-size;
36
48
  line-height: inherit;
37
49
  white-space: nowrap;
38
50
 
@@ -57,6 +69,11 @@
57
69
  padding-right: 0;
58
70
  padding-left: 0;
59
71
  }
72
+
73
+ .dropdown-menu {
74
+ position: static;
75
+ float: none;
76
+ }
60
77
  }
61
78
 
62
79
 
@@ -66,8 +83,8 @@
66
83
 
67
84
  .navbar-text {
68
85
  display: inline-block;
69
- padding-top: .425rem;
70
- padding-bottom: .425rem;
86
+ padding-top: $nav-link-padding-y;
87
+ padding-bottom: $nav-link-padding-y;
71
88
  }
72
89
 
73
90
 
@@ -76,9 +93,18 @@
76
93
  // Custom styles for responsive collapsing and toggling of navbar contents.
77
94
  // Powered by the collapse Bootstrap JavaScript plugin.
78
95
 
96
+ // When collapsed, prevent the toggleable navbar contents from appearing in
97
+ // the default flexbox row orienation. Requires the use of `flex-wrap: wrap`
98
+ // on the `.navbar` parent.
99
+ .navbar-collapse {
100
+ flex-basis: 100%;
101
+ // For always expanded or extra full navbars, ensure content aligns itself
102
+ // properly vertically. Can be easily overridden with flex utilities.
103
+ align-items: center;
104
+ }
105
+
79
106
  // Button for toggling the navbar when in its collapsed state
80
107
  .navbar-toggler {
81
- align-self: flex-start; // Prevent toggler from growing to full width when it's the only visible navbar child
82
108
  padding: $navbar-toggler-padding-y $navbar-toggler-padding-x;
83
109
  font-size: $navbar-toggler-font-size;
84
110
  line-height: 1;
@@ -103,34 +129,17 @@
103
129
  background-size: 100% 100%;
104
130
  }
105
131
 
106
- // Use `position` on the toggler to prevent it from being auto placed as a flex
107
- // item and allow easy placement.
108
- .navbar-toggler-left {
109
- position: absolute;
110
- left: $navbar-padding-x;
111
- }
112
- .navbar-toggler-right {
113
- position: absolute;
114
- right: $navbar-padding-x;
115
- }
116
-
117
- // Generate series of `.navbar-toggleable-*` responsive classes for configuring
132
+ // Generate series of `.navbar-expand-*` responsive classes for configuring
118
133
  // where your navbar collapses.
119
- .navbar-toggleable {
134
+ .navbar-expand {
120
135
  @each $breakpoint in map-keys($grid-breakpoints) {
121
136
  $next: breakpoint-next($breakpoint, $grid-breakpoints);
122
- $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
137
+ $infix: breakpoint-infix($next, $grid-breakpoints);
123
138
 
124
139
  &#{$infix} {
125
140
  @include media-breakpoint-down($breakpoint) {
126
- .navbar-nav {
127
- .dropdown-menu {
128
- position: static;
129
- float: none;
130
- }
131
- }
132
-
133
- > .container {
141
+ > .container,
142
+ > .container-fluid {
134
143
  padding-right: 0;
135
144
  padding-left: 0;
136
145
  }
@@ -139,11 +148,20 @@
139
148
  @include media-breakpoint-up($next) {
140
149
  flex-direction: row;
141
150
  flex-wrap: nowrap;
142
- align-items: center;
151
+ justify-content: flex-start;
143
152
 
144
153
  .navbar-nav {
145
154
  flex-direction: row;
146
155
 
156
+ .dropdown-menu {
157
+ position: absolute;
158
+ }
159
+
160
+ .dropdown-menu-right {
161
+ right: 0;
162
+ left: auto; // Reset the default from `.dropdown-menu`
163
+ }
164
+
147
165
  .nav-link {
148
166
  padding-right: .5rem;
149
167
  padding-left: .5rem;
@@ -151,16 +169,14 @@
151
169
  }
152
170
 
153
171
  // For nesting containers, have to redeclare for alignment purposes
154
- > .container {
155
- display: flex;
172
+ > .container,
173
+ > .container-fluid {
156
174
  flex-wrap: nowrap;
157
- align-items: center;
158
175
  }
159
176
 
160
177
  // scss-lint:disable ImportantRule
161
178
  .navbar-collapse {
162
179
  display: flex !important;
163
- width: 100%;
164
180
  }
165
181
  // scss-lint:enable ImportantRule
166
182
 
@@ -179,8 +195,7 @@
179
195
 
180
196
  // Dark links against a light background
181
197
  .navbar-light {
182
- .navbar-brand,
183
- .navbar-toggler {
198
+ .navbar-brand {
184
199
  color: $navbar-light-active-color;
185
200
 
186
201
  @include hover-focus {
@@ -201,20 +216,21 @@
201
216
  }
202
217
  }
203
218
 
204
- .open > .nav-link,
219
+ .show > .nav-link,
205
220
  .active > .nav-link,
206
- .nav-link.open,
221
+ .nav-link.show,
207
222
  .nav-link.active {
208
223
  color: $navbar-light-active-color;
209
224
  }
210
225
  }
211
226
 
212
227
  .navbar-toggler {
213
- border-color: $navbar-light-toggler-border;
228
+ color: $navbar-light-color;
229
+ border-color: $navbar-light-toggler-border-color;
214
230
  }
215
231
 
216
232
  .navbar-toggler-icon {
217
- background-image: $navbar-light-toggler-bg;
233
+ background-image: $navbar-light-toggler-icon-bg;
218
234
  }
219
235
 
220
236
  .navbar-text {
@@ -223,46 +239,46 @@
223
239
  }
224
240
 
225
241
  // White links against a dark background
226
- .navbar-inverse {
227
- .navbar-brand,
228
- .navbar-toggler {
229
- color: $navbar-inverse-active-color;
242
+ .navbar-dark {
243
+ .navbar-brand {
244
+ color: $navbar-dark-active-color;
230
245
 
231
246
  @include hover-focus {
232
- color: $navbar-inverse-active-color;
247
+ color: $navbar-dark-active-color;
233
248
  }
234
249
  }
235
250
 
236
251
  .navbar-nav {
237
252
  .nav-link {
238
- color: $navbar-inverse-color;
253
+ color: $navbar-dark-color;
239
254
 
240
255
  @include hover-focus {
241
- color: $navbar-inverse-hover-color;
256
+ color: $navbar-dark-hover-color;
242
257
  }
243
258
 
244
259
  &.disabled {
245
- color: $navbar-inverse-disabled-color;
260
+ color: $navbar-dark-disabled-color;
246
261
  }
247
262
  }
248
263
 
249
- .open > .nav-link,
264
+ .show > .nav-link,
250
265
  .active > .nav-link,
251
- .nav-link.open,
266
+ .nav-link.show,
252
267
  .nav-link.active {
253
- color: $navbar-inverse-active-color;
268
+ color: $navbar-dark-active-color;
254
269
  }
255
270
  }
256
271
 
257
272
  .navbar-toggler {
258
- border-color: $navbar-inverse-toggler-border;
273
+ color: $navbar-dark-color;
274
+ border-color: $navbar-dark-toggler-border-color;
259
275
  }
260
276
 
261
277
  .navbar-toggler-icon {
262
- background-image: $navbar-inverse-toggler-bg;
278
+ background-image: $navbar-dark-toggler-icon-bg;
263
279
  }
264
280
 
265
281
  .navbar-text {
266
- color: $navbar-inverse-color;
282
+ color: $navbar-dark-color;
267
283
  }
268
284
  }