administrate-bootstrap-theme 0.2.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +64 -32
  3. data/app/assets/javascripts/administrate-bootstrap-theme/{bootstrap/bootstrap.bundle.js → bootstrap.bundle.js} +910 -857
  4. data/app/assets/stylesheets/administrate-bootstrap-theme/_base.scss +2 -14
  5. data/app/assets/stylesheets/administrate-bootstrap-theme/_variables.scss +4 -0
  6. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_card.scss +7 -6
  7. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_carousel.scss +2 -2
  8. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_dropdown.scss +4 -4
  9. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_functions.scss +94 -3
  10. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_grid.scss +11 -0
  11. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_helpers.scss +2 -0
  12. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_images.scss +1 -1
  13. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_mixins.scss +1 -0
  14. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_modal.scss +5 -15
  15. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_navbar.scss +30 -1
  16. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_offcanvas.scss +8 -2
  17. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_placeholders.scss +51 -0
  18. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_popover.scss +10 -10
  19. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_reboot.scss +12 -8
  20. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_root.scss +39 -2
  21. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_tables.scss +1 -1
  22. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_toasts.scss +3 -3
  23. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_tooltip.scss +4 -4
  24. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_transitions.scss +6 -0
  25. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_utilities.scss +44 -8
  26. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_variables.scss +189 -24
  27. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap-grid.scss +1 -1
  28. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap-reboot.scss +1 -1
  29. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap-utilities.scss +1 -1
  30. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap.scss +2 -1
  31. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_floating-labels.scss +3 -1
  32. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-check.scss +1 -1
  33. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-control.scss +1 -1
  34. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-range.scss +1 -1
  35. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-select.scss +3 -0
  36. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/helpers/_stacks.scss +15 -0
  37. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/helpers/_vr.scss +8 -0
  38. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_backdrop.scss +14 -0
  39. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_buttons.scss +1 -1
  40. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_grid.scss +33 -8
  41. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_utilities.scss +27 -6
  42. data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/vendor/_rfs.scss +55 -13
  43. data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_autumn.scss +8 -0
  44. data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_default.scss +8 -0
  45. data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_forest.scss +9 -0
  46. data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_industrial.scss +8 -0
  47. data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_water.scss +8 -0
  48. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_content_body.scss +21 -1
  49. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_content_header.scss +1 -1
  50. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_form.scss +2 -0
  51. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_navigation.scss +26 -3
  52. data/app/assets/stylesheets/administrate-bootstrap-theme/components/_pagination.scss +1 -1
  53. data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_lato.scss +5 -0
  54. data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_montserrat.scss +5 -0
  55. data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_open_sans.scss +5 -0
  56. data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_roboto.scss +5 -0
  57. data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_source_sans_pro.scss +5 -0
  58. data/app/assets/stylesheets/administrate-bootstrap-theme/theme.scss +10 -61
  59. data/lib/administrate-bootstrap-theme/version.rb +2 -1
  60. data/lib/generators/administrate_bootstrap_theme/install/USAGE +10 -0
  61. data/lib/generators/administrate_bootstrap_theme/install/install_generator.rb +33 -0
  62. data/package.json +2 -3
  63. metadata +38 -10
  64. data/app/assets/javascripts/administrate-bootstrap-theme/flatpickr/flatpickr.js +0 -2673
  65. data/app/assets/javascripts/administrate-bootstrap-theme/theme.js +0 -22
  66. data/app/assets/stylesheets/administrate-bootstrap-theme/flatpickr/flatpickr.scss +0 -791
@@ -1,17 +1,3 @@
1
- // from: node_modules/bootstrap/scss
2
- @import "bootstrap/bootstrap";
3
- // from: node_modules/flatpickr/dist/flatpickr.css => flatpickr/flatpickr.scss
4
- @import "flatpickr/flatpickr";
5
- @import "selectize";
6
-
7
- @import "variables";
8
-
9
- @import "components/navigation";
10
- @import "components/content_header";
11
- @import "components/content_body";
12
- @import "components/form";
13
- @import "components/pagination";
14
-
15
1
  .app-container {
16
2
  display: flex;
17
3
  flex-wrap: nowrap;
@@ -36,6 +22,8 @@
36
22
  .main-content {
37
23
  @extend .d-flex, .flex-column;
38
24
 
25
+ background-color: $main-content-bg;
26
+ color: $main-content-fg;
39
27
  overflow-y: scroll;
40
28
  width: calc(100% - #{$navigation-width});
41
29
  }
@@ -3,3 +3,7 @@ $navigation-bg: $dark !default;
3
3
  $navigation-bg-active: $primary !default;
4
4
  $navigation-fg: $light !default;
5
5
  $navigation-width: 250px !default;
6
+
7
+ // Main content
8
+ $main-content-bg: $gray-100 !default;
9
+ $main-content-fg: $gray-900 !default;
@@ -13,6 +13,7 @@
13
13
  background-clip: border-box;
14
14
  border: $card-border-width solid $card-border-color;
15
15
  @include border-radius($card-border-radius);
16
+ @include box-shadow($card-box-shadow);
16
17
 
17
18
  > hr {
18
19
  margin-right: 0;
@@ -55,7 +56,7 @@
55
56
  }
56
57
 
57
58
  .card-subtitle {
58
- margin-top: -$card-title-spacer-y / 2;
59
+ margin-top: -$card-title-spacer-y * .5;
59
60
  margin-bottom: 0;
60
61
  }
61
62
 
@@ -65,7 +66,7 @@
65
66
 
66
67
  .card-link {
67
68
  &:hover {
68
- text-decoration: none;
69
+ text-decoration: if($link-hover-decoration == underline, none, null);
69
70
  }
70
71
 
71
72
  + .card-link {
@@ -106,9 +107,9 @@
106
107
  //
107
108
 
108
109
  .card-header-tabs {
109
- margin-right: -$card-cap-padding-x / 2;
110
+ margin-right: -$card-cap-padding-x * .5;
110
111
  margin-bottom: -$card-cap-padding-y;
111
- margin-left: -$card-cap-padding-x / 2;
112
+ margin-left: -$card-cap-padding-x * .5;
112
113
  border-bottom: 0;
113
114
 
114
115
  @if $nav-tabs-link-active-bg != $card-bg {
@@ -120,8 +121,8 @@
120
121
  }
121
122
 
122
123
  .card-header-pills {
123
- margin-right: -$card-cap-padding-x / 2;
124
- margin-left: -$card-cap-padding-x / 2;
124
+ margin-right: -$card-cap-padding-x * .5;
125
+ margin-left: -$card-cap-padding-x * .5;
125
126
  }
126
127
 
127
128
  // Card image
@@ -202,9 +202,9 @@
202
202
 
203
203
  .carousel-caption {
204
204
  position: absolute;
205
- right: (100% - $carousel-caption-width) / 2;
205
+ right: (100% - $carousel-caption-width) * .5;
206
206
  bottom: $carousel-caption-spacer;
207
- left: (100% - $carousel-caption-width) / 2;
207
+ left: (100% - $carousel-caption-width) * .5;
208
208
  padding-top: $carousel-caption-padding-y;
209
209
  padding-bottom: $carousel-caption-padding-y;
210
210
  color: $carousel-caption-color;
@@ -50,8 +50,8 @@
50
50
  --bs-position: start;
51
51
 
52
52
  &[data-bs-popper] {
53
- right: auto #{"/* rtl:ignore */"};
54
- left: 0 #{"/* rtl:ignore */"};
53
+ right: auto;
54
+ left: 0;
55
55
  }
56
56
  }
57
57
 
@@ -59,8 +59,8 @@
59
59
  --bs-position: end;
60
60
 
61
61
  &[data-bs-popper] {
62
- right: 0 #{"/* rtl:ignore */"};
63
- left: auto #{"/* rtl:ignore */"};
62
+ right: 0;
63
+ left: auto;
64
64
  }
65
65
  }
66
66
  }
@@ -32,6 +32,41 @@
32
32
  }
33
33
  }
34
34
 
35
+ // Colors
36
+ @function to-rgb($value) {
37
+ @return red($value), green($value), blue($value);
38
+ }
39
+
40
+ @function rgba-css-var($identifier, $target) {
41
+ @return rgba(var(--#{$variable-prefix}#{$identifier}-rgb), var(--#{$variable-prefix}#{$target}-opacity));
42
+ }
43
+
44
+ // stylelint-disable scss/dollar-variable-pattern
45
+ @function map-loop($map, $func, $args...) {
46
+ $_map: ();
47
+
48
+ @each $key, $value in $map {
49
+ // allow to pass the $key and $value of the map as an function argument
50
+ $_args: ();
51
+ @each $arg in $args {
52
+ $_args: append($_args, if($arg == "$key", $key, if($arg == "$value", $value, $arg)));
53
+ }
54
+
55
+ $_map: map-merge($_map, ($key: call(get-function($func), $_args...)));
56
+ }
57
+
58
+ @return $_map;
59
+ }
60
+ // stylelint-enable scss/dollar-variable-pattern
61
+
62
+ @function varify($list) {
63
+ $result: null;
64
+ @each $entry in $list {
65
+ $result: append($result, var(--#{$variable-prefix}#{$entry}), space);
66
+ }
67
+ @return $result;
68
+ }
69
+
35
70
  // Internal Bootstrap function to turn maps into its negative variant.
36
71
  // It prefixes the keys with `n` and makes the value negative.
37
72
  @function negativify-map($map) {
@@ -55,6 +90,16 @@
55
90
  @return $result;
56
91
  }
57
92
 
93
+ // Merge multiple maps
94
+ @function map-merge-multiple($maps...) {
95
+ $merged-maps: ();
96
+
97
+ @each $map in $maps {
98
+ $merged-maps: map-merge($merged-maps, $map);
99
+ }
100
+ @return $merged-maps;
101
+ }
102
+
58
103
  // Replace `$search` with `$replace` in `$string`
59
104
  // Used on our SVG icon backgrounds for custom forms.
60
105
  //
@@ -95,7 +140,7 @@
95
140
  // Color contrast
96
141
  // See https://github.com/twbs/bootstrap/pull/30168
97
142
 
98
- // A list of pre-calculated numbers of pow(($value / 255 + .055) / 1.055, 2.4). (from 0 to 255)
143
+ // A list of pre-calculated numbers of pow(divide((divide($value, 255) + .055), 1.055), 2.4). (from 0 to 255)
99
144
  // stylelint-disable-next-line scss/dollar-variable-default, scss/dollar-variable-pattern
100
145
  $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003 .0033 .0037 .004 .0044 .0048 .0052 .0056 .006 .0065 .007 .0075 .008 .0086 .0091 .0097 .0103 .011 .0116 .0123 .013 .0137 .0144 .0152 .016 .0168 .0176 .0185 .0194 .0203 .0212 .0222 .0232 .0242 .0252 .0262 .0273 .0284 .0296 .0307 .0319 .0331 .0343 .0356 .0369 .0382 .0395 .0409 .0423 .0437 .0452 .0467 .0482 .0497 .0513 .0529 .0545 .0561 .0578 .0595 .0612 .063 .0648 .0666 .0685 .0704 .0723 .0742 .0762 .0782 .0802 .0823 .0844 .0865 .0887 .0908 .0931 .0953 .0976 .0999 .1022 .1046 .107 .1095 .1119 .1144 .117 .1195 .1221 .1248 .1274 .1301 .1329 .1356 .1384 .1413 .1441 .147 .15 .1529 .1559 .159 .162 .1651 .1683 .1714 .1746 .1779 .1812 .1845 .1878 .1912 .1946 .1981 .2016 .2051 .2086 .2122 .2159 .2195 .2232 .227 .2307 .2346 .2384 .2423 .2462 .2502 .2542 .2582 .2623 .2664 .2705 .2747 .2789 .2831 .2874 .2918 .2961 .3005 .305 .3095 .314 .3185 .3231 .3278 .3325 .3372 .3419 .3467 .3515 .3564 .3613 .3663 .3712 .3763 .3813 .3864 .3916 .3968 .402 .4072 .4125 .4179 .4233 .4287 .4342 .4397 .4452 .4508 .4564 .4621 .4678 .4735 .4793 .4851 .491 .4969 .5029 .5089 .5149 .521 .5271 .5333 .5395 .5457 .552 .5583 .5647 .5711 .5776 .5841 .5906 .5972 .6038 .6105 .6172 .624 .6308 .6376 .6445 .6514 .6584 .6654 .6724 .6795 .6867 .6939 .7011 .7084 .7157 .7231 .7305 .7379 .7454 .7529 .7605 .7682 .7758 .7835 .7913 .7991 .807 .8148 .8228 .8308 .8388 .8469 .855 .8632 .8714 .8796 .8879 .8963 .9047 .9131 .9216 .9301 .9387 .9473 .956 .9647 .9734 .9823 .9911 1;
101
146
 
@@ -123,7 +168,7 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003
123
168
  $l1: luminance($background);
124
169
  $l2: luminance(opaque($background, $foreground));
125
170
 
126
- @return if($l1 > $l2, ($l1 + .05) / ($l2 + .05), ($l2 + .05) / ($l1 + .05));
171
+ @return if($l1 > $l2, divide($l1 + .05, $l2 + .05), divide($l2 + .05, $l1 + .05));
127
172
  }
128
173
 
129
174
  // Return WCAG2.0 relative luminance
@@ -137,7 +182,7 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003
137
182
  );
138
183
 
139
184
  @each $name, $value in $rgb {
140
- $value: if($value / 255 < .03928, $value / 255 / 12.92, nth($_luminance-list, $value + 1));
185
+ $value: if(divide($value, 255) < .03928, divide(divide($value, 255), 12.92), nth($_luminance-list, $value + 1));
141
186
  $rgb: map-merge($rgb, ($name: $value));
142
187
  }
143
188
 
@@ -201,5 +246,51 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003
201
246
  @return $value1 - $value2;
202
247
  }
203
248
 
249
+ @if type-of($value2) != number {
250
+ $value2: unquote("(") + $value2 + unquote(")");
251
+ }
252
+
204
253
  @return if($return-calc == true, calc(#{$value1} - #{$value2}), $value1 + unquote(" - ") + $value2);
205
254
  }
255
+
256
+ @function divide($dividend, $divisor, $precision: 10) {
257
+ $sign: if($dividend > 0 and $divisor > 0 or $dividend < 0 and $divisor < 0, 1, -1);
258
+ $dividend: abs($dividend);
259
+ $divisor: abs($divisor);
260
+ @if $dividend == 0 {
261
+ @return 0;
262
+ }
263
+ @if $divisor == 0 {
264
+ @error "Cannot divide by 0";
265
+ }
266
+ $remainder: $dividend;
267
+ $result: 0;
268
+ $factor: 10;
269
+ @while ($remainder > 0 and $precision >= 0) {
270
+ $quotient: 0;
271
+ @while ($remainder >= $divisor) {
272
+ $remainder: $remainder - $divisor;
273
+ $quotient: $quotient + 1;
274
+ }
275
+ $result: $result * 10 + $quotient;
276
+ $factor: $factor * .1;
277
+ $remainder: $remainder * 10;
278
+ $precision: $precision - 1;
279
+ @if ($precision < 0 and $remainder >= $divisor * 5) {
280
+ $result: $result + 1;
281
+ }
282
+ }
283
+ $result: $result * $factor * $sign;
284
+ $dividend-unit: unit($dividend);
285
+ $divisor-unit: unit($divisor);
286
+ $unit-map: (
287
+ "px": 1px,
288
+ "rem": 1rem,
289
+ "em": 1em,
290
+ "%": 1%
291
+ );
292
+ @if ($dividend-unit != $divisor-unit and map-has-key($unit-map, $dividend-unit)) {
293
+ $result: $result * map-get($unit-map, $dividend-unit);
294
+ }
295
+ @return $result;
296
+ }
@@ -12,6 +12,17 @@
12
12
  }
13
13
  }
14
14
 
15
+ @if $enable-cssgrid {
16
+ .grid {
17
+ 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});
21
+
22
+ @include make-cssgrid();
23
+ }
24
+ }
25
+
15
26
 
16
27
  // Columns
17
28
  //
@@ -2,6 +2,8 @@
2
2
  @import "helpers/colored-links";
3
3
  @import "helpers/ratio";
4
4
  @import "helpers/position";
5
+ @import "helpers/stacks";
5
6
  @import "helpers/visually-hidden";
6
7
  @import "helpers/stretched-link";
7
8
  @import "helpers/text-truncation";
9
+ @import "helpers/vr";
@@ -32,7 +32,7 @@
32
32
  }
33
33
 
34
34
  .figure-img {
35
- margin-bottom: $spacer / 2;
35
+ margin-bottom: $spacer * .5;
36
36
  line-height: 1;
37
37
  }
38
38
 
@@ -22,6 +22,7 @@
22
22
 
23
23
  // Components
24
24
  @import "mixins/alert";
25
+ @import "mixins/backdrop";
25
26
  @import "mixins/buttons";
26
27
  @import "mixins/caret";
27
28
  @import "mixins/pagination";
@@ -85,17 +85,7 @@
85
85
 
86
86
  // Modal background
87
87
  .modal-backdrop {
88
- position: fixed;
89
- top: 0;
90
- left: 0;
91
- z-index: $zindex-modal-backdrop;
92
- width: 100vw;
93
- height: 100vh;
94
- background-color: $modal-backdrop-bg;
95
-
96
- // Fade for backdrop
97
- &.fade { opacity: 0; }
98
- &.show { opacity: $modal-backdrop-opacity; }
88
+ @include overlay-backdrop($zindex-modal-backdrop, $modal-backdrop-bg, $modal-backdrop-opacity);
99
89
  }
100
90
 
101
91
  // Modal header
@@ -110,8 +100,8 @@
110
100
  @include border-top-radius($modal-content-inner-border-radius);
111
101
 
112
102
  .btn-close {
113
- padding: ($modal-header-padding-y / 2) ($modal-header-padding-x / 2);
114
- margin: ($modal-header-padding-y / -2) ($modal-header-padding-x / -2) ($modal-header-padding-y / -2) auto;
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;
115
105
  }
116
106
  }
117
107
 
@@ -138,7 +128,7 @@
138
128
  flex-shrink: 0;
139
129
  align-items: center; // vertically center
140
130
  justify-content: flex-end; // Right align buttons with flex property because text-align doesn't work on flex items
141
- padding: $modal-inner-padding - $modal-footer-margin-between / 2;
131
+ padding: $modal-inner-padding - $modal-footer-margin-between * .5;
142
132
  border-top: $modal-footer-border-width solid $modal-footer-border-color;
143
133
  @include border-bottom-radius($modal-content-inner-border-radius);
144
134
 
@@ -146,7 +136,7 @@
146
136
  // This solution is far from ideal because of the universal selector usage,
147
137
  // but is needed to fix https://github.com/twbs/bootstrap/issues/24800
148
138
  > * {
149
- margin: $modal-footer-margin-between / 2;
139
+ margin: $modal-footer-margin-between * .5;
150
140
  }
151
141
  }
152
142
 
@@ -193,13 +193,42 @@
193
193
  .navbar-toggler {
194
194
  display: none;
195
195
  }
196
+
197
+ .offcanvas-header {
198
+ display: none;
199
+ }
200
+
201
+ .offcanvas {
202
+ position: inherit;
203
+ bottom: 0;
204
+ z-index: 1000;
205
+ flex-grow: 1;
206
+ visibility: visible !important; // stylelint-disable-line declaration-no-important
207
+ background-color: transparent;
208
+ border-right: 0;
209
+ border-left: 0;
210
+ @include transition(none);
211
+ transform: none;
212
+ }
213
+ .offcanvas-top,
214
+ .offcanvas-bottom {
215
+ height: auto;
216
+ border-top: 0;
217
+ border-bottom: 0;
218
+ }
219
+
220
+ .offcanvas-body {
221
+ display: flex;
222
+ flex-grow: 0;
223
+ padding: 0;
224
+ overflow-y: visible;
225
+ }
196
226
  }
197
227
  }
198
228
  }
199
229
  }
200
230
  // scss-docs-end navbar-expand-loop
201
231
 
202
-
203
232
  // Navbar themes
204
233
  //
205
234
  // Styles for switching between navbars with light or dark background.
@@ -14,6 +14,10 @@
14
14
  @include transition(transform $offcanvas-transition-duration ease-in-out);
15
15
  }
16
16
 
17
+ .offcanvas-backdrop {
18
+ @include overlay-backdrop($zindex-offcanvas-backdrop, $offcanvas-backdrop-bg, $offcanvas-backdrop-opacity);
19
+ }
20
+
17
21
  .offcanvas-header {
18
22
  display: flex;
19
23
  align-items: center;
@@ -21,8 +25,10 @@
21
25
  padding: $offcanvas-padding-y $offcanvas-padding-x;
22
26
 
23
27
  .btn-close {
24
- padding: ($offcanvas-padding-y / 2) ($offcanvas-padding-x / 2);
25
- margin: ($offcanvas-padding-y / -2) ($offcanvas-padding-x / -2) ($offcanvas-padding-y / -2) auto;
28
+ padding: ($offcanvas-padding-y * .5) ($offcanvas-padding-x * .5);
29
+ margin-top: $offcanvas-padding-y * -.5;
30
+ margin-right: $offcanvas-padding-x * -.5;
31
+ margin-bottom: $offcanvas-padding-y * -.5;
26
32
  }
27
33
  }
28
34
 
@@ -0,0 +1,51 @@
1
+ .placeholder {
2
+ display: inline-block;
3
+ min-height: 1em;
4
+ vertical-align: middle;
5
+ cursor: wait;
6
+ background-color: currentColor;
7
+ opacity: $placeholder-opacity-max;
8
+
9
+ &.btn::before {
10
+ display: inline-block;
11
+ content: "";
12
+ }
13
+ }
14
+
15
+ // Sizing
16
+ .placeholder-xs {
17
+ min-height: .6em;
18
+ }
19
+
20
+ .placeholder-sm {
21
+ min-height: .8em;
22
+ }
23
+
24
+ .placeholder-lg {
25
+ min-height: 1.2em;
26
+ }
27
+
28
+ // Animation
29
+ .placeholder-glow {
30
+ .placeholder {
31
+ animation: placeholder-glow 2s ease-in-out infinite;
32
+ }
33
+ }
34
+
35
+ @keyframes placeholder-glow {
36
+ 50% {
37
+ opacity: $placeholder-opacity-min;
38
+ }
39
+ }
40
+
41
+ .placeholder-wave {
42
+ mask-image: linear-gradient(130deg, $black 55%, rgba(0, 0, 0, (1 - $placeholder-opacity-min)) 75%, $black 95%);
43
+ mask-size: 200% 100%;
44
+ animation: placeholder-wave 2s linear infinite;
45
+ }
46
+
47
+ @keyframes placeholder-wave {
48
+ 100% {
49
+ mask-position: -200% 0%;
50
+ }
51
+ }
@@ -40,13 +40,13 @@
40
40
 
41
41
  &::before {
42
42
  bottom: 0;
43
- border-width: $popover-arrow-height ($popover-arrow-width / 2) 0;
43
+ border-width: $popover-arrow-height ($popover-arrow-width * .5) 0;
44
44
  border-top-color: $popover-arrow-outer-color;
45
45
  }
46
46
 
47
47
  &::after {
48
48
  bottom: $popover-border-width;
49
- border-width: $popover-arrow-height ($popover-arrow-width / 2) 0;
49
+ border-width: $popover-arrow-height ($popover-arrow-width * .5) 0;
50
50
  border-top-color: $popover-arrow-color;
51
51
  }
52
52
  }
@@ -60,13 +60,13 @@
60
60
 
61
61
  &::before {
62
62
  left: 0;
63
- border-width: ($popover-arrow-width / 2) $popover-arrow-height ($popover-arrow-width / 2) 0;
63
+ border-width: ($popover-arrow-width * .5) $popover-arrow-height ($popover-arrow-width * .5) 0;
64
64
  border-right-color: $popover-arrow-outer-color;
65
65
  }
66
66
 
67
67
  &::after {
68
68
  left: $popover-border-width;
69
- border-width: ($popover-arrow-width / 2) $popover-arrow-height ($popover-arrow-width / 2) 0;
69
+ border-width: ($popover-arrow-width * .5) $popover-arrow-height ($popover-arrow-width * .5) 0;
70
70
  border-right-color: $popover-arrow-color;
71
71
  }
72
72
  }
@@ -78,13 +78,13 @@
78
78
 
79
79
  &::before {
80
80
  top: 0;
81
- border-width: 0 ($popover-arrow-width / 2) $popover-arrow-height ($popover-arrow-width / 2);
81
+ border-width: 0 ($popover-arrow-width * .5) $popover-arrow-height ($popover-arrow-width * .5);
82
82
  border-bottom-color: $popover-arrow-outer-color;
83
83
  }
84
84
 
85
85
  &::after {
86
86
  top: $popover-border-width;
87
- border-width: 0 ($popover-arrow-width / 2) $popover-arrow-height ($popover-arrow-width / 2);
87
+ border-width: 0 ($popover-arrow-width * .5) $popover-arrow-height ($popover-arrow-width * .5);
88
88
  border-bottom-color: $popover-arrow-color;
89
89
  }
90
90
  }
@@ -96,7 +96,7 @@
96
96
  left: 50%;
97
97
  display: block;
98
98
  width: $popover-arrow-width;
99
- margin-left: -$popover-arrow-width / 2;
99
+ margin-left: -$popover-arrow-width * .5;
100
100
  content: "";
101
101
  border-bottom: $popover-border-width solid $popover-header-bg;
102
102
  }
@@ -110,13 +110,13 @@
110
110
 
111
111
  &::before {
112
112
  right: 0;
113
- border-width: ($popover-arrow-width / 2) 0 ($popover-arrow-width / 2) $popover-arrow-height;
113
+ border-width: ($popover-arrow-width * .5) 0 ($popover-arrow-width * .5) $popover-arrow-height;
114
114
  border-left-color: $popover-arrow-outer-color;
115
115
  }
116
116
 
117
117
  &::after {
118
118
  right: $popover-border-width;
119
- border-width: ($popover-arrow-width / 2) 0 ($popover-arrow-width / 2) $popover-arrow-height;
119
+ border-width: ($popover-arrow-width * .5) 0 ($popover-arrow-width * .5) $popover-arrow-height;
120
120
  border-left-color: $popover-arrow-color;
121
121
  }
122
122
  }
@@ -144,7 +144,7 @@
144
144
  @include font-size($font-size-base);
145
145
  color: $popover-header-color;
146
146
  background-color: $popover-header-bg;
147
- border-bottom: $popover-border-width solid shade-color($popover-header-bg, 10%);
147
+ border-bottom: $popover-border-width solid $popover-border-color;
148
148
  @include border-top-radius($popover-inner-border-radius);
149
149
 
150
150
  &:empty {
@@ -26,7 +26,9 @@
26
26
  // null by default, thus nothing is generated.
27
27
 
28
28
  :root {
29
- font-size: $font-size-root;
29
+ @if $font-size-root != null {
30
+ font-size: var(--#{$variable-prefix}-root-font-size);
31
+ }
30
32
 
31
33
  @if $enable-smooth-scroll {
32
34
  @media (prefers-reduced-motion: no-preference) {
@@ -43,18 +45,20 @@
43
45
  // 3. Prevent adjustments of font size after orientation changes in iOS.
44
46
  // 4. Change the default tap highlight to be completely transparent in iOS.
45
47
 
48
+ // scss-docs-start reboot-body-rules
46
49
  body {
47
50
  margin: 0; // 1
48
- font-family: $font-family-base;
49
- @include font-size($font-size-base);
50
- font-weight: $font-weight-base;
51
- line-height: $line-height-base;
52
- color: $body-color;
53
- text-align: $body-text-align;
54
- background-color: $body-bg; // 2
51
+ font-family: var(--#{$variable-prefix}body-font-family);
52
+ @include font-size(var(--#{$variable-prefix}body-font-size));
53
+ font-weight: var(--#{$variable-prefix}body-font-weight);
54
+ line-height: var(--#{$variable-prefix}body-line-height);
55
+ color: var(--#{$variable-prefix}body-color);
56
+ text-align: var(--#{$variable-prefix}body-text-align);
57
+ background-color: var(--#{$variable-prefix}body-bg); // 2
55
58
  -webkit-text-size-adjust: 100%; // 3
56
59
  -webkit-tap-highlight-color: rgba($black, 0); // 4
57
60
  }
61
+ // scss-docs-end reboot-body-rules
58
62
 
59
63
 
60
64
  // Content grouping
@@ -1,16 +1,53 @@
1
1
  :root {
2
- // Custom variable values only support SassScript inside `#{}`.
2
+ // Note: Custom variable values only support SassScript inside `#{}`.
3
+
4
+ // Colors
5
+ //
6
+ // Generate palettes for full colors, grays, and theme colors.
7
+
3
8
  @each $color, $value in $colors {
4
9
  --#{$variable-prefix}#{$color}: #{$value};
5
10
  }
6
11
 
12
+ @each $color, $value in $grays {
13
+ --#{$variable-prefix}gray-#{$color}: #{$value};
14
+ }
15
+
7
16
  @each $color, $value in $theme-colors {
8
17
  --#{$variable-prefix}#{$color}: #{$value};
9
18
  }
10
19
 
11
- // Use `inspect` for lists so that quoted items keep the quotes.
20
+ @each $color, $value in $theme-colors-rgb {
21
+ --#{$variable-prefix}#{$color}-rgb: #{$value};
22
+ }
23
+
24
+ --#{$variable-prefix}white-rgb: #{to-rgb($white)};
25
+ --#{$variable-prefix}black-rgb: #{to-rgb($black)};
26
+ --#{$variable-prefix}body-rgb: #{to-rgb($body-color)};
27
+
28
+ // Fonts
29
+
30
+ // Note: Use `inspect` for lists so that quoted items keep the quotes.
12
31
  // See https://github.com/sass/sass/issues/2383#issuecomment-336349172
13
32
  --#{$variable-prefix}font-sans-serif: #{inspect($font-family-sans-serif)};
14
33
  --#{$variable-prefix}font-monospace: #{inspect($font-family-monospace)};
15
34
  --#{$variable-prefix}gradient: #{$gradient};
35
+
36
+ // Root and body
37
+ // stylelint-disable custom-property-empty-line-before
38
+ // scss-docs-start root-body-variables
39
+ @if $font-size-root != null {
40
+ --#{$variable-prefix}root-font-size: #{$font-size-root};
41
+ }
42
+ --#{$variable-prefix}body-font-family: #{$font-family-base};
43
+ --#{$variable-prefix}body-font-size: #{$font-size-base};
44
+ --#{$variable-prefix}body-font-weight: #{$font-weight-base};
45
+ --#{$variable-prefix}body-line-height: #{$line-height-base};
46
+ --#{$variable-prefix}body-color: #{$body-color};
47
+ @if $body-text-align != null {
48
+ --#{$variable-prefix}body-text-align: #{$body-text-align};
49
+ }
50
+ --#{$variable-prefix}body-bg: #{$body-bg};
51
+ // scss-docs-end root-body-variables
52
+ // stylelint-enable custom-property-empty-line-before
16
53
  }
@@ -4,7 +4,7 @@
4
4
 
5
5
  .table {
6
6
  --#{$variable-prefix}table-bg: #{$table-bg};
7
- --#{$variable-prefix}table-accent-bg: #{$table-bg};
7
+ --#{$variable-prefix}table-accent-bg: #{$table-accent-bg};
8
8
  --#{$variable-prefix}table-striped-color: #{$table-striped-color};
9
9
  --#{$variable-prefix}table-striped-bg: #{$table-striped-bg};
10
10
  --#{$variable-prefix}table-active-color: #{$table-active-color};