@wpmoo/ui 1.0.0-rc.5 → 1.0.0-rc.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/ASSET_LICENSE.md +1 -1
  2. package/README.md +5 -6
  3. package/certification.json +1 -1
  4. package/dist/assets/css/moo-ui.css +7748 -8075
  5. package/dist/assets/css/moo-ui.min.css +2 -2
  6. package/dist/assets/css/moo.css +289 -285
  7. package/dist/assets/css/moo.min.css +2 -2
  8. package/dist/js/chart.js +57 -5
  9. package/dist/js/chart.min.js +3 -3
  10. package/dist/js/combobox.js +1 -1
  11. package/dist/js/context-menu.js +1 -1
  12. package/dist/js/datatable.js +114 -213
  13. package/dist/js/datepicker.js +79 -37
  14. package/dist/js/datepicker.min.js +2 -2
  15. package/dist/js/moo-ui.js +193 -51
  16. package/dist/js/moo-ui.min.js +3 -3
  17. package/dist/js/sidebar.js +145 -170
  18. package/dist/js/slider.js +1 -1
  19. package/package.json +8 -8
  20. package/scss/components/_alert.scss +1 -2
  21. package/scss/components/_card.scss +5 -5
  22. package/scss/components/_close_button.scss +8 -3
  23. package/scss/components/_datatable.scss +27 -3
  24. package/scss/components/_dialog.scss +16 -0
  25. package/scss/components/_dropdown.scss +38 -3
  26. package/scss/components/_switch.scss +13 -5
  27. package/scss/components/_table.scss +6 -0
  28. package/scss/components/_tabs.scss +1 -1
  29. package/scss/components/sidebar/_collapsed.scss +28 -19
  30. package/scss/components/sidebar/_inset.scss +14 -44
  31. package/scss/components/sidebar/_layout.scss +86 -11
  32. package/scss/foundations/_backdrop.scss +128 -0
  33. package/scss/foundations/_scope.scss +5 -0
  34. package/scss/mixins/_banner.scss +3 -0
  35. package/scss/moo-core.scss +6 -34
  36. package/scss/moo-ui.scss +6 -6
  37. package/scss/settings/_bootstrap_overrides.scss +4 -0
  38. package/scss/settings/_component_variables.scss +13 -1
  39. package/scss/settings/_options.scss +2 -0
  40. package/scss/settings/_palette.scss +1 -1
  41. package/scss/themes/_forms.scss +15 -0
  42. package/scss/themes/_root.scss +16 -0
  43. package/scss/themes/_standalone.scss +5 -0
  44. package/scss/themes/{_scoped_core.scss → _theme.scss} +1 -0
  45. package/scss/foundations/_core_state_layer.scss +0 -25
  46. package/scss/foundations/_overlay_backdrop.scss +0 -19
  47. package/scss/themes/_standalone_root.scss +0 -119
  48. /package/scss/foundations/{_core_global_primitives.scss → _globals.scss} +0 -0
@@ -0,0 +1,128 @@
1
+ // Bootstrap owns the overlay lifecycle for Dialog / Alert Dialog (Modal) and
2
+ // Sheet (Offcanvas). Moo only retunes the native backdrop appearance through a
3
+ // shared token primitive, so every opening surface gets the same treatment
4
+ // without component-specific backdrop selectors.
5
+ //
6
+ // Modal waits for the real `.modal-backdrop` transition before it starts the
7
+ // dialog panel. Keep that lifecycle element visually inert and animate a
8
+ // pseudo-element instead: the panel and visible blur/dim can then start from
9
+ // the same Bootstrap motion token, while the native backdrop is still retained
10
+ // long enough to fade the visual layer out on close. Use keyframe animation
11
+ // rather than a pseudo-element transition: transitionend events from a pseudo
12
+ // element bubble to its originating backdrop and would make Bootstrap wait for
13
+ // the visual layer before showing the panel.
14
+ @mixin moo-overlay-backdrop-appearance {
15
+ --#{$prefix}backdrop-opacity: var(--moo-overlay-backdrop-opacity, #{$moo-overlay-backdrop-opacity});
16
+ opacity: 1;
17
+ color: transparent;
18
+ background-color: transparent;
19
+
20
+ &.fade,
21
+ &.fade:not(.show) {
22
+ opacity: 1;
23
+ }
24
+
25
+ // Bootstrap reads this duration to decide when to reveal a Modal panel.
26
+ // Keep entry instant; the visual transition below belongs to ::before.
27
+ &.show {
28
+ transition: none;
29
+ }
30
+
31
+ // On close, Bootstrap keeps the lifecycle layer in the DOM for this token
32
+ // duration while ::before fades out. Color has no visible effect on the
33
+ // empty backdrop but supplies Bootstrap's native transition lifecycle
34
+ // without multiplying the pseudo-element's visual fade.
35
+ &.fade:not(.show) {
36
+ color: var(--bs-body-color, currentcolor);
37
+ transition: color var(--moo-overlay-motion-duration, #{$moo-overlay-motion-duration}) ease-out;
38
+ }
39
+
40
+ &::before {
41
+ position: absolute;
42
+ inset: 0;
43
+ content: "";
44
+ opacity: 0;
45
+ background-color: var(--moo-overlay-backdrop-bg, #{$moo-overlay-backdrop-bg});
46
+ -webkit-backdrop-filter: blur(0);
47
+ backdrop-filter: blur(0);
48
+ animation: moo-overlay-backdrop-exit var(--moo-overlay-motion-duration, #{$moo-overlay-motion-duration}) ease-out both;
49
+ }
50
+ }
51
+
52
+ @mixin moo-overlay-backdrop-shown {
53
+ // Bootstrap Modal routes opacity through --bs-backdrop-opacity, but
54
+ // Offcanvas 5.3 compiles the same state to a literal .5. Restate the shared
55
+ // token on both native show selectors so Dialog and Sheet dim equally.
56
+ &::before {
57
+ animation: moo-overlay-backdrop-enter var(--moo-overlay-motion-duration, #{$moo-overlay-motion-duration}) ease-out both;
58
+ }
59
+ }
60
+
61
+ @mixin moo-overlay-backdrop-reduced-motion {
62
+ transition: none;
63
+
64
+ &::before {
65
+ animation: none;
66
+ }
67
+ }
68
+
69
+ @keyframes moo-overlay-backdrop-enter {
70
+ from {
71
+ opacity: 0;
72
+ -webkit-backdrop-filter: blur(0);
73
+ backdrop-filter: blur(0);
74
+ }
75
+
76
+ to {
77
+ opacity: var(--moo-overlay-backdrop-opacity, #{$moo-overlay-backdrop-opacity});
78
+ -webkit-backdrop-filter: var(--moo-overlay-backdrop-filter, #{$moo-overlay-backdrop-filter});
79
+ backdrop-filter: var(--moo-overlay-backdrop-filter, #{$moo-overlay-backdrop-filter});
80
+ }
81
+ }
82
+
83
+ @keyframes moo-overlay-backdrop-exit {
84
+ from {
85
+ opacity: var(--moo-overlay-backdrop-opacity, #{$moo-overlay-backdrop-opacity});
86
+ -webkit-backdrop-filter: var(--moo-overlay-backdrop-filter, #{$moo-overlay-backdrop-filter});
87
+ backdrop-filter: var(--moo-overlay-backdrop-filter, #{$moo-overlay-backdrop-filter});
88
+ }
89
+
90
+ to {
91
+ opacity: 0;
92
+ -webkit-backdrop-filter: blur(0);
93
+ backdrop-filter: blur(0);
94
+ }
95
+ }
96
+
97
+ .modal-backdrop,
98
+ .offcanvas-backdrop {
99
+ @include moo-overlay-backdrop-appearance;
100
+ }
101
+
102
+ .modal-backdrop.show,
103
+ .offcanvas-backdrop.show {
104
+ @include moo-overlay-backdrop-shown;
105
+ }
106
+
107
+ // Backdrops that are portaled into a resolved owner still need to outrank
108
+ // Bootstrap's scoped `.fade` and `.show` rules. Entry points include this
109
+ // mixin inside their single native Moo scope; the global rules above remain
110
+ // available for hosts that intentionally keep Bootstrap's body-level portal.
111
+ @mixin moo-overlay-backdrop-scoped {
112
+ .modal-backdrop,
113
+ .offcanvas-backdrop {
114
+ @include moo-overlay-backdrop-appearance;
115
+ }
116
+
117
+ .modal-backdrop.show,
118
+ .offcanvas-backdrop.show {
119
+ @include moo-overlay-backdrop-shown;
120
+ }
121
+ }
122
+
123
+ @media (prefers-reduced-motion: reduce) {
124
+ .modal-backdrop,
125
+ .offcanvas-backdrop {
126
+ @include moo-overlay-backdrop-reduced-motion;
127
+ }
128
+ }
@@ -0,0 +1,5 @@
1
+ @scope (.moo-ui) to (:where(.moo-ui[data-bs-theme="light"], .moo-ui[data-bs-theme="dark"])) {
2
+ @import "../components";
3
+ @import "../themes/forms";
4
+ @include moo-overlay-backdrop-scoped;
5
+ }
@@ -0,0 +1,3 @@
1
+ @import "bootstrap/scss/mixins/banner";
2
+
3
+ @include bsBanner("");
@@ -4,9 +4,7 @@
4
4
  * Includes Bootstrap 5.3.3 component output
5
5
  * SPDX-License-Identifier: MIT
6
6
  */
7
- $enable-dark-mode: false;
8
- $moo-spinner-animation-name: moo-spinner-rotate;
9
-
7
+ @import "settings/options";
10
8
  @import "bootstrap/scss/functions";
11
9
  @import "settings";
12
10
  @import "bootstrap/scss/variables";
@@ -14,34 +12,8 @@ $moo-spinner-animation-name: moo-spinner-rotate;
14
12
  @import "bootstrap/scss/maps";
15
13
  @import "bootstrap/scss/mixins";
16
14
  @import "bootstrap/scss/utilities";
17
- @import "themes/scoped_core";
18
- @import "foundations/core_global_primitives";
19
-
20
- .moo-ui {
21
- @include moo-core-scales;
22
- @include moo-core-shared;
23
- @include moo-core-light;
24
- }
25
-
26
- :where(html, body)[data-bs-theme="dark"] .moo-ui:not([data-bs-theme]) {
27
- @include moo-core-dark;
28
- }
29
-
30
- .moo-ui[data-bs-theme="light"] {
31
- @include moo-core-light;
32
- }
33
-
34
- .moo-ui[data-bs-theme="dark"] {
35
- @include moo-core-dark;
36
- }
37
-
38
- .moo-ui[dir="rtl"] {
39
- direction: rtl;
40
- }
41
-
42
- @scope (.moo-ui) {
43
- @import "components";
44
- }
45
-
46
- @import "foundations/core_state_layer";
47
- @import "foundations/overlay_backdrop";
15
+ @import "themes/theme";
16
+ @import "foundations/globals";
17
+ @import "foundations/backdrop";
18
+ @import "themes/root";
19
+ @import "foundations/scope";
package/scss/moo-ui.scss CHANGED
@@ -1,7 +1,5 @@
1
1
  @import "settings";
2
-
3
- @import "bootstrap/scss/mixins/banner";
4
- @include bsBanner("");
2
+ @import "mixins/banner";
5
3
 
6
4
  // Bootstrap configuration
7
5
  @import "bootstrap/scss/functions";
@@ -10,10 +8,12 @@
10
8
  @import "bootstrap/scss/maps";
11
9
  @import "bootstrap/scss/mixins";
12
10
  @import "bootstrap/scss/utilities";
11
+ @import "themes/theme";
13
12
 
14
13
  // Bootstrap layout and standalone-only components
15
14
  @import "bootstrap/scss/root";
16
- @import "themes/standalone_root";
15
+ @import "themes/root";
16
+ @import "themes/standalone";
17
17
  @import "bootstrap/scss/reboot";
18
18
  @import "bootstrap/scss/type";
19
19
  @import "bootstrap/scss/images";
@@ -46,5 +46,5 @@
46
46
  @import "bootstrap/scss/utilities/api";
47
47
 
48
48
  @import "utilities/scroll_fade_primitives";
49
- @import "components";
50
- @import "foundations/overlay_backdrop";
49
+ @import "foundations/backdrop";
50
+ @import "foundations/scope";
@@ -4,6 +4,10 @@ $btn-box-shadow: none !default;
4
4
  $btn-focus-box-shadow: none !default;
5
5
  $btn-active-box-shadow: none !default;
6
6
 
7
+ // Keep Bootstrap's CSS Grid utility layer available alongside the Flexbox
8
+ // grid so native .grid and .g-col-* markup works in Moo UI hosts.
9
+ $enable-cssgrid: true !default;
10
+
7
11
  // Bootstrap validation icons are background images injected by the native
8
12
  // validation mixin. Reference-style invalid fields use border/ring + error text
9
13
  // without a trailing status glyph, so disable the Bootstrap icon branch at the
@@ -305,9 +305,14 @@ $moo-form-focus-ring-color: var(--moo-ring) !default;
305
305
  // backdrops. Bootstrap exposes separate .modal-backdrop and
306
306
  // .offcanvas-backdrop selectors; Moo keeps their visual treatment aligned via
307
307
  // one token set instead of per-component backdrop rules.
308
+ // Bootstrap defaults both native panels to .3s; retain that default while
309
+ // exposing one runtime duration token for the panel and its backdrop.
310
+ $moo-overlay-motion-duration: .3s !default;
311
+ $modal-transition: transform var(--moo-overlay-motion-duration, #{$moo-overlay-motion-duration}) ease-out !default;
312
+ $offcanvas-transition-duration: var(--moo-overlay-motion-duration, #{$moo-overlay-motion-duration}) !default;
308
313
  $moo-overlay-backdrop-opacity: 1 !default;
309
314
  $moo-overlay-backdrop-bg: color-mix(in srgb, #0a0a0a 10%, transparent) !default;
310
- $moo-overlay-backdrop-filter: blur(8px) !default;
315
+ $moo-overlay-backdrop-filter: blur(6px) !default;
311
316
 
312
317
  // A quieter elevation scale and the extra radius step, applied UI-wide through
313
318
  // Bootstrap's own scales so every component consumes one shared primitive.
@@ -400,6 +405,10 @@ $moo-datatable-bulk-actions-backdrop-blur: 8px !default;
400
405
  // chrome. Keep the default component position unchanged while giving host
401
406
  // surfaces a scoped override hook.
402
407
  $moo-datatable-bulk-actions-bottom: 1rem !default;
408
+ // Bootstrap's table surface is opaque by default and has no context-aware
409
+ // Card composition knob, so card-contained tables consume this scoped Sass
410
+ // setting instead of hardcoding their transparent surface in the partial.
411
+ $moo-table-contained-bg: transparent !default;
403
412
  // Bootstrap has no Data Table layout/card primitive, so these scoped knobs
404
413
  // describe the generated table/card frames without becoming global widths.
405
414
  $moo-datatable-min-width: 48rem !default;
@@ -409,6 +418,9 @@ $moo-datatable-card-label-width: 7rem !default;
409
418
  // Sticky row-action cells need just enough opaque surface for the trigger;
410
419
  // this fade prevents the pinned cell from reading as a dominant blank column.
411
420
  $moo-datatable-actions-cell-fade-width: 1.25rem !default;
421
+ // Bootstrap has no Data Table action-cell surface token; keep this scoped
422
+ // knob aligned with the native body surface and override it for Card context.
423
+ $moo-datatable-actions-cell-bg: var(--bs-body-bg) !default;
412
424
  // Bootstrap has no Data Table frame-header or layout-toggle row primitive, so
413
425
  // these scoped knobs align Moo's table/card header controls to Bootstrap inputs.
414
426
  $moo-datatable-frame-header-min-height: 2.78125rem !default;
@@ -0,0 +1,2 @@
1
+ $enable-dark-mode: false;
2
+ $moo-spinner-animation-name: moo-spinner-rotate;
@@ -112,7 +112,7 @@ $moo-sidebar-dark: #1c1c1f !default;
112
112
  $moo-input-bg-dark: color-mix(in srgb, $moo-muted-surface-dark 50%, $moo-surface-dark) !default;
113
113
 
114
114
  // Bootstrap root variables consumed by the scoped core build. Define them
115
- // here so themes/_scoped_core.scss can emit Bootstrap's root contract without
115
+ // here so themes/_theme.scss can emit Bootstrap's root contract without
116
116
  // hardcoded consumer-side literals.
117
117
  $body-tertiary-color: #a1a1aa !default;
118
118
  $body-tertiary-bg: $light !default;
@@ -0,0 +1,15 @@
1
+ :scope[data-bs-theme="light"] .form-select {
2
+ --#{$prefix}form-select-bg-img: #{escape-svg($form-select-indicator)};
3
+ }
4
+
5
+ :scope[data-bs-theme="dark"] .form-select {
6
+ --#{$prefix}form-select-bg-img: #{escape-svg($form-select-indicator-dark)};
7
+ }
8
+
9
+ :scope[data-bs-theme="light"] .form-switch .form-check-input:not(:checked):not(:focus) {
10
+ --#{$prefix}form-switch-bg: #{escape-svg($form-switch-bg-image)};
11
+ }
12
+
13
+ :scope[data-bs-theme="dark"] .form-switch .form-check-input:not(:checked):not(:focus) {
14
+ --#{$prefix}form-switch-bg: #{escape-svg($form-switch-bg-image-dark)};
15
+ }
@@ -0,0 +1,16 @@
1
+ .moo-ui[data-bs-theme] {
2
+ @include moo-core-scales;
3
+ @include moo-core-shared;
4
+ }
5
+
6
+ .moo-ui[data-bs-theme="light"] {
7
+ @include moo-core-light;
8
+ }
9
+
10
+ .moo-ui[data-bs-theme="dark"] {
11
+ @include moo-core-dark;
12
+ }
13
+
14
+ .moo-ui[data-bs-theme][dir="rtl"] {
15
+ direction: rtl;
16
+ }
@@ -0,0 +1,5 @@
1
+ // A complete document places its resolved owner directly inside body. The
2
+ // owner, rather than body, supplies the viewport-sized foreground surface.
3
+ body > .moo-ui[data-bs-theme] {
4
+ min-block-size: 100dvh;
5
+ }
@@ -77,6 +77,7 @@ $moo-theme-colors-border-subtle-dark: (
77
77
  }
78
78
 
79
79
  @mixin moo-core-shared {
80
+ --moo-overlay-motion-duration: #{$moo-overlay-motion-duration};
80
81
  --moo-overlay-backdrop-opacity: #{$moo-overlay-backdrop-opacity};
81
82
  --moo-overlay-backdrop-bg: #{$moo-overlay-backdrop-bg};
82
83
  --moo-overlay-backdrop-filter: #{$moo-overlay-backdrop-filter};
@@ -1,25 +0,0 @@
1
- :where(html, body)[data-bs-theme="dark"] .moo-ui:not([data-bs-theme]) .form-select,
2
- .moo-ui[data-bs-theme="dark"] .form-select {
3
- --#{$prefix}form-select-bg-img: #{escape-svg($form-select-indicator-dark)};
4
- }
5
-
6
- :where(html, body)[data-bs-theme="dark"] .moo-ui:not([data-bs-theme]) .form-switch .form-check-input:not(:checked):not(:focus),
7
- .moo-ui[data-bs-theme="dark"] .form-switch .form-check-input:not(:checked):not(:focus) {
8
- --#{$prefix}form-switch-bg: #{escape-svg($form-switch-bg-image-dark)};
9
- }
10
-
11
- :where(html, body)[data-bs-theme="dark"] .moo-ui:not([data-bs-theme]) .form-switch .form-check-input:checked,
12
- .moo-ui[data-bs-theme="dark"] .form-switch .form-check-input:checked {
13
- --#{$prefix}form-switch-bg: #{escape-svg($moo-switch-checked-bg-image-dark)};
14
-
15
- background-color: var(--moo-primary);
16
- border-color: var(--moo-primary);
17
- filter: none;
18
- }
19
-
20
- :where(html, body)[data-bs-theme="dark"] .moo-ui:not([data-bs-theme]) .form-switch .form-check-input:focus:active:not(:checked),
21
- :where(html, body)[data-bs-theme="dark"] .moo-ui:not([data-bs-theme]) .form-switch .form-check-input:focus:not(:focus-visible):not(:checked),
22
- .moo-ui[data-bs-theme="dark"] .form-switch .form-check-input:focus:active:not(:checked),
23
- .moo-ui[data-bs-theme="dark"] .form-switch .form-check-input:focus:not(:focus-visible):not(:checked) {
24
- --#{$prefix}form-switch-bg: #{escape-svg($form-switch-bg-image-dark)};
25
- }
@@ -1,19 +0,0 @@
1
- // Bootstrap owns the overlay lifecycle for Dialog / Alert Dialog (Modal) and
2
- // Sheet (Offcanvas). Moo only retunes the native backdrop appearance through a
3
- // shared token primitive, so every opening surface gets the same treatment
4
- // without component-specific backdrop selectors.
5
- .modal-backdrop,
6
- .offcanvas-backdrop {
7
- --#{$prefix}backdrop-opacity: var(--moo-overlay-backdrop-opacity, #{$moo-overlay-backdrop-opacity});
8
- background-color: var(--moo-overlay-backdrop-bg, #{$moo-overlay-backdrop-bg});
9
- -webkit-backdrop-filter: var(--moo-overlay-backdrop-filter, #{$moo-overlay-backdrop-filter});
10
- backdrop-filter: var(--moo-overlay-backdrop-filter, #{$moo-overlay-backdrop-filter});
11
- }
12
-
13
- .modal-backdrop.show,
14
- .offcanvas-backdrop.show {
15
- // Bootstrap Modal routes opacity through --bs-backdrop-opacity, but
16
- // Offcanvas 5.3 compiles the same state to a literal .5. Restate the shared
17
- // token on both native show selectors so Dialog and Sheet dim equally.
18
- opacity: var(--moo-overlay-backdrop-opacity, #{$moo-overlay-backdrop-opacity});
19
- }
@@ -1,119 +0,0 @@
1
- :root {
2
- --moo-overlay-backdrop-opacity: #{$moo-overlay-backdrop-opacity};
3
- --moo-overlay-backdrop-bg: #{$moo-overlay-backdrop-bg};
4
- --moo-overlay-backdrop-filter: #{$moo-overlay-backdrop-filter};
5
- --moo-input-group-border-radius: #{$moo-input-group-border-radius};
6
- --moo-disabled-control-opacity: #{$moo-disabled-control-opacity};
7
- --moo-sidebar-foreground: var(--moo-foreground);
8
- --moo-sidebar-accent: var(--moo-muted-surface);
9
- --moo-sidebar-border: var(--moo-border);
10
- --moo-chart-1: #{$moo-chart-1};
11
- --moo-chart-2: #{$moo-chart-2};
12
- --moo-chart-3: #{$moo-chart-3};
13
- --moo-chart-4: #{$moo-chart-4};
14
- --moo-chart-5: #{$moo-chart-5};
15
- }
16
-
17
- :root,
18
- [data-bs-theme="light"] {
19
- --moo-surface: #{$moo-surface};
20
- --moo-muted-surface: #{$moo-muted-surface};
21
- --moo-border: #{$moo-border};
22
- --moo-primary: #{$moo-primary};
23
- --moo-primary-foreground: #{$moo-primary-foreground};
24
- --moo-foreground: #{$moo-foreground};
25
- --moo-muted-foreground: #{$moo-muted-foreground};
26
- --moo-disabled-foreground: #{$moo-disabled-foreground};
27
- --moo-ring: #{$moo-ring};
28
- --moo-destructive: #{$moo-destructive};
29
- --moo-destructive-surface: #{$moo-destructive-surface};
30
- --moo-destructive-surface-hover: #{$moo-destructive-surface-hover};
31
- --moo-destructive-foreground: #{$moo-destructive-foreground};
32
- --moo-form-invalid-ring-color: #{$moo-form-invalid-ring-color};
33
- --moo-warning: #{$moo-warning};
34
- --moo-warning-surface: #{$moo-warning-surface};
35
- --moo-warning-surface-hover: #{$moo-warning-surface-hover};
36
- --moo-warning-foreground: #{$moo-warning-foreground};
37
- --moo-success: #{$moo-success};
38
- --moo-success-surface: #{$moo-success-surface};
39
- --moo-success-surface-hover: #{$moo-success-surface-hover};
40
- --moo-success-foreground: #{$moo-success-foreground};
41
- --moo-info: #{$moo-info};
42
- --moo-info-surface: #{$moo-info-surface};
43
- --moo-info-surface-hover: #{$moo-info-surface-hover};
44
- --moo-info-foreground: #{$moo-info-foreground};
45
- --moo-sidebar: #{$moo-sidebar};
46
- --bs-body-color: var(--moo-foreground);
47
- --bs-body-color-rgb: #{to-rgb($moo-foreground)};
48
- --bs-heading-color: var(--moo-foreground);
49
- --bs-secondary-color: var(--moo-muted-foreground);
50
- // Bootstrap computes its own dark-mode --bs-body-bg/-secondary-bg/
51
- // -tertiary-bg independently of this file (see vendor/bootstrap/scss/
52
- // _root.scss's [data-bs-theme="dark"] block), the same way it did for the
53
- // --bs-body-color trio above before this bridge existed. The scoped Odoo
54
- // core build already ties every one of these to the shared --moo-*
55
- // palette (scss/themes/_scoped_core.scss's moo-core-light/dark mixins);
56
- // mirror that here so both entrypoints render the same background, not
57
- // two independently-computed gray scales that happen to agree in light
58
- // mode and diverge in dark (this is what caused the catalog shell's body
59
- // background to sit only ~7 units of contrast from its own Kbd chips
60
- // instead of the ~15 they're tuned for).
61
- --bs-body-bg: var(--moo-surface);
62
- --bs-body-bg-rgb: #{to-rgb($moo-surface)};
63
- --bs-secondary-bg: var(--moo-muted-surface);
64
- --bs-secondary-bg-rgb: #{to-rgb($moo-muted-surface)};
65
- --bs-border-color: var(--moo-border);
66
- --bs-tertiary-bg: #{$body-tertiary-bg};
67
- --bs-tertiary-bg-rgb: #{to-rgb($body-tertiary-bg)};
68
- --bs-tertiary-color: #{$body-tertiary-color};
69
- --bs-tertiary-color-rgb: #{to-rgb($body-tertiary-color)};
70
- --bs-form-invalid-color: var(--moo-destructive);
71
- --bs-form-invalid-border-color: #{$moo-form-invalid-border-color};
72
- }
73
-
74
- [data-bs-theme="dark"] {
75
- --moo-surface: #{$moo-surface-dark};
76
- --moo-muted-surface: #{$moo-muted-surface-dark};
77
- --moo-border: #{$moo-border-dark};
78
- --moo-primary: #{$moo-primary-dark};
79
- --moo-primary-foreground: #{$moo-primary-foreground-dark};
80
- --moo-foreground: #{$moo-foreground-dark};
81
- --moo-muted-foreground: #{$moo-muted-foreground-dark};
82
- --moo-disabled-foreground: #{$moo-disabled-foreground-dark};
83
- --moo-ring: #{$moo-ring-dark};
84
- --moo-destructive: #{$moo-destructive-dark};
85
- --moo-destructive-surface: #{$moo-destructive-surface-dark};
86
- --moo-destructive-surface-hover: #{$moo-destructive-surface-hover-dark};
87
- --moo-destructive-foreground: #{$moo-destructive-foreground-dark};
88
- --moo-form-invalid-ring-color: #{$moo-form-invalid-ring-color-dark};
89
- --moo-warning: #{$moo-warning-dark};
90
- --moo-warning-surface: #{$moo-warning-surface-dark};
91
- --moo-warning-surface-hover: #{$moo-warning-surface-hover-dark};
92
- --moo-warning-foreground: #{$moo-warning-foreground-dark};
93
- --moo-success: #{$moo-success-dark};
94
- --moo-success-surface: #{$moo-success-surface-dark};
95
- --moo-success-surface-hover: #{$moo-success-surface-hover-dark};
96
- --moo-success-foreground: #{$moo-success-foreground-dark};
97
- --moo-info: #{$moo-info-dark};
98
- --moo-info-surface: #{$moo-info-surface-dark};
99
- --moo-info-surface-hover: #{$moo-info-surface-hover-dark};
100
- --moo-info-foreground: #{$moo-info-foreground-dark};
101
- --moo-sidebar: #{$moo-sidebar-dark};
102
- --moo-input-bg: #{$moo-input-bg-dark};
103
- --bs-body-color: var(--moo-foreground);
104
- --bs-body-color-rgb: #{to-rgb($moo-foreground-dark)};
105
- --bs-heading-color: var(--moo-foreground);
106
- --bs-secondary-color: var(--moo-muted-foreground);
107
- // See the light block's matching comment above.
108
- --bs-body-bg: var(--moo-surface);
109
- --bs-body-bg-rgb: #{to-rgb($moo-surface-dark)};
110
- --bs-secondary-bg: var(--moo-muted-surface);
111
- --bs-secondary-bg-rgb: #{to-rgb($moo-muted-surface-dark)};
112
- --bs-border-color: var(--moo-border);
113
- --bs-tertiary-bg: #{$body-tertiary-bg-dark};
114
- --bs-tertiary-bg-rgb: #{to-rgb($body-tertiary-bg-dark)};
115
- --bs-tertiary-color: #{$body-tertiary-color-dark};
116
- --bs-tertiary-color-rgb: #{to-rgb($body-tertiary-color-dark)};
117
- --bs-form-invalid-color: var(--moo-destructive);
118
- --bs-form-invalid-border-color: #{$moo-form-invalid-border-color-dark};
119
- }