tiny-essentials 1.29.1 → 1.29.2

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 (128) hide show
  1. package/changelog/1/29/2.md +82 -0
  2. package/dist/v1/TinyBasicsEs.min.js +1 -1
  3. package/dist/v1/TinyEssentials.min.js +1 -1
  4. package/dist/v1/TinyFetchLoader.min.js +1 -0
  5. package/dist/v1/TinyImageLoader.min.js +1 -0
  6. package/dist/v1/TinyMediaCache.min.js +1 -0
  7. package/dist/v1/TinyMediaLoader.min.js +1 -0
  8. package/dist/v1/basics/index.cjs +5 -0
  9. package/dist/v1/basics/index.d.mts +2 -1
  10. package/dist/v1/basics/index.d.mts.map +1 -1
  11. package/dist/v1/basics/index.mjs +2 -1
  12. package/dist/v1/basics/media/youtube.cjs +275 -0
  13. package/dist/v1/basics/media/youtube.d.mts +107 -0
  14. package/dist/v1/basics/media/youtube.d.mts.map +1 -0
  15. package/dist/v1/basics/media/youtube.mjs +214 -0
  16. package/dist/v1/index.cjs +13 -0
  17. package/dist/v1/index.d.mts +6 -1
  18. package/dist/v1/index.d.mts.map +1 -1
  19. package/dist/v1/index.mjs +7 -2
  20. package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.cjs +0 -1
  21. package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.d.mts +0 -1
  22. package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.d.mts.map +1 -1
  23. package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.mjs +0 -1
  24. package/dist/v1/libs/fs/plugins/OPFS/index.cjs +0 -8
  25. package/dist/v1/libs/fs/plugins/OPFS/index.d.mts +0 -8
  26. package/dist/v1/libs/fs/plugins/OPFS/index.d.mts.map +1 -1
  27. package/dist/v1/libs/fs/plugins/OPFS/index.mjs +0 -8
  28. package/dist/v1/libs/html/TinyHtml.cjs +1 -1
  29. package/dist/v1/libs/html/TinyHtml.d.mts +2 -2
  30. package/dist/v1/libs/html/TinyHtml.d.mts.map +1 -1
  31. package/dist/v1/libs/html/TinyHtml.mjs +1 -1
  32. package/dist/v1/libs/html/loader/TinyMediaLoader.cjs +1999 -0
  33. package/dist/v1/libs/html/loader/TinyMediaLoader.d.mts +999 -0
  34. package/dist/v1/libs/html/loader/TinyMediaLoader.d.mts.map +1 -0
  35. package/dist/v1/libs/html/loader/TinyMediaLoader.mjs +1852 -0
  36. package/dist/v1/libs/html/loader/beta/formats/TinyAudioLoader.cjs +77 -0
  37. package/dist/v1/libs/html/loader/beta/formats/TinyAudioLoader.d.mts +103 -0
  38. package/dist/v1/libs/html/loader/beta/formats/TinyAudioLoader.d.mts.map +1 -0
  39. package/dist/v1/libs/html/loader/beta/formats/TinyAudioLoader.mjs +67 -0
  40. package/dist/v1/libs/html/loader/beta/formats/TinyContentLoader.cjs +630 -0
  41. package/dist/v1/libs/html/loader/beta/formats/TinyContentLoader.d.mts +138 -0
  42. package/dist/v1/libs/html/loader/beta/formats/TinyContentLoader.d.mts.map +1 -0
  43. package/dist/v1/libs/html/loader/beta/formats/TinyContentLoader.mjs +576 -0
  44. package/dist/v1/libs/html/loader/beta/formats/TinyVideoLoader.cjs +70 -0
  45. package/dist/v1/libs/html/loader/beta/formats/TinyVideoLoader.d.mts +100 -0
  46. package/dist/v1/libs/html/loader/beta/formats/TinyVideoLoader.d.mts.map +1 -0
  47. package/dist/v1/libs/html/loader/beta/formats/TinyVideoLoader.mjs +60 -0
  48. package/dist/v1/libs/html/loader/beta/probe/TinyMediaProbe.cjs +946 -0
  49. package/dist/v1/libs/html/loader/beta/probe/TinyMediaProbe.d.mts +67 -0
  50. package/dist/v1/libs/html/loader/beta/probe/TinyMediaProbe.d.mts.map +1 -0
  51. package/dist/v1/libs/html/loader/beta/probe/TinyMediaProbe.mjs +896 -0
  52. package/dist/v1/libs/html/loader/formats/TinyFetchLoader.cjs +225 -0
  53. package/dist/v1/libs/html/loader/formats/TinyFetchLoader.d.mts +149 -0
  54. package/dist/v1/libs/html/loader/formats/TinyFetchLoader.d.mts.map +1 -0
  55. package/dist/v1/libs/html/loader/formats/TinyFetchLoader.mjs +197 -0
  56. package/dist/v1/libs/html/loader/formats/TinyImageLoader.cjs +1454 -0
  57. package/dist/v1/libs/html/loader/formats/TinyImageLoader.d.mts +200 -0
  58. package/dist/v1/libs/html/loader/formats/TinyImageLoader.d.mts.map +1 -0
  59. package/dist/v1/libs/html/loader/formats/TinyImageLoader.mjs +1317 -0
  60. package/dist/v1/libs/html/loader/probe/TinyImageProbe.cjs +668 -0
  61. package/dist/v1/libs/html/loader/probe/TinyImageProbe.d.mts +83 -0
  62. package/dist/v1/libs/html/loader/probe/TinyImageProbe.d.mts.map +1 -0
  63. package/dist/v1/libs/html/loader/probe/TinyImageProbe.mjs +626 -0
  64. package/dist/v1/libs/html/loader/utils/TinyBufferReader.cjs +277 -0
  65. package/dist/v1/libs/html/loader/utils/TinyBufferReader.d.mts +118 -0
  66. package/dist/v1/libs/html/loader/utils/TinyBufferReader.d.mts.map +1 -0
  67. package/dist/v1/libs/html/loader/utils/TinyBufferReader.mjs +247 -0
  68. package/dist/v1/libs/html/loader/utils/TinyIsoBox.cjs +128 -0
  69. package/dist/v1/libs/html/loader/utils/TinyIsoBox.d.mts +49 -0
  70. package/dist/v1/libs/html/loader/utils/TinyIsoBox.d.mts.map +1 -0
  71. package/dist/v1/libs/html/loader/utils/TinyIsoBox.mjs +116 -0
  72. package/dist/v1/libs/html/loader/utils/TinyMediaCache.cjs +796 -0
  73. package/dist/v1/libs/html/loader/utils/TinyMediaCache.d.mts +354 -0
  74. package/dist/v1/libs/html/loader/utils/TinyMediaCache.d.mts.map +1 -0
  75. package/dist/v1/libs/html/loader/utils/TinyMediaCache.mjs +734 -0
  76. package/dist/v1/libs/html/loader/utils/TinyMediaMirror.cjs +302 -0
  77. package/dist/v1/libs/html/loader/utils/TinyMediaMirror.d.mts +256 -0
  78. package/dist/v1/libs/html/loader/utils/TinyMediaMirror.d.mts.map +1 -0
  79. package/dist/v1/libs/html/loader/utils/TinyMediaMirror.mjs +280 -0
  80. package/dist/v1/libs/html/loader/utils/TinyMediaProgress.cjs +194 -0
  81. package/dist/v1/libs/html/loader/utils/TinyMediaProgress.d.mts +138 -0
  82. package/dist/v1/libs/html/loader/utils/TinyMediaProgress.d.mts.map +1 -0
  83. package/dist/v1/libs/html/loader/utils/TinyMediaProgress.mjs +175 -0
  84. package/dist/v1/libs/tools/TinyPkgExportValidator.cjs +359 -55
  85. package/dist/v1/libs/tools/TinyPkgExportValidator.d.mts +64 -6
  86. package/dist/v1/libs/tools/TinyPkgExportValidator.d.mts.map +1 -1
  87. package/dist/v1/libs/tools/TinyPkgExportValidator.mjs +320 -57
  88. package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.cjs +0 -1
  89. package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.d.mts +0 -1
  90. package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.d.mts.map +1 -1
  91. package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.mjs +0 -1
  92. package/dist/v1/webTemplates/bootstrap/5.3/scss/background/_background-grid.scss +15 -0
  93. package/dist/v1/webTemplates/bootstrap/5.3/scss/components/buttons/_buttons-contrast.scss +208 -0
  94. package/dist/v1/webTemplates/bootstrap/5.3/scss/components/buttons/_buttons-ghost.scss +89 -0
  95. package/dist/v1/webTemplates/bootstrap/5.3/scss/components/icon/_cube-icon.scss +65 -0
  96. package/dist/v1/webTemplates/bootstrap/5.3/scss/components/icon/_sphere-pulse.scss +39 -0
  97. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_badges.scss +90 -0
  98. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_bootstrap-overrides.scss +495 -0
  99. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_buttons.scss +390 -0
  100. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_colors.scss +213 -0
  101. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_effects.scss +153 -0
  102. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_forms-tones.scss +69 -0
  103. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_forms.scss +323 -0
  104. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_global.scss +31 -0
  105. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_links.scss +47 -0
  106. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_tables.scss +25 -0
  107. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_theme.scss +21 -0
  108. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_tokens.scss +161 -0
  109. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_utilities.scss +81 -0
  110. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_variables.scss +63 -0
  111. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/plugins/_form-tone-mixins.scss +236 -0
  112. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/plugins/_sizing.scss +68 -0
  113. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/plugins/_tone-mixins.scss +392 -0
  114. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/plugins/_typography.scss +112 -0
  115. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/plugins/background/_tiny_gradient_1.scss +131 -0
  116. package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/plugins/colors/_pink.scss +47 -0
  117. package/docs/v1/Exports.md +33 -2
  118. package/docs/v1/README.md +9 -0
  119. package/docs/v1/basics/youtube.md +204 -0
  120. package/docs/v1/libs/html/loader/TinyFetchLoader.md +114 -0
  121. package/docs/v1/libs/html/loader/TinyImageLoader.md +141 -0
  122. package/docs/v1/libs/html/loader/TinyMediaCache.md +166 -0
  123. package/docs/v1/libs/html/loader/TinyMediaLoader.md +300 -0
  124. package/docs/v1/libs/tools/TinyPkgExportValidator.md +55 -0
  125. package/docs/v1/webTemplates/bootstrap/5.3/DeepStrap.md +177 -0
  126. package/package.json +244 -8
  127. /package/dist/v1/webTemplates/bootstrap/5.3/scss/input/{Placeholder-Colors-Fix.scss → _placeholder-colors-fix.scss} +0 -0
  128. /package/dist/v1/webTemplates/bootstrap/5.3/scss/spacing/{Spacing-Plus.scss → _spacing-plus.scss} +0 -0
@@ -0,0 +1,208 @@
1
+ // =============================================================================
2
+ // Contrast aliases
3
+ //
4
+ // `.X-contrast` and `.X-contrast-inverse` are not new variants: they are
5
+ // aliases for the `light` and `dark` tones of their own component, swapped by
6
+ // theme. They must stay a perfect mirror of those classes, so they use
7
+ // `@extend` instead of re-declaring the mixin.
8
+ //
9
+ // Requires: every component below must be imported before this file.
10
+ // `@extend` needs the target selector to already exist.
11
+ // =============================================================================
12
+
13
+ // ------------------------------------------------------------------ buttons --
14
+ $contrast-button-families: ('', 'outline-', 'subtle-', 'ghost-');
15
+
16
+ @each $family in $contrast-button-families {
17
+ .btn-#{$family}contrast {
18
+ @extend .btn-#{$family}light !optional;
19
+ }
20
+
21
+ [data-bs-theme='light'] .btn-#{$family}contrast {
22
+ @extend .btn-#{$family}dark !optional;
23
+ }
24
+
25
+ .btn-#{$family}contrast-inverse {
26
+ @extend .btn-#{$family}dark !optional;
27
+ }
28
+
29
+ [data-bs-theme='light'] .btn-#{$family}contrast-inverse {
30
+ @extend .btn-#{$family}light !optional;
31
+ }
32
+ }
33
+
34
+ // ------------------------------------------------------------------- alerts --
35
+ .alert-contrast {
36
+ @extend .alert-light !optional;
37
+ }
38
+
39
+ [data-bs-theme='light'] .alert-contrast {
40
+ @extend .alert-dark !optional;
41
+ }
42
+
43
+ .alert-contrast-inverse {
44
+ @extend .alert-dark !optional;
45
+ }
46
+
47
+ [data-bs-theme='light'] .alert-contrast-inverse {
48
+ @extend .alert-light !optional;
49
+ }
50
+
51
+ // -------------------------------------------------------------------- links --
52
+ .link-contrast {
53
+ @extend .link-light !optional;
54
+ }
55
+
56
+ [data-bs-theme='light'] .link-contrast {
57
+ @extend .link-dark !optional;
58
+ }
59
+
60
+ .link-contrast-inverse {
61
+ @extend .link-dark !optional;
62
+ }
63
+
64
+ [data-bs-theme='light'] .link-contrast-inverse {
65
+ @extend .link-light !optional;
66
+ }
67
+
68
+ // ------------------------------------------------------------------- tables --
69
+ .table-contrast {
70
+ @extend .table-light !optional;
71
+ }
72
+
73
+ [data-bs-theme='light'] .table-contrast {
74
+ @extend .table-dark !optional;
75
+ }
76
+
77
+ .table-contrast-inverse {
78
+ @extend .table-dark !optional;
79
+ }
80
+
81
+ [data-bs-theme='light'] .table-contrast-inverse {
82
+ @extend .table-light !optional;
83
+ }
84
+
85
+ // -------------------------------------------------------------- list groups --
86
+ .list-group-item-contrast {
87
+ @extend .list-group-item-light !optional;
88
+ }
89
+
90
+ [data-bs-theme='light'] .list-group-item-contrast {
91
+ @extend .list-group-item-dark !optional;
92
+ }
93
+
94
+ .list-group-item-contrast-inverse {
95
+ @extend .list-group-item-dark !optional;
96
+ }
97
+
98
+ [data-bs-theme='light'] .list-group-item-contrast-inverse {
99
+ @extend .list-group-item-light !optional;
100
+ }
101
+
102
+ // -------------------------------------------------------------------- badges --
103
+ .badge.text-bg-contrast {
104
+ @extend .text-bg-light !optional;
105
+ }
106
+
107
+ [data-bs-theme='light'] .badge.text-bg-contrast {
108
+ @extend .text-bg-dark !optional;
109
+ }
110
+
111
+ .badge.text-bg-contrast-inverse {
112
+ @extend .text-bg-dark !optional;
113
+ }
114
+
115
+ [data-bs-theme='light'] .badge.text-bg-contrast-inverse {
116
+ @extend .text-bg-light !optional;
117
+ }
118
+
119
+ // --------------------------------------------------------------- form checks --
120
+ .form-check-input-contrast {
121
+ @extend .form-check-input-light !optional;
122
+ }
123
+
124
+ [data-bs-theme='light'] .form-check-input-contrast {
125
+ @extend .form-check-input-dark !optional;
126
+ }
127
+
128
+ .form-check-input-contrast-inverse {
129
+ @extend .form-check-input-dark !optional;
130
+ }
131
+
132
+ [data-bs-theme='light'] .form-check-input-contrast-inverse {
133
+ @extend .form-check-input-light !optional;
134
+ }
135
+
136
+ // ------------------------------------------------------------------- base --
137
+ @each $prefix in ('text', 'bg', 'border', 'text-bg') {
138
+ .#{$prefix}-contrast {
139
+ @extend .#{$prefix}-light !optional;
140
+ }
141
+
142
+ [data-bs-theme='light'] .#{$prefix}-contrast {
143
+ @extend .#{$prefix}-dark !optional;
144
+ }
145
+
146
+ .#{$prefix}-contrast-inverse {
147
+ @extend .#{$prefix}-dark !optional;
148
+ }
149
+
150
+ [data-bts-theme='light'] .#{$prefix}-contrast-inverse {
151
+ @extend .#{$prefix}-light !optional;
152
+ }
153
+ }
154
+
155
+ // ----------------------------------------------------------------- subtle --
156
+ @each $prefix in ('bg', 'border') {
157
+ .#{$prefix}-contrast-subtle {
158
+ @extend .#{$prefix}-light-subtle !optional;
159
+ }
160
+
161
+ [data-bs-theme='light'] .#{$prefix}-contrast-subtle {
162
+ @extend .#{$prefix}-dark-subtle !optional;
163
+ }
164
+
165
+ .#{$prefix}-contrast-inverse-subtle {
166
+ @extend .#{$prefix}-dark-subtle !optional;
167
+ }
168
+
169
+ [data-bs-theme='light'] .#{$prefix}-contrast-inverse-subtle {
170
+ @extend .#{$prefix}-light-subtle !optional;
171
+ }
172
+ }
173
+
174
+ // --------------------------------------------------------------- emphasis --
175
+ .text-contrast-emphasis {
176
+ @extend .text-light-emphasis !optional;
177
+ }
178
+
179
+ [data-bs-theme='light'] .text-contrast-emphasis {
180
+ @extend .text-dark-emphasis !optional;
181
+ }
182
+
183
+ .text-contrast-inverse-emphasis {
184
+ @extend .text-dark-emphasis !optional;
185
+ }
186
+
187
+ [data-bs-theme='light'] .text-contrast-inverse-emphasis {
188
+ @extend .text-light-emphasis !optional;
189
+ }
190
+
191
+ // `_bootstrap-overrides.scss` redefines `.border-*` after Bootstrap, so
192
+ // `@extend .border-light` would only copy the last declaration. Declare the
193
+ // contrast alias directly to stay independent of the import order.
194
+ .border-contrast {
195
+ border-color: rgba(var(--bs-light-rgb), var(--bs-border-opacity, 1)) !important;
196
+ }
197
+
198
+ [data-bs-theme='light'] .border-contrast {
199
+ border-color: rgba(var(--bs-dark-rgb), var(--bs-border-opacity, 1)) !important;
200
+ }
201
+
202
+ .border-contrast-inverse {
203
+ border-color: rgba(var(--bs-dark-rgb), var(--bs-border-opacity, 1)) !important;
204
+ }
205
+
206
+ [data-bs-theme='light'] .border-contrast-inverse {
207
+ border-color: rgba(var(--bs-light-rgb), var(--bs-border-opacity, 1)) !important;
208
+ }
@@ -0,0 +1,89 @@
1
+ // =============================================================================
2
+ // Bootstrap 5.3 — Ghost button plugin
3
+ // =============================================================================
4
+ // A borderless, low-emphasis button variant.
5
+ //
6
+ // Usage:
7
+ // <button class="btn btn-ghost">Neutral</button>
8
+ // <button class="btn btn-ghost-primary">Primary</button>
9
+ // =============================================================================
10
+
11
+ @use 'sass:map';
12
+
13
+ // ------------------------------------------------------------------ config --
14
+ // Every tone is a plain CSS color or a `var(--token)`. The plugin never
15
+ // resolves the value, so host projects can wire their own design tokens.
16
+ $defaults: (
17
+ 'primary': rgb(var(--bs-primary-rgb)),
18
+ 'secondary': rgb(var(--bs-secondary-rgb)),
19
+ 'success': rgb(var(--bs-success-rgb)),
20
+ 'danger': rgb(var(--bs-danger-rgb)),
21
+ 'warning': rgb(var(--bs-warning-rgb)),
22
+ 'info': rgb(var(--bs-info-rgb)),
23
+ 'light': rgb(var(--bs-light-rgb)),
24
+ 'dark': rgb(var(--bs-dark-rgb)),
25
+ ) !default;
26
+
27
+ // Partial overrides are merged on top of `$defaults`, so passing
28
+ // `$tones: ('primary': red)` keeps every other tone available.
29
+ $tones: () !default;
30
+ $tones: map.merge($defaults, $tones);
31
+
32
+ $hover-alpha: 12% !default;
33
+ $active-alpha: 20% !default;
34
+ $focus-alpha: 30% !default;
35
+ $disabled-opacity: 0.4 !default;
36
+
37
+ // ------------------------------------------------------------------ mixin ---
38
+ /// Emits the CSS variables for a single ghost tone.
39
+ ///
40
+ /// @param {Color|String} $color - Any CSS color, or `currentColor`.
41
+ @mixin ghost-variant($color) {
42
+ --bs-btn-color: #{$color};
43
+ --bs-btn-bg: transparent;
44
+ --bs-btn-border-color: transparent;
45
+ --bs-btn-hover-color: #{$color};
46
+ --bs-btn-hover-bg: color-mix(in srgb, #{$color} #{$hover-alpha}, transparent);
47
+ --bs-btn-hover-border-color: transparent;
48
+ --bs-btn-active-color: #{$color};
49
+ --bs-btn-active-bg: color-mix(in srgb, #{$color} #{$active-alpha}, transparent);
50
+ --bs-btn-active-border-color: transparent;
51
+ --bs-btn-disabled-color: #{$color};
52
+ --bs-btn-disabled-bg: transparent;
53
+ --bs-btn-disabled-border-color: transparent;
54
+ }
55
+
56
+ // ------------------------------------------------------------------ base ----
57
+ // `--bs-btn-border-width: 0` removes the border from the layout entirely, so
58
+ // the disabled state cannot inherit a 1px line from Bootstrap's defaults.
59
+ .btn-ghost,
60
+ [class*='btn-ghost-'] {
61
+ --bs-btn-border-width: 0;
62
+ --bs-btn-border-color: transparent;
63
+ --bs-btn-hover-border-color: transparent;
64
+ --bs-btn-active-border-color: transparent;
65
+ --bs-btn-disabled-border-color: transparent;
66
+
67
+ &:focus-visible {
68
+ box-shadow: 0 0 0 0.25rem color-mix(in srgb, currentColor #{$focus-alpha}, transparent);
69
+ }
70
+
71
+ // Hard reset: no border, no ring, no shadow. Only the opacity changes.
72
+ &:disabled,
73
+ &.disabled {
74
+ border: 0;
75
+ box-shadow: none;
76
+ opacity: $disabled-opacity;
77
+ }
78
+ }
79
+
80
+ // ------------------------------------------------------------------ tones ---
81
+ .btn-ghost {
82
+ @include ghost-variant(currentColor);
83
+ }
84
+
85
+ @each $name, $color in $tones {
86
+ .btn-ghost-#{$name} {
87
+ @include ghost-variant($color);
88
+ }
89
+ }
@@ -0,0 +1,65 @@
1
+ // =============================================================================
2
+ // Cube Icon
3
+ // Bootstrap 5.3 architecture: Sass modules, overridable maps, CSS variables.
4
+ // =============================================================================
5
+
6
+ @use 'sass:map';
7
+
8
+ // Fallback so this partial also compiles outside a full Bootstrap build.
9
+ // Bootstrap 5.3 already declares: $prefix: 'bs-' !default;
10
+ $prefix: 'bs-' !default;
11
+
12
+ // Size scale. Each key generates a modifier class: .cube-icon-sm, .cube-icon-lg...
13
+ // The value is the box dimension (applied to both width and height).
14
+ $cube-icon-sizes: (
15
+ xs: 1rem,
16
+ sm: 1.5rem,
17
+ md: 3rem,
18
+ lg: 4rem,
19
+ xl: 6rem,
20
+ ) !default;
21
+
22
+ // Size applied by the base class. Must be a key of $cube-icon-sizes.
23
+ $cube-icon-size: md !default;
24
+
25
+ // Resolves a key from $cube-icon-sizes. Fails at compile time on typos.
26
+ @function cube-icon-size-value($key) {
27
+ @if not map.has-key($cube-icon-sizes, $key) {
28
+ @error "Unknown cube icon size `#{$key}`. Available keys: #{map.keys($cube-icon-sizes)}.";
29
+ }
30
+
31
+ @return map.get($cube-icon-sizes, $key);
32
+ }
33
+
34
+ // Emits the custom property only; width/height are declared once in .cube-icon.
35
+ @mixin cube-icon-apply-size($size) {
36
+ --#{$prefix}cube-icon-size: #{$size};
37
+ }
38
+
39
+ .cube-icon {
40
+ @include cube-icon-apply-size(cube-icon-size-value($cube-icon-size));
41
+
42
+ display: inline-flex;
43
+ flex: 0 0 auto;
44
+ align-items: center;
45
+ justify-content: center;
46
+ width: var(--#{$prefix}cube-icon-size);
47
+ height: var(--#{$prefix}cube-icon-size);
48
+ color: inherit;
49
+ line-height: 1;
50
+ vertical-align: middle;
51
+
52
+ > svg,
53
+ > img {
54
+ width: 100%;
55
+ height: 100%;
56
+ object-fit: contain;
57
+ }
58
+ }
59
+
60
+ // Generates .cube-icon-xs, .cube-icon-sm, .cube-icon-md, .cube-icon-lg, .cube-icon-xl
61
+ @each $key, $value in $cube-icon-sizes {
62
+ .cube-icon-#{$key} {
63
+ @include cube-icon-apply-size($value);
64
+ }
65
+ }
@@ -0,0 +1,39 @@
1
+ @use 'sass:map';
2
+
3
+ $defaults: (
4
+ 'primary': var(--bs-primary-rgb),
5
+ 'secondary': var(--bs-secondary-rgb),
6
+ 'success': var(--bs-success-rgb),
7
+ 'danger': var(--bs-danger-rgb),
8
+ 'warning': var(--bs-warning-rgb),
9
+ 'info': var(--bs-info-rgb),
10
+ 'light': var(--bs-light-rgb),
11
+ 'dark': var(--bs-dark-rgb),
12
+ ) !default;
13
+
14
+ // Partial overrides are merged on top of `$defaults`, so passing
15
+ // `$tones: ('primary': red)` keeps every other tone available.
16
+ $tones: () !default;
17
+ $tones: map.merge($defaults, $tones);
18
+
19
+ @each $name, $color in $tones {
20
+ .sphere-pulse-#{$name} {
21
+ width: 9px;
22
+ height: 9px;
23
+ background: rgb($color);
24
+ border-radius: 50%;
25
+ padding: 0px 4px;
26
+ animation: tiny-bs-sphere-pulse 2.4s ease-in-out infinite;
27
+ display: inline-block;
28
+
29
+ &.shadow-pulse {
30
+ box-shadow: 0 0 0 4px rgba($color, 0.12);
31
+ }
32
+ }
33
+ }
34
+
35
+ @keyframes tiny-bs-sphere-pulse {
36
+ 50% {
37
+ opacity: 0.35;
38
+ }
39
+ }
@@ -0,0 +1,90 @@
1
+ @use 'sass:map';
2
+ @use 'sass:meta';
3
+
4
+ // ---------------------------------------------------------------- registry --
5
+ /// Tone registry.
6
+ /// @type Map
7
+ $badge-tone-map: (
8
+ 'primary': (
9
+ token: 'accent',
10
+ on: 'accent',
11
+ ),
12
+ 'secondary': (
13
+ token: 'text-muted',
14
+ on: 'neutral-light',
15
+ ),
16
+ 'success': (
17
+ token: 'success',
18
+ on: 'success',
19
+ ),
20
+ 'danger': (
21
+ token: 'error',
22
+ on: 'error',
23
+ ),
24
+ 'warning': (
25
+ token: 'warn',
26
+ on: 'warn',
27
+ ),
28
+ 'info': (
29
+ token: 'info',
30
+ on: 'info',
31
+ ),
32
+ 'light': (
33
+ token: 'neutral-light',
34
+ on: 'neutral-light',
35
+ ),
36
+ 'dark': (
37
+ token: 'neutral-dark',
38
+ on: 'neutral-dark',
39
+ ),
40
+ 'white': (
41
+ token: 'neutral-light',
42
+ on: 'neutral-light',
43
+ ),
44
+ 'black': (
45
+ token: 'neutral-dark',
46
+ on: 'neutral-dark',
47
+ ),
48
+ );
49
+
50
+ @each $name, $config in $badge-tone-map {
51
+ @if meta.type-of($config) != 'map' {
52
+ @error 'Badge tone `#{$name}` must be a map with `token` and `on`, got `#{meta.type-of($config)}`.';
53
+ }
54
+
55
+ @each $key in ('token', 'on') {
56
+ @if not map.has-key($config, $key) {
57
+ @error 'Badge tone `#{$name}` is missing the `#{$key}` key.';
58
+ }
59
+ }
60
+ }
61
+
62
+ // -------------------------------------------------------------------- base --
63
+ .badge {
64
+ --bs-badge-font-size: 0.6875rem;
65
+ --bs-badge-font-weight: 500;
66
+
67
+ letter-spacing: 0.02em;
68
+ border: 1px solid transparent;
69
+ }
70
+
71
+ // ------------------------------------------------------------------- tones --
72
+ @each $name, $config in $badge-tone-map {
73
+ @include tone-badge($name, map.get($config, 'token'), map.get($config, 'on'));
74
+ }
75
+
76
+ // --------------------------------------------------------- surface pairing --
77
+ @each $name, $config in $badge-tone-map {
78
+ .bg-#{$name},
79
+ .text-bg-#{$name} {
80
+ @include tone-ink(map.get($config, 'on'));
81
+ }
82
+ }
83
+
84
+ .text-bg-white {
85
+ background-color: var(--ui-neutral-light) !important;
86
+ }
87
+
88
+ .text-bg-black {
89
+ background-color: var(--ui-neutral-dark) !important;
90
+ }