@fest-lib/fl-ui 0.1.1

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 (55) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/dist/assets/OPFS.uniform.worker-Ddx6J_37.js +2982 -0
  4. package/dist/fl-ui.js +16004 -0
  5. package/dist/font-registry-BWosB92f.js +271 -0
  6. package/package.json +104 -0
  7. package/src/styles/font-loader.ts +224 -0
  8. package/src/styles/font-registry.ts +275 -0
  9. package/src/styles/fonts/_index.scss +8 -0
  10. package/src/styles/fonts/_inter.scss +171 -0
  11. package/src/styles/index.scss +2 -0
  12. package/src/styles/index.ts +33 -0
  13. package/src/styles/layers.scss +1 -0
  14. package/src/styles/patch-global-native-controls.scss +13 -0
  15. package/src/styles/scripts/encode-fonts.ts +172 -0
  16. package/src/styles/skins/thin/Thin.ts +13 -0
  17. package/src/styles/ui/_bar.scss +271 -0
  18. package/src/styles/ui/_buttons.scss +215 -0
  19. package/src/styles/ui/_color.scss +3 -0
  20. package/src/styles/ui/_colorize.scss +5 -0
  21. package/src/styles/ui/_content.scss +169 -0
  22. package/src/styles/ui/_essentials-options.scss +2 -0
  23. package/src/styles/ui/_essentials.scss +705 -0
  24. package/src/styles/ui/_explorer-content.scss +362 -0
  25. package/src/styles/ui/_explorer.scss +237 -0
  26. package/src/styles/ui/_forms-bare-host-elements.scss +25 -0
  27. package/src/styles/ui/_forms-options.scss +2 -0
  28. package/src/styles/ui/_forms.scss +280 -0
  29. package/src/styles/ui/_forms_misc.scss +201 -0
  30. package/src/styles/ui/_gridbox.scss +298 -0
  31. package/src/styles/ui/_home-host.scss +179 -0
  32. package/src/styles/ui/_index.scss +22 -0
  33. package/src/styles/ui/_launcher-typography.scss +31 -0
  34. package/src/styles/ui/_layers.scss +48 -0
  35. package/src/styles/ui/_layout.scss +3 -0
  36. package/src/styles/ui/_markdown.scss +1636 -0
  37. package/src/styles/ui/_modal.scss +258 -0
  38. package/src/styles/ui/_motion.scss +3 -0
  39. package/src/styles/ui/_native-host-button-chrome.scss +31 -0
  40. package/src/styles/ui/_orientation-functions.scss +274 -0
  41. package/src/styles/ui/_orientbox.scss +97 -0
  42. package/src/styles/ui/_scrollbar.scss +257 -0
  43. package/src/styles/ui/_shared-overlays.scss +16 -0
  44. package/src/styles/ui/_sidebar.scss +477 -0
  45. package/src/styles/ui/_speed-dial.scss +47 -0
  46. package/src/styles/ui/_tables.scss +28 -0
  47. package/src/styles/ui/_tabs.scss +406 -0
  48. package/src/styles/ui/_taskbar.scss +215 -0
  49. package/src/styles/ui/_toolbars.scss +165 -0
  50. package/src/styles/ui/_typography.scss +11 -0
  51. package/src/styles/ui/_utils.scss +8 -0
  52. package/src/styles/ui/_variables.scss +45 -0
  53. package/src/styles/ui/_viewport.scss +469 -0
  54. package/src/styles/ui/_window-frame.scss +658 -0
  55. package/src/styles/ui/home-host-apply.scss +10 -0
@@ -0,0 +1,165 @@
1
+ // Toolbar Components - Refactored and Optimized
2
+ // Unified with design system variables and mixins
3
+
4
+ @use "veela-lib" as *;
5
+ @use "../../library/mixins" as ui;
6
+
7
+ //
8
+ @mixin toolbar {
9
+
10
+ .toolbar {
11
+ background-color: transparent;
12
+ display: flex;
13
+ flex-direction: column;
14
+ block-size: stretch;
15
+ inline-size: stretch;
16
+ max-inline-size: stretch;
17
+ grid-row: toolbar;
18
+ box-shadow: none;
19
+ padding: 0px;
20
+ max-block-size: min(3rem, 100%);;
21
+ min-block-size: stretch;
22
+ }
23
+
24
+ .view-toolbar {
25
+ background: transparent;
26
+ position: sticky;
27
+ inset-block-start: 0;
28
+ z-index: 10;
29
+ padding: 0px;
30
+
31
+ justify-content: flex-start;
32
+ place-content: center;
33
+ place-items: center;
34
+ place-self: center;
35
+ pointer-events: none;
36
+ inline-size: stretch;
37
+ max-inline-size: stretch;
38
+ max-block-size: min(3rem, 100%);
39
+ min-block-size: stretch;
40
+
41
+ box-sizing: border-box;
42
+ box-shadow: none;
43
+
44
+ //
45
+ @include ui.inline-toolbar(var(--gap-xs));
46
+ @include ui.tonal-surface(surface, var(--surface-opacity-subtle), var(--radius-lg), null, 1);
47
+ @include backdrop-blur("subtle");
48
+ @include container-clamped(stretch, max-content);
49
+
50
+ //
51
+ & { min-block-size: 0px; block-size: stretch; max-block-size: min(3rem, 100%); }
52
+ & { min-inline-size: 0px; inline-size: stretch; max-inline-size: stretch; }
53
+ & {
54
+ margin: 0px;
55
+ margin-inline: 0px;
56
+ box-shadow: none;
57
+ background-color: transparent;
58
+ padding: 0px;
59
+ padding-inline: 0px;
60
+ padding-block: 0px;
61
+ }
62
+
63
+ //
64
+ &:empty {
65
+ display: none;
66
+ }
67
+
68
+ .button-set {
69
+ @include ui.inline-toolbar(var(--gap-md));
70
+ @include ui.tonal-surface(surface-container, var(--surface-opacity-subtle, 0.00), var(--radius-lg), 0px);
71
+ @include container-clamped(stretch, stretch);
72
+
73
+ //
74
+ flex-wrap: nowrap;
75
+ padding: 0px;
76
+ padding-inline: 0.25rem;
77
+ padding-block: 0.25rem;
78
+ inline-size: stretch;
79
+ block-size: stretch;
80
+
81
+ //
82
+ &:empty { display: none; }
83
+ & { min-block-size: 3rem; block-size: stretch; max-block-size: 3rem; }
84
+ & { min-inline-size: 0px; inline-size: stretch; max-inline-size: stretch; }
85
+
86
+ //
87
+ button {
88
+ max-block-size: stretch;
89
+ border-radius: var(--radius-full);
90
+ padding: 0px;
91
+ pointer-events: auto;
92
+ touch-action: none;
93
+
94
+ //
95
+ @include ui.tonal-surface(surface-container, calc(var(--surface-opacity-subtle, 0.00) + 0.02), var(--radius-lg), 0px);
96
+ @include ui.inline-toolbar(var(--gap-sm));
97
+ @include toolbar-button;
98
+ @include flex-center;
99
+
100
+ //
101
+ & {
102
+ min-inline-size: 2.5rem;
103
+ min-block-size: 2.75rem;
104
+ inline-size: max-content;
105
+ block-size: stretch;
106
+ touch-action: manipulation;
107
+ flex-direction: row;
108
+ flex-wrap: nowrap;
109
+ max-inline-size: stretch;
110
+ padding: 0.5rem;
111
+ padding-block: 0px;
112
+ padding-inline: 0.5rem;
113
+ max-block-size: stretch;
114
+ flex-shrink: 0;
115
+ }
116
+
117
+ //
118
+ ui-icon {
119
+ padding: 0rem;
120
+ --icon-size: clamp(1.25rem, 5.5vmin, 1.75rem);
121
+ font-size: var(--icon-size);
122
+ block-size: auto;
123
+ inline-size: auto;
124
+ min-inline-size: 1.25rem;
125
+ min-block-size: 1.25rem;
126
+ max-block-size: none;
127
+ }
128
+
129
+ //
130
+ span {
131
+ display: block;
132
+ color: color-mix(in oklch, var(--on-surface, currentColor) var(--text-tint-primary, 92%), transparent);
133
+ padding-inline-end: 0.25rem;
134
+ max-inline-size: stretch;
135
+ inline-size: fit-content;
136
+ min-inline-size: fit-content;
137
+ padding-block: 0px;
138
+
139
+ @include ui.text-body("body-small");
140
+ }
141
+ }
142
+ }
143
+
144
+ // Mobile optimizations
145
+ @include breakpoint("md") {
146
+ justify-content: center;
147
+
148
+ .button-set {
149
+ justify-content: center;
150
+ inline-size: stretch;
151
+ }
152
+ }
153
+
154
+ //
155
+ @include container("lg") {
156
+ button span { display: none !important; }
157
+ }
158
+
159
+ //
160
+ @container (inline-size <= 600px) {
161
+ button span { display: none !important; };
162
+ }
163
+ }
164
+
165
+ }
@@ -0,0 +1,11 @@
1
+ @function md3-type($role, $token: size) {
2
+ @return var(--type-#{$role}-#{$token}, inherit);
3
+ }
4
+
5
+ @mixin type($role) {
6
+ font: var(--type-#{$role}, inherit);
7
+ }
8
+
9
+ @mixin text-wrap() {
10
+ overflow-wrap: anywhere;
11
+ }
@@ -0,0 +1,8 @@
1
+ @mixin visually-hidden() {
2
+ position: absolute;
3
+ inline-size: 1px;
4
+ block-size: 1px;
5
+ overflow: hidden;
6
+ clip-path: inset(50%);
7
+ white-space: nowrap;
8
+ }
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Filename: _variables.scss
3
+ * FullPath: modules/projects/fl.ui/src/styles/ui/_variables.scss
4
+ * Change date and time: 16.25.00_31.07.2026
5
+ * Reason for changes: Fallback --color-* via --u2-color-mod (token names kept).
6
+ */
7
+
8
+ // Design tokens for fl.ui when veela is not loaded (minimal fallback).
9
+ // WHY: function duplicated so vl-basic / standalone fl.ui sheets still resolve mods.
10
+ @#{"function --u2-color-mod(--base-color <color>, --index <number> : 550) returns <color>"} {
11
+ --i: clamp(0, var(--index), 1000);
12
+ --pivot: 550;
13
+ --white-distance: clamp(0, calc((var(--pivot) - var(--i)) / var(--pivot)), 1);
14
+ --black-distance: clamp(0, calc((var(--i) - var(--pivot)) / (1000 - var(--pivot))), 1);
15
+ --to-white: pow(var(--white-distance), 1.15);
16
+ --to-black: pow(var(--black-distance), 1.08);
17
+ --center-left: clamp(0, calc(var(--i) / var(--pivot)), 1);
18
+ --center-right: clamp(0, calc((1000 - var(--i)) / (1000 - var(--pivot))), 1);
19
+ --chroma-shape: sqrt(min(var(--center-left), var(--center-right)));
20
+ --chroma-scale: calc(0.08 + 0.92 * var(--chroma-shape));
21
+ result: oklch(
22
+ from var(--base-color)
23
+ calc(l + (0.985 - l) * var(--to-white) + (0.16 - l) * var(--to-black))
24
+ calc(c * var(--chroma-scale))
25
+ h
26
+ );
27
+ }
28
+
29
+ :root {
30
+ --fl-ui-radius: 0.5rem;
31
+ --fl-ui-gap: 0.75rem;
32
+
33
+ /*
34
+ * NOTE: Standalone fl.ui fallback (used by _explorer.scss, _explorer-content.scss).
35
+ * Canonical color-token source of truth is veela `core/misc/_tokens.scss`.
36
+ * When veela is loaded, its `:root` `--color-*` / `--error-color` win by source
37
+ * order; these remain as fallbacks for standalone fl.ui without veela.
38
+ */
39
+ --color-primary: #2e3a64;
40
+ --base-color: var(--color-primary);
41
+ --color-surface: --u2-color-mod(var(--base-color), 920);
42
+ --color-on-surface: --u2-color-mod(var(--base-color), 100);
43
+ --color-on-surface-variant: --u2-color-mod(var(--base-color), 280);
44
+ --error-color: #f87171;
45
+ }
@@ -0,0 +1,469 @@
1
+ @use "../misc/functions" as lg;
2
+ @use "sass:list";
3
+ @use "sass:string";
4
+ @use "sass:meta";
5
+
6
+ //
7
+ // 2D shorthand helpers
8
+ @function v2-suffix($suffix) {
9
+ @if $suffix == null or $suffix == "" { @return ""; }
10
+
11
+ $value: #{$suffix};
12
+ @if string.slice($value, 1, 1) == "-" {
13
+ @return string.unquote($value);
14
+ }
15
+
16
+ @return string.unquote("-#{$value}");
17
+ }
18
+
19
+ @mixin v2-pair($token, $first-value, $second-value, $axes: ("x", "y")) {
20
+ $first-suffix: v2-suffix(list.nth($axes, 1));
21
+ $second-suffix: v2-suffix(list.nth($axes, 2));
22
+
23
+ --#{$token}#{$first-suffix}: #{$first-value};
24
+ --#{$token}#{$second-suffix}: #{$second-value};
25
+ }
26
+
27
+ @function v2-size($axis, $primary, $secondary, $orient: var(--orient, 0)) {
28
+ @return string.unquote("--get-oriented-size(#{$orient}, #{$primary}, #{$secondary}, #{$axis})");
29
+ }
30
+
31
+ @function v2-size-num($axis, $primary, $secondary, $orient: var(--orient, 0)) {
32
+ @return string.unquote("--get-oriented-size-num(#{$orient}, #{$primary}, #{$secondary}, #{$axis})");
33
+ }
34
+
35
+ @function v2-coord($axis, $first, $second, $size-x, $size-y, $orient: var(--orient, 0)) {
36
+ @return string.unquote("--get-oriented-coordinate(#{$orient}, #{$first}, #{$second}, #{$size-x}, #{$size-y}, #{$axis})");
37
+ }
38
+
39
+ @function v2-coord-num($axis, $first, $second, $max-x, $max-y, $orient: var(--orient, 0)) {
40
+ @return string.unquote("--get-oriented-coord-num(#{$orient}, #{$first}, #{$second}, #{$max-x}, #{$max-y}, #{$axis})");
41
+ }
42
+
43
+ @function v2-vec($axis, $first, $second, $orient: var(--orient, 0)) {
44
+ @return string.unquote("--get-oriented-vector(#{$orient}, #{$first}, #{$second}, #{$axis})");
45
+ }
46
+
47
+ @function v2-pick($value, $index, $fallback: null) {
48
+ @if meta.type-of($value) != "list" {
49
+ @return if(
50
+ sass($index == 1): $value;
51
+ else: $fallback;
52
+ );
53
+ }
54
+
55
+ @if list.length($value) < $index {
56
+ @return $fallback;
57
+ }
58
+
59
+ @return list.nth($value, $index);
60
+ }
61
+
62
+ @mixin v2-size-pair($token, $axis-0, $axis-1: $axis-0, $axes: ("x", "y"), $orient: var(--orient, 0)) {
63
+ $a0-primary: v2-pick($axis-0, 1);
64
+ $a0-secondary: v2-pick($axis-0, 2);
65
+ $a1-primary: v2-pick($axis-1, 1, $a0-primary);
66
+ $a1-secondary: v2-pick($axis-1, 2, $a0-secondary);
67
+
68
+ @include v2-pair(
69
+ $token,
70
+ v2-size(0, $a0-primary, $a0-secondary, $orient),
71
+ v2-size(1, $a1-primary, $a1-secondary, $orient),
72
+ $axes
73
+ );
74
+ }
75
+
76
+ @mixin v2-size-num-pair($token, $axis-0, $axis-1: $axis-0, $axes: ("x", "y"), $orient: var(--orient, 0)) {
77
+ $a0-primary: v2-pick($axis-0, 1);
78
+ $a0-secondary: v2-pick($axis-0, 2);
79
+ $a1-primary: v2-pick($axis-1, 1, $a0-primary);
80
+ $a1-secondary: v2-pick($axis-1, 2, $a0-secondary);
81
+
82
+ @include v2-pair(
83
+ $token,
84
+ v2-size-num(0, $a0-primary, $a0-secondary, $orient),
85
+ v2-size-num(1, $a1-primary, $a1-secondary, $orient),
86
+ $axes
87
+ );
88
+ }
89
+
90
+ @mixin v2-coord-pair($token, $axis-0, $axis-1: $axis-0, $axes: ("x", "y"), $orient: var(--orient, 0)) {
91
+ $a0-first: v2-pick($axis-0, 1);
92
+ $a0-second: v2-pick($axis-0, 2);
93
+ $a0-size-x: v2-pick($axis-0, 3);
94
+ $a0-size-y: v2-pick($axis-0, 4);
95
+
96
+ $a1-first: v2-pick($axis-1, 1, $a0-first);
97
+ $a1-second: v2-pick($axis-1, 2, $a0-second);
98
+ $a1-size-x: v2-pick($axis-1, 3, $a0-size-x);
99
+ $a1-size-y: v2-pick($axis-1, 4, $a0-size-y);
100
+
101
+ @include v2-pair(
102
+ $token,
103
+ v2-coord(0, $a0-first, $a0-second, $a0-size-x, $a0-size-y, $orient),
104
+ v2-coord(1, $a1-first, $a1-second, $a1-size-x, $a1-size-y, $orient),
105
+ $axes
106
+ );
107
+ }
108
+
109
+ @mixin v2-coord-num-pair($token, $axis-0, $axis-1: $axis-0, $axes: ("x", "y"), $orient: var(--orient, 0)) {
110
+ $a0-first: v2-pick($axis-0, 1);
111
+ $a0-second: v2-pick($axis-0, 2);
112
+ $a0-max-x: v2-pick($axis-0, 3);
113
+ $a0-max-y: v2-pick($axis-0, 4);
114
+
115
+ $a1-first: v2-pick($axis-1, 1, $a0-first);
116
+ $a1-second: v2-pick($axis-1, 2, $a0-second);
117
+ $a1-max-x: v2-pick($axis-1, 3, $a0-max-x);
118
+ $a1-max-y: v2-pick($axis-1, 4, $a0-max-y);
119
+
120
+ @include v2-pair(
121
+ $token,
122
+ v2-coord-num(0, $a0-first, $a0-second, $a0-max-x, $a0-max-y, $orient),
123
+ v2-coord-num(1, $a1-first, $a1-second, $a1-max-x, $a1-max-y, $orient),
124
+ $axes
125
+ );
126
+ }
127
+
128
+ @mixin v2-vec-pair($token, $axis-0, $axis-1: $axis-0, $axes: ("x", "y"), $orient: var(--orient, 0)) {
129
+ $a0-first: v2-pick($axis-0, 1);
130
+ $a0-second: v2-pick($axis-0, 2);
131
+ $a1-first: v2-pick($axis-1, 1, $a0-first);
132
+ $a1-second: v2-pick($axis-1, 2, $a0-second);
133
+
134
+ @include v2-pair(
135
+ $token,
136
+ v2-vec(0, $a0-first, $a0-second, $orient),
137
+ v2-vec(1, $a1-first, $a1-second, $orient),
138
+ $axes
139
+ );
140
+ }
141
+
142
+ @mixin oriented($property, $portrait, $landscape) {
143
+ & { #{$property}: #{$portrait}; }
144
+ @media (orientation: portrait) { #{$property}: #{$portrait}; }
145
+ @media (orientation: landscape) { #{$property}: #{$landscape}; }
146
+ }
147
+
148
+
149
+ //
150
+ @function inverse-orient($orient) {
151
+ @return mod(calc(4 - $orient), 4);
152
+ }
153
+
154
+
155
+ //
156
+ @mixin compute_os_conditions {
157
+ & {
158
+ --in-orient-base: round(nearest, var(--orient, 0), 1);
159
+ --in-rev-cond-x: clamp(0, calc(var(--in-orient-base, 0) - 1), 1);
160
+ --in-rev-cond-y: clamp(0, calc((1 - abs(calc(var(--in-orient-base, 0) - 1.5))) * 2), 1);
161
+ --in-swap-cond: #{css-rem(var(--orient, 0), 2)};
162
+ --in-rev-vx: calc(var(--in-rev-cond-x, 1) * -2 + 1);
163
+ --in-rev-vy: calc(var(--in-rev-cond-y, 1) * -2 + 1);
164
+ }
165
+ }
166
+
167
+
168
+
169
+ @mixin compute_cs_size_to_os {
170
+ $orient: #{inverse-orient(var(--orient, 0))};
171
+
172
+ & {
173
+ @include v2-size-pair(
174
+ "os-size",
175
+ (var(--cs-size-x, 100cqi), var(--cs-size-y, 100cqb)),
176
+ (var(--cs-size-x, 100cqb), var(--cs-size-y, 100cqi)),
177
+ $orient: $orient
178
+ );
179
+
180
+ @include v2-size-pair(
181
+ "os-self-size",
182
+ (var(--cs-self-size-x, 100%), var(--cs-self-size-y, 100%)),
183
+ $orient: $orient
184
+ );
185
+ }
186
+ }
187
+
188
+ @mixin compute_from_cs_to_os {
189
+ $orient: #{inverse-orient(var(--orient, 0))};
190
+
191
+ & {
192
+ @include v2-coord-pair(
193
+ "os-inset",
194
+ (var(--cs-inset-x, 0px), var(--cs-inset-y, 0px), var(--cs-size-x, 100cqi), var(--cs-size-y, 100cqb)),
195
+ $orient: $orient
196
+ );
197
+
198
+ @include v2-vec-pair(
199
+ "os-drag",
200
+ (var(--cs-drag-x, 0px), var(--cs-drag-y, 0px)),
201
+ $orient: $orient
202
+ );
203
+ }
204
+ }
205
+
206
+
207
+
208
+ @mixin compute_os_size_to_cs {
209
+ $orient: var(--orient, 0);
210
+
211
+ & {
212
+ @include v2-size-pair(
213
+ "cs-size",
214
+ (var(--os-size-x, 100cqb), var(--os-size-y, 100cqi)),
215
+ (var(--os-size-x, 100cqi), var(--os-size-y, 100cqb)),
216
+ $orient: $orient
217
+ );
218
+
219
+ @include v2-size-pair(
220
+ "cs-self-size",
221
+ (var(--os-self-size-x, 100%), var(--os-self-size-y, 100%)),
222
+ $orient: $orient
223
+ );
224
+ }
225
+ }
226
+
227
+ @mixin compute_from_os_to_cs {
228
+ $orient: var(--orient, 0);
229
+
230
+ & {
231
+ @include v2-coord-pair(
232
+ "cs-inset",
233
+ (var(--os-inset-x, 0px), var(--os-inset-y, 0px), var(--os-size-x, 100cqi), var(--os-size-y, 100cqb)),
234
+ $orient: $orient
235
+ );
236
+
237
+ @include v2-vec-pair(
238
+ "cs-drag",
239
+ (var(--os-drag-x, 0px), var(--os-drag-y, 0px)),
240
+ $orient: $orient
241
+ );
242
+ }
243
+ }
244
+
245
+
246
+ @mixin portrait-size {
247
+ --cqi: 100cqmin;
248
+ --cqb: 100cqmax;
249
+ }
250
+
251
+ @mixin landscape-size {
252
+ --cqi: 100cqmax;
253
+ --cqb: 100cqmin;
254
+ }
255
+
256
+ @mixin init-os-size-by-native {
257
+ @include v2-pair("os-size", var(--cqi, 100cqi), var(--cqb, 100cqb));
258
+ }
259
+
260
+ @mixin init-cs-size {
261
+ @include v2-pair("cs-size", 100cqi, 100cqb);
262
+ }
263
+
264
+ @mixin centered-self($transforms: null) {
265
+ transform-origin: 0% 0%;
266
+ transform:
267
+ #{$transforms}
268
+ scale3d(var(--scale, 1), var(--scale, 1), var(--scale, 1))
269
+ #{perfect-translate(calc(var(--translate-x, 0px) - 50%), calc(var(--translate-y, 0px) - 50%))};
270
+ place-self: center;
271
+ }
272
+
273
+ @mixin centered-with-offset {
274
+ $translate: #{perfect-translate(var(--cs-drag-x, 0px), var(--cs-drag-y, 0px))};
275
+ @include centered-self($translate);
276
+ }
277
+
278
+ @mixin use-inset {
279
+ inset: var(--cs-inset-y, 0px) auto auto var(--cs-inset-x, 0px);
280
+ }
281
+
282
+ //
283
+ @mixin use_dvp {
284
+ & { --avi: 100dvmin; --avb: 100dvmax; };
285
+ & {
286
+ --vp-i-size: var(--avi, 100dvmin);
287
+ --vp-b-size: var(--avb, 100dvmax);
288
+ }
289
+ }
290
+
291
+ //
292
+ @mixin use_lvp {
293
+ & { --avi: 100lvmin; --avb: 100lvmax; };
294
+ & {
295
+ --vp-i-size: var(--avi, 100lvmin);
296
+ --vp-b-size: var(--avb, 100lvmax);
297
+ }
298
+ }
299
+
300
+
301
+ //
302
+ @mixin when-fullscreen($selector: &) {
303
+ @media (display-mode: fullscreen) { @content; }
304
+ @at-root :fullscreen #{$selector} { @content; }
305
+ }
306
+
307
+ //
308
+ @mixin vp-vars {
309
+ @include use_dvp();
310
+ @include when-fullscreen() {
311
+ @include use_lvp();
312
+ & {
313
+ --vp-i-size: min(var(--avail-width, 100dvmin), 100dvmin);
314
+ --vp-b-size: min(var(--avail-height, 100dvmax), 100dvmax);
315
+ }
316
+ }
317
+ };
318
+
319
+ //
320
+ @mixin fit-viewport {
321
+ @include vp-vars;
322
+ & {
323
+ @include oriented(inline-size, var(--vp-i-size, 100lvi), var(--vp-b-size, 100lvb));
324
+ @include oriented(block-size, var(--vp-b-size, 100lvb), var(--vp-i-size, 100lvi));
325
+ @include oriented(max-inline-size, var(--vp-i-size, 100lvi), var(--vp-b-size, 100lvb));
326
+ @include oriented(max-block-size, var(--vp-b-size, 100lvb), var(--vp-i-size, 100lvi));
327
+ }
328
+ };
329
+
330
+ //
331
+ @function perfect-translate($x: 0px, $y: 0px) {
332
+ @return translate3d(round(nearest, #{$x}, calc(1px / var(--pixel-ratio, 1))), round(nearest, #{$y}, calc(1px / var(--pixel-ratio, 1))), 0);
333
+ }
334
+
335
+ //
336
+ @mixin compute_grid_item_cell() {
337
+ /* WHY: `v2-coord-num` maps logical `--cell-x`/`--cell-y` into physical `cs-grid-*` using `--orient` from the launcher / `ui-orientbox` host; without inherit, items see initial `0` and placement ignores rotation. */
338
+ & {
339
+ --orient: inherit;
340
+ }
341
+
342
+ // hack: use translate diff shifting for correct animation for CSS Grid Layout
343
+ & { // currently, I have no viable solution for correct animation for CSS Grid Layout
344
+ @include v2-pair(
345
+ "cs-sw-unit",
346
+ calc(var(--cs-size-x, 100cqi) / var(--cs-layout-c, 1)),
347
+ calc(var(--cs-size-y, 100cqb) / var(--cs-layout-r, 1))
348
+ );
349
+ }
350
+
351
+ & {
352
+ @include v2-pair(
353
+ "cs-transition",
354
+ 0px,
355
+ 0px,
356
+ ("c", "r")
357
+ );
358
+ }
359
+
360
+ &[data-dragging] {
361
+ //
362
+ @include v2-pair(
363
+ "cs-transition",
364
+ calc((var(--rv-grid-c, 0) - var(--cs-grid-c, 0)) * var(--cs-sw-unit-x, 1px)),
365
+ calc((var(--rv-grid-r, 0) - var(--cs-grid-r, 0)) * var(--cs-sw-unit-y, 1px)),
366
+ ("c", "r")
367
+ );
368
+ }
369
+
370
+ & {
371
+ @include v2-pair("p-cell", var(--cell-x), var(--cell-y));
372
+
373
+ // CLAMPED GRID
374
+ --f-col: clamp(1, var(--layout-c, 4), 16);
375
+ --f-row: clamp(1, var(--layout-r, 8), 16);
376
+
377
+ //
378
+ @include v2-pair(
379
+ "grid",
380
+ clamp(0, var(--cell-x), calc(var(--f-col) - 1)),
381
+ clamp(0, var(--cell-y), calc(var(--f-row) - 1)),
382
+ ("c", "r")
383
+ );
384
+
385
+ //
386
+ @include v2-pair(
387
+ "p-grid",
388
+ clamp(0, var(--p-cell-x), calc(var(--f-col) - 1)),
389
+ clamp(0, var(--p-cell-y), calc(var(--f-row) - 1)),
390
+ ("c", "r")
391
+ );
392
+
393
+ //
394
+ @include v2-pair(
395
+ "fc-cell",
396
+ clamp(0, var(--cs-grid-c, 0), calc(var(--f-col) - 1)),
397
+ clamp(0, var(--cs-grid-r, 0), calc(var(--f-row) - 1))
398
+ );
399
+
400
+ //
401
+ @include v2-pair(
402
+ "fp-cell",
403
+ clamp(0, var(--cs-p-grid-c, 0), calc(var(--f-col) - 1)),
404
+ clamp(0, var(--cs-p-grid-r, 0), calc(var(--f-row) - 1))
405
+ );
406
+
407
+ //
408
+ @include v2-pair(
409
+ "dir",
410
+ calc(var(--cs-grid-c, 0) - var(--cs-p-grid-c, 0)),
411
+ calc(var(--cs-grid-r, 0) - var(--cs-p-grid-r, 0))
412
+ );
413
+ }
414
+
415
+ //
416
+ & { @include v2-pair("rv-grid", var(--cs-grid-c, 1), var(--cs-grid-r, 1), ("c", "r")); }
417
+ &[data-dragging] { @include v2-pair("rv-grid", var(--cs-p-grid-c, 1), var(--cs-p-grid-r, 1), ("c", "r")); }
418
+
419
+ //
420
+ & {
421
+ @include v2-pair("os-grid", var(--grid-c, 1), var(--grid-r, 1), ("c", "r"));
422
+ @include v2-coord-num-pair(
423
+ "cs-grid",
424
+ (var(--os-grid-c, 1), var(--os-grid-r, 1), calc(var(--f-col, 1) - 1), calc(var(--f-row, 1) - 1)),
425
+ $axes: ("c", "r")
426
+ );
427
+ }
428
+
429
+ //
430
+ & {
431
+ @include v2-pair("os-p-grid", var(--p-cell-x, 0), var(--p-cell-y, 0), ("c", "r"));
432
+ @include v2-coord-num-pair(
433
+ "cs-p-grid",
434
+ (var(--os-p-grid-c, 0), var(--os-p-grid-r, 0), calc(var(--f-col, 1) - 1), calc(var(--f-row, 1) - 1)),
435
+ $axes: ("c", "r")
436
+ );
437
+ }
438
+
439
+ & {
440
+ @include v2-pair(
441
+ "ox",
442
+ calc(var(--os-size-x, 100cqi) / var(--os-layout-c, 1)),
443
+ calc(var(--os-size-y, 100cqb) / var(--os-layout-r, 1)),
444
+ ("c-unit", "r-unit")
445
+ );
446
+
447
+ //
448
+ @include v2-pair(
449
+ "os-inset",
450
+ calc((var(--grid-c, 1) + 0.5) * var(--ox-c-unit, 1px)),
451
+ calc((var(--grid-r, 1) + 0.5) * var(--ox-r-unit, 1px))
452
+ );
453
+ }
454
+ }
455
+
456
+ //
457
+ @mixin compute_orient_grid_layout() {
458
+ & {
459
+ @include v2-pair("os-layout", var(--layout-c, 4), var(--layout-r, 8), ("c", "r"));
460
+ @include v2-size-num-pair(
461
+ "cs-layout",
462
+ (var(--os-layout-c, 4), var(--os-layout-r, 8)),
463
+ $axes: ("c", "r")
464
+ );
465
+ }
466
+ }
467
+
468
+ // :root `--vv-width`, `--vv-height`, `--vv-offset-left`, `--vv-offset-top`, `--vv-scale`
469
+ // are set by fest/dom `getAvailSize()` / `updateVP()` (see `whenAnyScreenChanges`).