administrate-bootstrap-theme 1.0.6 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/administrate-bootstrap-theme/bootstrap.bundle.js +2503 -3001
  3. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_accordion.scss +73 -33
  4. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_alert.scss +25 -14
  5. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_badge.scss +14 -5
  6. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_breadcrumb.scss +22 -10
  7. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_button-group.scss +6 -3
  8. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_buttons.scss +133 -28
  9. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_card.scss +60 -37
  10. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_carousel.scss +22 -15
  11. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_close.scss +33 -10
  12. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_containers.scss +1 -1
  13. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_dropdown.scss +86 -76
  14. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_functions.scss +10 -10
  15. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_grid.scss +9 -3
  16. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_helpers.scss +3 -0
  17. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_list-group.scss +60 -37
  18. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_maps.scss +174 -0
  19. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_mixins.scss +1 -2
  20. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_modal.scss +71 -44
  21. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_nav.scss +86 -28
  22. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_navbar.scss +101 -147
  23. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_offcanvas.scss +121 -61
  24. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_pagination.scss +66 -21
  25. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_placeholders.scss +1 -1
  26. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_popover.scss +90 -52
  27. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_progress.scss +30 -10
  28. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_reboot.scss +31 -45
  29. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_root.scss +155 -22
  30. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_spinners.scss +38 -22
  31. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_tables.scss +40 -24
  32. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_toasts.scss +38 -16
  33. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_tooltip.scss +60 -56
  34. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_type.scss +2 -0
  35. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_utilities.scss +209 -33
  36. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_variables-dark.scss +87 -0
  37. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_variables.scss +404 -294
  38. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap-grid.scss +4 -9
  39. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap-reboot.scss +4 -7
  40. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap-utilities.scss +7 -6
  41. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap.scss +5 -6
  42. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_floating-labels.scss +37 -5
  43. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-check.scss +51 -14
  44. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-control.scss +36 -41
  45. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-range.scss +3 -3
  46. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-select.scss +12 -4
  47. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_input-group.scss +20 -9
  48. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/helpers/_color-bg.scss +7 -0
  49. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/helpers/_colored-links.scss +20 -2
  50. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/helpers/_focus-ring.scss +5 -0
  51. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/helpers/_icon-link.scss +25 -0
  52. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/helpers/_position.scss +7 -1
  53. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/helpers/_ratio.scss +2 -2
  54. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/helpers/_vr.scss +2 -2
  55. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_alert.scss +11 -4
  56. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_banner.scss +7 -0
  57. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_breakpoints.scss +8 -8
  58. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_buttons.scss +32 -95
  59. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_caret.scss +30 -25
  60. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_color-mode.scss +21 -0
  61. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_container.scss +4 -2
  62. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_forms.scss +38 -19
  63. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_gradients.scss +1 -1
  64. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_grid.scss +14 -14
  65. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_list-group.scss +2 -0
  66. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_pagination.scss +4 -25
  67. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_reset-text.scss +1 -1
  68. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_table-variants.scss +12 -9
  69. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_utilities.scss +14 -6
  70. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_visually-hidden.scss +5 -1
  71. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/vendor/_rfs.scss +23 -29
  72. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_content_body.scss +21 -7
  73. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_navigation.scss +4 -0
  74. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_pagination.scss +11 -3
  75. data/lib/administrate-bootstrap-theme/version.rb +2 -2
  76. data/package.json +2 -2
  77. metadata +24 -3
@@ -2,6 +2,12 @@
2
2
  //
3
3
  // Rows contain your columns.
4
4
 
5
+ :root {
6
+ @each $name, $value in $grid-breakpoints {
7
+ --#{$prefix}breakpoint-#{$name}: #{$value};
8
+ }
9
+ }
10
+
5
11
  @if $enable-grid-classes {
6
12
  .row {
7
13
  @include make-row();
@@ -15,9 +21,9 @@
15
21
  @if $enable-cssgrid {
16
22
  .grid {
17
23
  display: grid;
18
- grid-template-rows: repeat(var(--#{$variable-prefix}rows, 1), 1fr);
19
- grid-template-columns: repeat(var(--#{$variable-prefix}columns, #{$grid-columns}), 1fr);
20
- gap: var(--#{$variable-prefix}gap, #{$grid-gutter-width});
24
+ grid-template-rows: repeat(var(--#{$prefix}rows, 1), 1fr);
25
+ grid-template-columns: repeat(var(--#{$prefix}columns, #{$grid-columns}), 1fr);
26
+ gap: var(--#{$prefix}gap, #{$grid-gutter-width});
21
27
 
22
28
  @include make-cssgrid();
23
29
  }
@@ -1,5 +1,8 @@
1
1
  @import "helpers/clearfix";
2
+ @import "helpers/color-bg";
2
3
  @import "helpers/colored-links";
4
+ @import "helpers/focus-ring";
5
+ @import "helpers/icon-link";
3
6
  @import "helpers/ratio";
4
7
  @import "helpers/position";
5
8
  @import "helpers/stacks";
@@ -3,27 +3,46 @@
3
3
  // Easily usable on <ul>, <ol>, or <div>.
4
4
 
5
5
  .list-group {
6
+ // scss-docs-start list-group-css-vars
7
+ --#{$prefix}list-group-color: #{$list-group-color};
8
+ --#{$prefix}list-group-bg: #{$list-group-bg};
9
+ --#{$prefix}list-group-border-color: #{$list-group-border-color};
10
+ --#{$prefix}list-group-border-width: #{$list-group-border-width};
11
+ --#{$prefix}list-group-border-radius: #{$list-group-border-radius};
12
+ --#{$prefix}list-group-item-padding-x: #{$list-group-item-padding-x};
13
+ --#{$prefix}list-group-item-padding-y: #{$list-group-item-padding-y};
14
+ --#{$prefix}list-group-action-color: #{$list-group-action-color};
15
+ --#{$prefix}list-group-action-hover-color: #{$list-group-action-hover-color};
16
+ --#{$prefix}list-group-action-hover-bg: #{$list-group-hover-bg};
17
+ --#{$prefix}list-group-action-active-color: #{$list-group-action-active-color};
18
+ --#{$prefix}list-group-action-active-bg: #{$list-group-action-active-bg};
19
+ --#{$prefix}list-group-disabled-color: #{$list-group-disabled-color};
20
+ --#{$prefix}list-group-disabled-bg: #{$list-group-disabled-bg};
21
+ --#{$prefix}list-group-active-color: #{$list-group-active-color};
22
+ --#{$prefix}list-group-active-bg: #{$list-group-active-bg};
23
+ --#{$prefix}list-group-active-border-color: #{$list-group-active-border-color};
24
+ // scss-docs-end list-group-css-vars
25
+
6
26
  display: flex;
7
27
  flex-direction: column;
8
28
 
9
29
  // No need to set list-style: none; since .list-group-item is block level
10
30
  padding-left: 0; // reset padding because ul and ol
11
31
  margin-bottom: 0;
12
- @include border-radius($list-group-border-radius);
32
+ @include border-radius(var(--#{$prefix}list-group-border-radius));
13
33
  }
14
34
 
15
35
  .list-group-numbered {
16
36
  list-style-type: none;
17
37
  counter-reset: section;
18
38
 
19
- > li::before {
39
+ > .list-group-item::before {
20
40
  // Increments only this instance of the section counter
21
41
  content: counters(section, ".") ". ";
22
42
  counter-increment: section;
23
43
  }
24
44
  }
25
45
 
26
-
27
46
  // Interactive list items
28
47
  //
29
48
  // Use anchor or button elements instead of `li`s or `div`s to create interactive
@@ -31,25 +50,24 @@
31
50
 
32
51
  .list-group-item-action {
33
52
  width: 100%; // For `<button>`s (anchors become 100% by default though)
34
- color: $list-group-action-color;
53
+ color: var(--#{$prefix}list-group-action-color);
35
54
  text-align: inherit; // For `<button>`s (anchors inherit)
36
55
 
37
56
  // Hover state
38
57
  &:hover,
39
58
  &:focus {
40
59
  z-index: 1; // Place hover/focus items above their siblings for proper border styling
41
- color: $list-group-action-hover-color;
60
+ color: var(--#{$prefix}list-group-action-hover-color);
42
61
  text-decoration: none;
43
- background-color: $list-group-hover-bg;
62
+ background-color: var(--#{$prefix}list-group-action-hover-bg);
44
63
  }
45
64
 
46
65
  &:active {
47
- color: $list-group-action-active-color;
48
- background-color: $list-group-action-active-bg;
66
+ color: var(--#{$prefix}list-group-action-active-color);
67
+ background-color: var(--#{$prefix}list-group-action-active-bg);
49
68
  }
50
69
  }
51
70
 
52
-
53
71
  // Individual list items
54
72
  //
55
73
  // Use on `li`s or `div`s within the `.list-group` parent.
@@ -57,11 +75,11 @@
57
75
  .list-group-item {
58
76
  position: relative;
59
77
  display: block;
60
- padding: $list-group-item-padding-y $list-group-item-padding-x;
61
- color: $list-group-color;
78
+ padding: var(--#{$prefix}list-group-item-padding-y) var(--#{$prefix}list-group-item-padding-x);
79
+ color: var(--#{$prefix}list-group-color);
62
80
  text-decoration: if($link-decoration == none, null, none);
63
- background-color: $list-group-bg;
64
- border: $list-group-border-width solid $list-group-border-color;
81
+ background-color: var(--#{$prefix}list-group-bg);
82
+ border: var(--#{$prefix}list-group-border-width) solid var(--#{$prefix}list-group-border-color);
65
83
 
66
84
  &:first-child {
67
85
  @include border-top-radius(inherit);
@@ -73,30 +91,30 @@
73
91
 
74
92
  &.disabled,
75
93
  &:disabled {
76
- color: $list-group-disabled-color;
94
+ color: var(--#{$prefix}list-group-disabled-color);
77
95
  pointer-events: none;
78
- background-color: $list-group-disabled-bg;
96
+ background-color: var(--#{$prefix}list-group-disabled-bg);
79
97
  }
80
98
 
81
99
  // Include both here for `<a>`s and `<button>`s
82
100
  &.active {
83
101
  z-index: 2; // Place active items above their siblings for proper border styling
84
- color: $list-group-active-color;
85
- background-color: $list-group-active-bg;
86
- border-color: $list-group-active-border-color;
102
+ color: var(--#{$prefix}list-group-active-color);
103
+ background-color: var(--#{$prefix}list-group-active-bg);
104
+ border-color: var(--#{$prefix}list-group-active-border-color);
87
105
  }
88
106
 
89
- & + & {
107
+ // stylelint-disable-next-line scss/selector-no-redundant-nesting-selector
108
+ & + .list-group-item {
90
109
  border-top-width: 0;
91
110
 
92
111
  &.active {
93
- margin-top: -$list-group-border-width;
94
- border-top-width: $list-group-border-width;
112
+ margin-top: calc(-1 * var(--#{$prefix}list-group-border-width)); // stylelint-disable-line function-disallowed-list
113
+ border-top-width: var(--#{$prefix}list-group-border-width);
95
114
  }
96
115
  }
97
116
  }
98
117
 
99
-
100
118
  // Horizontal
101
119
  //
102
120
  // Change the layout of list group items from vertical (default) to horizontal.
@@ -109,13 +127,13 @@
109
127
  flex-direction: row;
110
128
 
111
129
  > .list-group-item {
112
- &:first-child {
113
- @include border-bottom-start-radius($list-group-border-radius);
130
+ &:first-child:not(:last-child) {
131
+ @include border-bottom-start-radius(var(--#{$prefix}list-group-border-radius));
114
132
  @include border-top-end-radius(0);
115
133
  }
116
134
 
117
- &:last-child {
118
- @include border-top-end-radius($list-group-border-radius);
135
+ &:last-child:not(:first-child) {
136
+ @include border-top-end-radius(var(--#{$prefix}list-group-border-radius));
119
137
  @include border-bottom-start-radius(0);
120
138
  }
121
139
 
@@ -124,12 +142,12 @@
124
142
  }
125
143
 
126
144
  + .list-group-item {
127
- border-top-width: $list-group-border-width;
145
+ border-top-width: var(--#{$prefix}list-group-border-width);
128
146
  border-left-width: 0;
129
147
 
130
148
  &.active {
131
- margin-left: -$list-group-border-width;
132
- border-left-width: $list-group-border-width;
149
+ margin-left: calc(-1 * var(--#{$prefix}list-group-border-width)); // stylelint-disable-line function-disallowed-list
150
+ border-left-width: var(--#{$prefix}list-group-border-width);
133
151
  }
134
152
  }
135
153
  }
@@ -147,7 +165,7 @@
147
165
  @include border-radius(0);
148
166
 
149
167
  > .list-group-item {
150
- border-width: 0 0 $list-group-border-width;
168
+ border-width: 0 0 var(--#{$prefix}list-group-border-width);
151
169
 
152
170
  &:last-child {
153
171
  border-bottom-width: 0;
@@ -162,13 +180,18 @@
162
180
  // Add modifier classes to change text and background color on individual items.
163
181
  // Organizationally, this must come after the `:hover` states.
164
182
 
165
- @each $state, $value in $theme-colors {
166
- $list-group-variant-bg: shift-color($value, $list-group-item-bg-scale);
167
- $list-group-variant-color: shift-color($value, $list-group-item-color-scale);
168
- @if (contrast-ratio($list-group-variant-bg, $list-group-variant-color) < $min-contrast-ratio) {
169
- $list-group-variant-color: mix($value, color-contrast($list-group-variant-bg), abs($list-group-item-color-scale));
183
+ @each $state in map-keys($theme-colors) {
184
+ .list-group-item-#{$state} {
185
+ --#{$prefix}list-group-color: var(--#{$prefix}#{$state}-text-emphasis);
186
+ --#{$prefix}list-group-bg: var(--#{$prefix}#{$state}-bg-subtle);
187
+ --#{$prefix}list-group-border-color: var(--#{$prefix}#{$state}-border-subtle);
188
+ --#{$prefix}list-group-action-hover-color: var(--#{$prefix}emphasis-color);
189
+ --#{$prefix}list-group-action-hover-bg: var(--#{$prefix}#{$state}-border-subtle);
190
+ --#{$prefix}list-group-action-active-color: var(--#{$prefix}emphasis-color);
191
+ --#{$prefix}list-group-action-active-bg: var(--#{$prefix}#{$state}-border-subtle);
192
+ --#{$prefix}list-group-active-color: var(--#{$prefix}#{$state}-bg-subtle);
193
+ --#{$prefix}list-group-active-bg: var(--#{$prefix}#{$state}-text-emphasis);
194
+ --#{$prefix}list-group-active-border-color: var(--#{$prefix}#{$state}-text-emphasis);
170
195
  }
171
-
172
- @include list-group-item-variant($state, $list-group-variant-bg, $list-group-variant-color);
173
196
  }
174
197
  // scss-docs-end list-group-modifiers
@@ -0,0 +1,174 @@
1
+ // Re-assigned maps
2
+ //
3
+ // Placed here so that others can override the default Sass maps and see automatic updates to utilities and more.
4
+
5
+ // scss-docs-start theme-colors-rgb
6
+ $theme-colors-rgb: map-loop($theme-colors, to-rgb, "$value") !default;
7
+ // scss-docs-end theme-colors-rgb
8
+
9
+ // scss-docs-start theme-text-map
10
+ $theme-colors-text: (
11
+ "primary": $primary-text-emphasis,
12
+ "secondary": $secondary-text-emphasis,
13
+ "success": $success-text-emphasis,
14
+ "info": $info-text-emphasis,
15
+ "warning": $warning-text-emphasis,
16
+ "danger": $danger-text-emphasis,
17
+ "light": $light-text-emphasis,
18
+ "dark": $dark-text-emphasis,
19
+ ) !default;
20
+ // scss-docs-end theme-text-map
21
+
22
+ // scss-docs-start theme-bg-subtle-map
23
+ $theme-colors-bg-subtle: (
24
+ "primary": $primary-bg-subtle,
25
+ "secondary": $secondary-bg-subtle,
26
+ "success": $success-bg-subtle,
27
+ "info": $info-bg-subtle,
28
+ "warning": $warning-bg-subtle,
29
+ "danger": $danger-bg-subtle,
30
+ "light": $light-bg-subtle,
31
+ "dark": $dark-bg-subtle,
32
+ ) !default;
33
+ // scss-docs-end theme-bg-subtle-map
34
+
35
+ // scss-docs-start theme-border-subtle-map
36
+ $theme-colors-border-subtle: (
37
+ "primary": $primary-border-subtle,
38
+ "secondary": $secondary-border-subtle,
39
+ "success": $success-border-subtle,
40
+ "info": $info-border-subtle,
41
+ "warning": $warning-border-subtle,
42
+ "danger": $danger-border-subtle,
43
+ "light": $light-border-subtle,
44
+ "dark": $dark-border-subtle,
45
+ ) !default;
46
+ // scss-docs-end theme-border-subtle-map
47
+
48
+ $theme-colors-text-dark: null !default;
49
+ $theme-colors-bg-subtle-dark: null !default;
50
+ $theme-colors-border-subtle-dark: null !default;
51
+
52
+ @if $enable-dark-mode {
53
+ // scss-docs-start theme-text-dark-map
54
+ $theme-colors-text-dark: (
55
+ "primary": $primary-text-emphasis-dark,
56
+ "secondary": $secondary-text-emphasis-dark,
57
+ "success": $success-text-emphasis-dark,
58
+ "info": $info-text-emphasis-dark,
59
+ "warning": $warning-text-emphasis-dark,
60
+ "danger": $danger-text-emphasis-dark,
61
+ "light": $light-text-emphasis-dark,
62
+ "dark": $dark-text-emphasis-dark,
63
+ ) !default;
64
+ // scss-docs-end theme-text-dark-map
65
+
66
+ // scss-docs-start theme-bg-subtle-dark-map
67
+ $theme-colors-bg-subtle-dark: (
68
+ "primary": $primary-bg-subtle-dark,
69
+ "secondary": $secondary-bg-subtle-dark,
70
+ "success": $success-bg-subtle-dark,
71
+ "info": $info-bg-subtle-dark,
72
+ "warning": $warning-bg-subtle-dark,
73
+ "danger": $danger-bg-subtle-dark,
74
+ "light": $light-bg-subtle-dark,
75
+ "dark": $dark-bg-subtle-dark,
76
+ ) !default;
77
+ // scss-docs-end theme-bg-subtle-dark-map
78
+
79
+ // scss-docs-start theme-border-subtle-dark-map
80
+ $theme-colors-border-subtle-dark: (
81
+ "primary": $primary-border-subtle-dark,
82
+ "secondary": $secondary-border-subtle-dark,
83
+ "success": $success-border-subtle-dark,
84
+ "info": $info-border-subtle-dark,
85
+ "warning": $warning-border-subtle-dark,
86
+ "danger": $danger-border-subtle-dark,
87
+ "light": $light-border-subtle-dark,
88
+ "dark": $dark-border-subtle-dark,
89
+ ) !default;
90
+ // scss-docs-end theme-border-subtle-dark-map
91
+ }
92
+
93
+ // Utilities maps
94
+ //
95
+ // Extends the default `$theme-colors` maps to help create our utilities.
96
+
97
+ // Come v6, we'll de-dupe these variables. Until then, for backward compatibility, we keep them to reassign.
98
+ // scss-docs-start utilities-colors
99
+ $utilities-colors: $theme-colors-rgb !default;
100
+ // scss-docs-end utilities-colors
101
+
102
+ // scss-docs-start utilities-text-colors
103
+ $utilities-text: map-merge(
104
+ $utilities-colors,
105
+ (
106
+ "black": to-rgb($black),
107
+ "white": to-rgb($white),
108
+ "body": to-rgb($body-color)
109
+ )
110
+ ) !default;
111
+ $utilities-text-colors: map-loop($utilities-text, rgba-css-var, "$key", "text") !default;
112
+
113
+ $utilities-text-emphasis-colors: (
114
+ "primary-emphasis": var(--#{$prefix}primary-text-emphasis),
115
+ "secondary-emphasis": var(--#{$prefix}secondary-text-emphasis),
116
+ "success-emphasis": var(--#{$prefix}success-text-emphasis),
117
+ "info-emphasis": var(--#{$prefix}info-text-emphasis),
118
+ "warning-emphasis": var(--#{$prefix}warning-text-emphasis),
119
+ "danger-emphasis": var(--#{$prefix}danger-text-emphasis),
120
+ "light-emphasis": var(--#{$prefix}light-text-emphasis),
121
+ "dark-emphasis": var(--#{$prefix}dark-text-emphasis)
122
+ ) !default;
123
+ // scss-docs-end utilities-text-colors
124
+
125
+ // scss-docs-start utilities-bg-colors
126
+ $utilities-bg: map-merge(
127
+ $utilities-colors,
128
+ (
129
+ "black": to-rgb($black),
130
+ "white": to-rgb($white),
131
+ "body": to-rgb($body-bg)
132
+ )
133
+ ) !default;
134
+ $utilities-bg-colors: map-loop($utilities-bg, rgba-css-var, "$key", "bg") !default;
135
+
136
+ $utilities-bg-subtle: (
137
+ "primary-subtle": var(--#{$prefix}primary-bg-subtle),
138
+ "secondary-subtle": var(--#{$prefix}secondary-bg-subtle),
139
+ "success-subtle": var(--#{$prefix}success-bg-subtle),
140
+ "info-subtle": var(--#{$prefix}info-bg-subtle),
141
+ "warning-subtle": var(--#{$prefix}warning-bg-subtle),
142
+ "danger-subtle": var(--#{$prefix}danger-bg-subtle),
143
+ "light-subtle": var(--#{$prefix}light-bg-subtle),
144
+ "dark-subtle": var(--#{$prefix}dark-bg-subtle)
145
+ ) !default;
146
+ // scss-docs-end utilities-bg-colors
147
+
148
+ // scss-docs-start utilities-border-colors
149
+ $utilities-border: map-merge(
150
+ $utilities-colors,
151
+ (
152
+ "black": to-rgb($black),
153
+ "white": to-rgb($white)
154
+ )
155
+ ) !default;
156
+ $utilities-border-colors: map-loop($utilities-border, rgba-css-var, "$key", "border") !default;
157
+
158
+ $utilities-border-subtle: (
159
+ "primary-subtle": var(--#{$prefix}primary-border-subtle),
160
+ "secondary-subtle": var(--#{$prefix}secondary-border-subtle),
161
+ "success-subtle": var(--#{$prefix}success-border-subtle),
162
+ "info-subtle": var(--#{$prefix}info-border-subtle),
163
+ "warning-subtle": var(--#{$prefix}warning-border-subtle),
164
+ "danger-subtle": var(--#{$prefix}danger-border-subtle),
165
+ "light-subtle": var(--#{$prefix}light-border-subtle),
166
+ "dark-subtle": var(--#{$prefix}dark-border-subtle)
167
+ ) !default;
168
+ // scss-docs-end utilities-border-colors
169
+
170
+ $utilities-links-underline: map-loop($utilities-colors, rgba-css-var, "$key", "link-underline") !default;
171
+
172
+ $negative-spacers: if($enable-negative-margins, negativify-map($spacers), null) !default;
173
+
174
+ $gutters: $spacers !default;
@@ -10,6 +10,7 @@
10
10
 
11
11
  // Helpers
12
12
  @import "mixins/breakpoints";
13
+ @import "mixins/color-mode";
13
14
  @import "mixins/color-scheme";
14
15
  @import "mixins/image";
15
16
  @import "mixins/resize";
@@ -21,13 +22,11 @@
21
22
  @import "mixins/utilities";
22
23
 
23
24
  // Components
24
- @import "mixins/alert";
25
25
  @import "mixins/backdrop";
26
26
  @import "mixins/buttons";
27
27
  @import "mixins/caret";
28
28
  @import "mixins/pagination";
29
29
  @import "mixins/lists";
30
- @import "mixins/list-group";
31
30
  @import "mixins/forms";
32
31
  @import "mixins/table-variants";
33
32
 
@@ -1,3 +1,5 @@
1
+ // stylelint-disable function-disallowed-list
2
+
1
3
  // .modal-open - body class for killing the scroll
2
4
  // .modal - container to scroll within
3
5
  // .modal-dialog - positioning shell for the actual modal
@@ -6,10 +8,34 @@
6
8
 
7
9
  // Container that the modal scrolls within
8
10
  .modal {
11
+ // scss-docs-start modal-css-vars
12
+ --#{$prefix}modal-zindex: #{$zindex-modal};
13
+ --#{$prefix}modal-width: #{$modal-md};
14
+ --#{$prefix}modal-padding: #{$modal-inner-padding};
15
+ --#{$prefix}modal-margin: #{$modal-dialog-margin};
16
+ --#{$prefix}modal-color: #{$modal-content-color};
17
+ --#{$prefix}modal-bg: #{$modal-content-bg};
18
+ --#{$prefix}modal-border-color: #{$modal-content-border-color};
19
+ --#{$prefix}modal-border-width: #{$modal-content-border-width};
20
+ --#{$prefix}modal-border-radius: #{$modal-content-border-radius};
21
+ --#{$prefix}modal-box-shadow: #{$modal-content-box-shadow-xs};
22
+ --#{$prefix}modal-inner-border-radius: #{$modal-content-inner-border-radius};
23
+ --#{$prefix}modal-header-padding-x: #{$modal-header-padding-x};
24
+ --#{$prefix}modal-header-padding-y: #{$modal-header-padding-y};
25
+ --#{$prefix}modal-header-padding: #{$modal-header-padding}; // Todo in v6: Split this padding into x and y
26
+ --#{$prefix}modal-header-border-color: #{$modal-header-border-color};
27
+ --#{$prefix}modal-header-border-width: #{$modal-header-border-width};
28
+ --#{$prefix}modal-title-line-height: #{$modal-title-line-height};
29
+ --#{$prefix}modal-footer-gap: #{$modal-footer-margin-between};
30
+ --#{$prefix}modal-footer-bg: #{$modal-footer-bg};
31
+ --#{$prefix}modal-footer-border-color: #{$modal-footer-border-color};
32
+ --#{$prefix}modal-footer-border-width: #{$modal-footer-border-width};
33
+ // scss-docs-end modal-css-vars
34
+
9
35
  position: fixed;
10
36
  top: 0;
11
37
  left: 0;
12
- z-index: $zindex-modal;
38
+ z-index: var(--#{$prefix}modal-zindex);
13
39
  display: none;
14
40
  width: 100%;
15
41
  height: 100%;
@@ -27,7 +53,7 @@
27
53
  .modal-dialog {
28
54
  position: relative;
29
55
  width: auto;
30
- margin: $modal-dialog-margin;
56
+ margin: var(--#{$prefix}modal-margin);
31
57
  // allow clicks to pass through for custom click handling to close modal
32
58
  pointer-events: none;
33
59
 
@@ -47,7 +73,7 @@
47
73
  }
48
74
 
49
75
  .modal-dialog-scrollable {
50
- height: subtract(100%, $modal-dialog-margin * 2);
76
+ height: calc(100% - var(--#{$prefix}modal-margin) * 2);
51
77
 
52
78
  .modal-content {
53
79
  max-height: 100%;
@@ -62,7 +88,7 @@
62
88
  .modal-dialog-centered {
63
89
  display: flex;
64
90
  align-items: center;
65
- min-height: subtract(100%, $modal-dialog-margin * 2);
91
+ min-height: calc(100% - var(--#{$prefix}modal-margin) * 2);
66
92
  }
67
93
 
68
94
  // Actual modal
@@ -72,20 +98,26 @@
72
98
  flex-direction: column;
73
99
  width: 100%; // Ensure `.modal-content` extends the full width of the parent `.modal-dialog`
74
100
  // counteract the pointer-events: none; in the .modal-dialog
75
- color: $modal-content-color;
101
+ color: var(--#{$prefix}modal-color);
76
102
  pointer-events: auto;
77
- background-color: $modal-content-bg;
103
+ background-color: var(--#{$prefix}modal-bg);
78
104
  background-clip: padding-box;
79
- border: $modal-content-border-width solid $modal-content-border-color;
80
- @include border-radius($modal-content-border-radius);
81
- @include box-shadow($modal-content-box-shadow-xs);
105
+ border: var(--#{$prefix}modal-border-width) solid var(--#{$prefix}modal-border-color);
106
+ @include border-radius(var(--#{$prefix}modal-border-radius));
107
+ @include box-shadow(var(--#{$prefix}modal-box-shadow));
82
108
  // Remove focus outline from opened modal
83
109
  outline: 0;
84
110
  }
85
111
 
86
112
  // Modal background
87
113
  .modal-backdrop {
88
- @include overlay-backdrop($zindex-modal-backdrop, $modal-backdrop-bg, $modal-backdrop-opacity);
114
+ // scss-docs-start modal-backdrop-css-vars
115
+ --#{$prefix}backdrop-zindex: #{$zindex-modal-backdrop};
116
+ --#{$prefix}backdrop-bg: #{$modal-backdrop-bg};
117
+ --#{$prefix}backdrop-opacity: #{$modal-backdrop-opacity};
118
+ // scss-docs-end modal-backdrop-css-vars
119
+
120
+ @include overlay-backdrop(var(--#{$prefix}backdrop-zindex), var(--#{$prefix}backdrop-bg), var(--#{$prefix}backdrop-opacity));
89
121
  }
90
122
 
91
123
  // Modal header
@@ -94,21 +126,20 @@
94
126
  display: flex;
95
127
  flex-shrink: 0;
96
128
  align-items: center;
97
- justify-content: space-between; // Put modal header elements (title and dismiss) on opposite ends
98
- padding: $modal-header-padding;
99
- border-bottom: $modal-header-border-width solid $modal-header-border-color;
100
- @include border-top-radius($modal-content-inner-border-radius);
129
+ padding: var(--#{$prefix}modal-header-padding);
130
+ border-bottom: var(--#{$prefix}modal-header-border-width) solid var(--#{$prefix}modal-header-border-color);
131
+ @include border-top-radius(var(--#{$prefix}modal-inner-border-radius));
101
132
 
102
133
  .btn-close {
103
- padding: ($modal-header-padding-y * .5) ($modal-header-padding-x * .5);
104
- margin: ($modal-header-padding-y * -.5) ($modal-header-padding-x * -.5) ($modal-header-padding-y * -.5) auto;
134
+ padding: calc(var(--#{$prefix}modal-header-padding-y) * .5) calc(var(--#{$prefix}modal-header-padding-x) * .5);
135
+ margin: calc(-.5 * var(--#{$prefix}modal-header-padding-y)) calc(-.5 * var(--#{$prefix}modal-header-padding-x)) calc(-.5 * var(--#{$prefix}modal-header-padding-y)) auto;
105
136
  }
106
137
  }
107
138
 
108
139
  // Title text within header
109
140
  .modal-title {
110
141
  margin-bottom: 0;
111
- line-height: $modal-title-line-height;
142
+ line-height: var(--#{$prefix}modal-title-line-height);
112
143
  }
113
144
 
114
145
  // Modal body
@@ -118,60 +149,59 @@
118
149
  // Enable `flex-grow: 1` so that the body take up as much space as possible
119
150
  // when there should be a fixed height on `.modal-dialog`.
120
151
  flex: 1 1 auto;
121
- padding: $modal-inner-padding;
152
+ padding: var(--#{$prefix}modal-padding);
122
153
  }
123
154
 
124
155
  // Footer (for actions)
125
156
  .modal-footer {
126
157
  display: flex;
127
- flex-wrap: wrap;
128
158
  flex-shrink: 0;
159
+ flex-wrap: wrap;
129
160
  align-items: center; // vertically center
130
161
  justify-content: flex-end; // Right align buttons with flex property because text-align doesn't work on flex items
131
- padding: $modal-inner-padding - $modal-footer-margin-between * .5;
132
- border-top: $modal-footer-border-width solid $modal-footer-border-color;
133
- @include border-bottom-radius($modal-content-inner-border-radius);
162
+ padding: calc(var(--#{$prefix}modal-padding) - var(--#{$prefix}modal-footer-gap) * .5);
163
+ background-color: var(--#{$prefix}modal-footer-bg);
164
+ border-top: var(--#{$prefix}modal-footer-border-width) solid var(--#{$prefix}modal-footer-border-color);
165
+ @include border-bottom-radius(var(--#{$prefix}modal-inner-border-radius));
134
166
 
135
167
  // Place margin between footer elements
136
168
  // This solution is far from ideal because of the universal selector usage,
137
169
  // but is needed to fix https://github.com/twbs/bootstrap/issues/24800
138
170
  > * {
139
- margin: $modal-footer-margin-between * .5;
171
+ margin: calc(var(--#{$prefix}modal-footer-gap) * .5); // Todo in v6: replace with gap on parent class
140
172
  }
141
173
  }
142
174
 
143
175
  // Scale up the modal
144
176
  @include media-breakpoint-up(sm) {
145
- // Automatically set modal's width for larger viewports
146
- .modal-dialog {
147
- max-width: $modal-md;
148
- margin: $modal-dialog-margin-y-sm-up auto;
177
+ .modal {
178
+ --#{$prefix}modal-margin: #{$modal-dialog-margin-y-sm-up};
179
+ --#{$prefix}modal-box-shadow: #{$modal-content-box-shadow-sm-up};
149
180
  }
150
181
 
151
- .modal-dialog-scrollable {
152
- height: subtract(100%, $modal-dialog-margin-y-sm-up * 2);
153
- }
154
-
155
- .modal-dialog-centered {
156
- min-height: subtract(100%, $modal-dialog-margin-y-sm-up * 2);
182
+ // Automatically set modal's width for larger viewports
183
+ .modal-dialog {
184
+ max-width: var(--#{$prefix}modal-width);
185
+ margin-right: auto;
186
+ margin-left: auto;
157
187
  }
158
188
 
159
- .modal-content {
160
- @include box-shadow($modal-content-box-shadow-sm-up);
189
+ .modal-sm {
190
+ --#{$prefix}modal-width: #{$modal-sm};
161
191
  }
162
-
163
- .modal-sm { max-width: $modal-sm; }
164
192
  }
165
193
 
166
194
  @include media-breakpoint-up(lg) {
167
195
  .modal-lg,
168
196
  .modal-xl {
169
- max-width: $modal-lg;
197
+ --#{$prefix}modal-width: #{$modal-lg};
170
198
  }
171
199
  }
172
200
 
173
201
  @include media-breakpoint-up(xl) {
174
- .modal-xl { max-width: $modal-xl; }
202
+ .modal-xl {
203
+ --#{$prefix}modal-width: #{$modal-xl};
204
+ }
175
205
  }
176
206
 
177
207
  // scss-docs-start modal-fullscreen-loop
@@ -192,17 +222,14 @@
192
222
  @include border-radius(0);
193
223
  }
194
224
 
195
- .modal-header {
225
+ .modal-header,
226
+ .modal-footer {
196
227
  @include border-radius(0);
197
228
  }
198
229
 
199
230
  .modal-body {
200
231
  overflow-y: auto;
201
232
  }
202
-
203
- .modal-footer {
204
- @include border-radius(0);
205
- }
206
233
  }
207
234
  }
208
235
  }