@teseor/css 1.15.7 → 1.16.0

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 (42) hide show
  1. package/dist/compiled.css +1 -1
  2. package/dist/index.css +7 -8
  3. package/package.json +1 -1
  4. package/src/components/content/divider/docs.html +1 -1
  5. package/src/components/content/scroll-area/docs.html +2 -2
  6. package/src/components/data-display/status/docs.html +2 -2
  7. package/src/components/feedback/skeleton/docs.html +2 -2
  8. package/src/components/feedback/toast/docs.html +12 -12
  9. package/src/components/forms/checkbox/docs.html +1 -1
  10. package/src/components/forms/radio/docs.html +5 -5
  11. package/src/components/forms/toggle/docs.html +3 -3
  12. package/src/components/navigation/dropdown-menu/docs.html +1 -1
  13. package/src/components/overlays/dialog/docs.html +6 -6
  14. package/src/components/overlays/drawer/docs.html +17 -17
  15. package/src/components/overlays/modal/docs.html +12 -12
  16. package/src/components/overlays/overlay/docs.html +8 -8
  17. package/src/components/overlays/popover/docs.html +6 -6
  18. package/src/components/overlays/tooltip/docs.html +10 -10
  19. package/src/config/guides/getting-started.docs.html +1 -1
  20. package/src/config/guides/theming.docs.html +11 -11
  21. package/src/config/tokens/_variables.scss +30 -23
  22. package/src/config/tokens/colors/index.scss +18 -0
  23. package/src/config/tokens/docs.html +0 -11
  24. package/src/config/tokens/index.scss +0 -1
  25. package/src/config/tokens/radius.scss +5 -4
  26. package/src/config/tokens/shadows.scss +4 -3
  27. package/src/debug/docs.html +3 -3
  28. package/src/debug/index.scss +4 -5
  29. package/src/layout/aspect-ratio/docs.html +7 -7
  30. package/src/layout/center/docs.html +3 -3
  31. package/src/layout/footer/index.scss +2 -2
  32. package/src/layout/main/docs.html +3 -3
  33. package/src/layout/nav-rail/docs.html +1 -1
  34. package/src/layout/sidebar/docs.html +3 -3
  35. package/src/layout/sidebar-nav/docs.html +6 -6
  36. package/src/utilities/position/api.json +6 -0
  37. package/src/utilities/position/docs.html +29 -0
  38. package/src/utilities/position/position.scss +74 -0
  39. package/src/utilities/scroll-animation/docs.html +1 -1
  40. package/src/utilities/scroll-snap/docs.html +33 -33
  41. package/src/utilities/text/docs.html +5 -5
  42. package/src/config/tokens/semantic-spacing.scss +0 -12
@@ -6,23 +6,23 @@ weight: 2
6
6
  ---
7
7
 
8
8
  <!-- @brand_colors -->
9
- <!-- Change the entire color palette by adjusting hue values -->
10
- <div class="theme-demo">
9
+ <!-- Override --ui-color-primary to change the entire color palette. All shades (light, dark, subtle, hover) derive automatically via color-mix(). -->
10
+ <div class="demo-theme">
11
11
  <button class="ui-button">{{ t('primary', 'Primary') }}</button>
12
12
  <button class="ui-button ui-button--secondary">{{ t('secondary', 'Secondary') }}</button>
13
13
  <button class="ui-button ui-button--danger">{{ t('danger', 'Danger') }}</button>
14
14
  </div>
15
- <div class="theme-demo theme-purple">
15
+ <div class="demo-theme demo-theme--purple">
16
16
  <button class="ui-button">{{ t('primary', 'Primary') }}</button>
17
17
  <button class="ui-button ui-button--secondary">{{ t('secondary', 'Secondary') }}</button>
18
18
  <button class="ui-button ui-button--danger">{{ t('danger', 'Danger') }}</button>
19
19
  </div>
20
- <div class="theme-demo theme-teal">
20
+ <div class="demo-theme demo-theme--teal">
21
21
  <button class="ui-button">{{ t('primary', 'Primary') }}</button>
22
22
  <button class="ui-button ui-button--secondary">{{ t('secondary', 'Secondary') }}</button>
23
23
  <button class="ui-button ui-button--danger">{{ t('danger', 'Danger') }}</button>
24
24
  </div>
25
- <div class="theme-demo theme-orange">
25
+ <div class="demo-theme demo-theme--orange">
26
26
  <button class="ui-button">{{ t('primary', 'Primary') }}</button>
27
27
  <button class="ui-button ui-button--secondary">{{ t('secondary', 'Secondary') }}</button>
28
28
  <button class="ui-button ui-button--danger">{{ t('danger', 'Danger') }}</button>
@@ -30,17 +30,17 @@ weight: 2
30
30
 
31
31
  <!-- @dark_mode -->
32
32
  <!-- Dark mode uses the CSS light-dark() function. Tokens resolve automatically based on color-scheme. Override with data-theme attribute. -->
33
- <div class="theme-demo">
33
+ <div class="demo-theme">
34
34
  <div class="ui-card">
35
35
  <p>{{ t('follows_os_color_scheme', 'Follows OS color scheme') }}</p>
36
36
  </div>
37
37
  </div>
38
- <div class="theme-demo" data-theme="light">
38
+ <div class="demo-theme" data-theme="light">
39
39
  <div class="ui-card">
40
40
  <p>{{ t('always_light', 'Always light') }}</p>
41
41
  </div>
42
42
  </div>
43
- <div class="theme-demo" data-theme="dark">
43
+ <div class="demo-theme" data-theme="dark">
44
44
  <div class="ui-card">
45
45
  <p>{{ t('always_dark', 'Always dark') }}</p>
46
46
  </div>
@@ -48,12 +48,12 @@ weight: 2
48
48
 
49
49
  <!-- @component_overrides -->
50
50
  <!-- Override specific component tokens -->
51
- <div class="theme-demo custom-buttons">
51
+ <div class="demo-theme demo-buttons">
52
52
  <button class="ui-button ui-button--sm">{{ t('small', 'Small') }}</button>
53
53
  <button class="ui-button">{{ t('default', 'Default') }}</button>
54
54
  <button class="ui-button ui-button--lg">{{ t('large', 'Large') }}</button>
55
55
  </div>
56
- <div class="theme-demo custom-cards">
56
+ <div class="demo-theme demo-cards">
57
57
  <div class="ui-card">
58
58
  <p>{{ t('card_with_custom_padding', 'Card with custom padding') }}</p>
59
59
  </div>
@@ -61,7 +61,7 @@ weight: 2
61
61
 
62
62
  <!-- @full_theme_example -->
63
63
  <!-- Complete theme customization -->
64
- <div class="theme-demo theme-corporate">
64
+ <div class="demo-theme demo-theme--corporate">
65
65
  <button class="ui-button">{{ t('action', 'Action') }}</button>
66
66
  <div class="ui-card">
67
67
  <p>{{ t('corporate_theme_with_teal_accent_and_sharp_corners', 'Corporate theme with teal accent and sharp corners') }}</p>
@@ -21,9 +21,6 @@ $row-6: $row * 6;
21
21
  // 2. Colors — OKLCH for perceptual uniformity
22
22
  // ==========================================================================
23
23
 
24
- // Theming hue — used in HSL fallbacks for shadows, debug overlays
25
- $hue-primary: 220;
26
-
27
24
  // Base palette
28
25
  $color-primary: oklch(55% 0.22 250);
29
26
  $color-success: oklch(60% 0.18 145);
@@ -31,6 +28,30 @@ $color-warning: oklch(75% 0.18 70);
31
28
  $color-danger: oklch(60% 0.22 25);
32
29
  $color-neutral: oklch(50% 0.02 250);
33
30
 
31
+ // Primary shades (CSS uses color-mix)
32
+ $color-primary-light: oklch(75% 0.15 250);
33
+ $color-primary-dark: oklch(40% 0.18 250);
34
+ $color-primary-subtle: oklch(95% 0.03 250);
35
+ $color-primary-hover: oklch(48% 0.20 250);
36
+
37
+ // Success shades (CSS uses color-mix)
38
+ $color-success-light: oklch(80% 0.12 145);
39
+ $color-success-dark: oklch(45% 0.15 145);
40
+ $color-success-subtle: oklch(95% 0.03 145);
41
+ $color-success-hover: oklch(52% 0.16 145);
42
+
43
+ // Warning shades (CSS uses color-mix)
44
+ $color-warning-light: oklch(88% 0.12 70);
45
+ $color-warning-dark: oklch(58% 0.15 70);
46
+ $color-warning-subtle: oklch(96% 0.03 70);
47
+ $color-warning-hover: oklch(66% 0.16 70);
48
+
49
+ // Danger shades (CSS uses color-mix)
50
+ $color-danger-light: oklch(80% 0.14 25);
51
+ $color-danger-dark: oklch(45% 0.18 25);
52
+ $color-danger-subtle: oklch(95% 0.03 25);
53
+ $color-danger-hover: oklch(52% 0.20 25);
54
+
34
55
  // Neutral scale — HSL approximation of color-mix(in oklch, ...) results.
35
56
  // CSS tokens use oklch color-mix(); these HSL values are static SCSS
36
57
  // fallbacks for when custom properties are unavailable.
@@ -45,10 +66,6 @@ $color-neutral-700: hsl(220 10% 25%);
45
66
  $color-neutral-800: hsl(220 10% 15%);
46
67
  $color-neutral-900: hsl(220 10% 10%);
47
68
 
48
- // Primary shades (CSS uses color-mix)
49
- $color-primary-light: oklch(75% 0.15 250);
50
- $color-primary-dark: oklch(40% 0.18 250);
51
-
52
69
  // ==========================================================================
53
70
  // 3. Spacing — derived from $unit
54
71
  // ==========================================================================
@@ -127,11 +144,12 @@ $font-size-relative-xs: 0.6em;
127
144
  $font-size-relative-sm: 0.75em;
128
145
 
129
146
  // ==========================================================================
130
- // 5. Radius — derived from $unit
147
+ // 5. Radius — derived from $radius-base (which defaults to $unit)
131
148
  // ==========================================================================
132
- $radius-sm: $unit * 0.5; // 4px
133
- $radius-md: $unit; // 8px
134
- $radius-lg: $unit * 2; // 16px
149
+ $radius-base: $unit; // 8px — theme knob
150
+ $radius-sm: $radius-base * 0.5; // 4px
151
+ $radius-md: $radius-base; // 8px
152
+ $radius-lg: $radius-base * 2; // 16px
135
153
  $radius-full: 9999px;
136
154
 
137
155
  // ==========================================================================
@@ -143,7 +161,7 @@ $border-width-lg: $unit * 0.5; // 4px
143
161
  $focus-ring-offset: -$border-width-md;
144
162
 
145
163
  // ==========================================================================
146
- // 7. Shadows — static hue fallback
164
+ // 7. Shadows — neutral-tinted
147
165
  // ==========================================================================
148
166
  $shadow-sm: 0 1px 2px hsl(220 10% 20% / 0.05);
149
167
  $shadow-md: 0 4px 6px hsl(220 10% 20% / 0.1);
@@ -205,17 +223,6 @@ $overlay-bg-blur: rgb(0 0 0 / 0.3);
205
223
  $overlay-bg-subtle: rgb(0 0 0 / 0.1);
206
224
  $stripe-highlight: rgb(255 255 255 / 0.15);
207
225
 
208
- // ==========================================================================
209
- // 11. Semantic spacing
210
- // ==========================================================================
211
- $spacing-xs: $space-1;
212
- $spacing-sm: $space-2;
213
- $spacing-md: $space-4;
214
- $spacing-lg: $space-6;
215
- $spacing-xl: $space-8;
216
- $spacing-gutter: $space-4;
217
- $spacing-section: $space-8;
218
-
219
226
  // ==========================================================================
220
227
  // 12. Component defaults
221
228
  // ==========================================================================
@@ -13,6 +13,24 @@
13
13
  --ui-color-primary-subtle: color-mix(in oklch, var(--ui-color-primary) 12%, white);
14
14
  --ui-color-primary-hover: color-mix(in oklch, var(--ui-color-primary) 85%, black);
15
15
 
16
+ // Success shades - auto-generated via color-mix
17
+ --ui-color-success-light: color-mix(in oklch, var(--ui-color-success) 50%, white);
18
+ --ui-color-success-dark: color-mix(in oklch, var(--ui-color-success) 75%, black);
19
+ --ui-color-success-subtle: color-mix(in oklch, var(--ui-color-success) 12%, white);
20
+ --ui-color-success-hover: color-mix(in oklch, var(--ui-color-success) 85%, black);
21
+
22
+ // Warning shades - auto-generated via color-mix
23
+ --ui-color-warning-light: color-mix(in oklch, var(--ui-color-warning) 50%, white);
24
+ --ui-color-warning-dark: color-mix(in oklch, var(--ui-color-warning) 75%, black);
25
+ --ui-color-warning-subtle: color-mix(in oklch, var(--ui-color-warning) 12%, white);
26
+ --ui-color-warning-hover: color-mix(in oklch, var(--ui-color-warning) 85%, black);
27
+
28
+ // Danger shades - auto-generated via color-mix
29
+ --ui-color-danger-light: color-mix(in oklch, var(--ui-color-danger) 50%, white);
30
+ --ui-color-danger-dark: color-mix(in oklch, var(--ui-color-danger) 75%, black);
31
+ --ui-color-danger-subtle: color-mix(in oklch, var(--ui-color-danger) 12%, white);
32
+ --ui-color-danger-hover: color-mix(in oklch, var(--ui-color-danger) 85%, black);
33
+
16
34
  // Neutral scale - auto-generated via color-mix
17
35
  --ui-color-neutral-50: color-mix(in oklch, var(--ui-color-neutral) 3%, white);
18
36
  --ui-color-neutral-100: color-mix(in oklch, var(--ui-color-neutral) 6%, white);
@@ -102,14 +102,3 @@ skipValidation: true
102
102
  --ui-color-focus: var(--ui-color-primary-light);
103
103
  }
104
104
 
105
- <!-- @semantic_spacing -->
106
- <!-- Named spacing aliases that map to the numeric spacing scale for consistent layout patterns. -->
107
- :root {
108
- --ui-spacing-xs: var(--ui-space-1); /* 8px */
109
- --ui-spacing-sm: var(--ui-space-2); /* 16px */
110
- --ui-spacing-md: var(--ui-space-4); /* 32px */
111
- --ui-spacing-lg: var(--ui-space-6); /* 48px */
112
- --ui-spacing-xl: var(--ui-space-8); /* 64px */
113
- --ui-spacing-gutter: var(--ui-space-4); /* 32px */
114
- --ui-spacing-section: var(--ui-space-8);/* 64px */
115
- }
@@ -9,7 +9,6 @@
9
9
  @use './zindex' as *;
10
10
  @use './motion' as *;
11
11
  @use './semantic-colors' as *;
12
- @use './semantic-spacing' as *;
13
12
 
14
13
  // Component tokens
15
14
  @use './input' as *;
@@ -1,9 +1,10 @@
1
1
  @layer tokens {
2
2
  :root {
3
- // Radius - derived from --unit (8px)
4
- --ui-radius-sm: calc(var(--ui-unit) * 0.5); // 4px
5
- --ui-radius-md: var(--ui-unit); // 8px
6
- --ui-radius-lg: calc(var(--ui-unit) * 2); // 16px
3
+ // Override --ui-radius-base to control all border radii at once
4
+ --ui-radius-base: var(--ui-unit); // 8px — the single theme knob
5
+ --ui-radius-sm: calc(var(--ui-radius-base) * 0.5); // 4px
6
+ --ui-radius-md: var(--ui-radius-base); // 8px
7
+ --ui-radius-lg: calc(var(--ui-radius-base) * 2); // 16px
7
8
  --ui-radius-full: 9999px;
8
9
  }
9
10
  }
@@ -1,7 +1,8 @@
1
1
  @layer tokens {
2
2
  :root {
3
- --ui-shadow-sm: 0 1px 2px hsl(var(--ui-hue-primary, 220) 10% 20% / 0.05);
4
- --ui-shadow-md: 0 4px 6px hsl(var(--ui-hue-primary, 220) 10% 20% / 0.1);
5
- --ui-shadow-lg: 0 10px 15px hsl(var(--ui-hue-primary, 220) 10% 20% / 0.15);
3
+ // Shadows tinted by neutral color — changing --ui-color-neutral shifts shadow tone
4
+ --ui-shadow-sm: 0 1px 2px color-mix(in oklch, var(--ui-color-neutral) 20%, transparent);
5
+ --ui-shadow-md: 0 4px 6px color-mix(in oklch, var(--ui-color-neutral) 15%, transparent);
6
+ --ui-shadow-lg: 0 10px 15px color-mix(in oklch, var(--ui-color-neutral) 12%, transparent);
6
7
  }
7
8
  }
@@ -6,15 +6,15 @@ skipValidation: true
6
6
 
7
7
  <!-- @grid_overlay -->
8
8
  <!-- Shows the 8px unit grid. Add the class to any container. -->
9
- <div class="ui-debug-grid" style="height: var(--ui-row-6); position: relative"></div>
9
+ <div class="ui-debug-grid demo-box" style="--demo-h: var(--ui-row-6)"></div>
10
10
 
11
11
  <!-- @row_grid -->
12
12
  <!-- Shows both 8px unit lines and stronger row (16px) lines. -->
13
- <div class="ui-debug-grid-rows" style="height: var(--ui-row-6); position: relative"></div>
13
+ <div class="ui-debug-grid-rows demo-box" style="--demo-h: var(--ui-row-6)"></div>
14
14
 
15
15
  <!-- @baseline -->
16
16
  <!-- Horizontal baseline grid for verifying text alignment. -->
17
- <div class="ui-debug-baseline" style="height: var(--ui-row-6); position: relative"></div>
17
+ <div class="ui-debug-baseline demo-box" style="--demo-h: var(--ui-row-6)"></div>
18
18
 
19
19
  <!-- @outline -->
20
20
  <!-- Outlines all child elements to reveal layout boundaries. -->
@@ -7,8 +7,7 @@
7
7
  }
8
8
 
9
9
  .debug-grid {
10
- // Fallback hue 220 (blue) when --ui-hue-primary not set
11
- --debug-color: hsl(var(--ui-hue-primary, #{t.$hue-primary}) 80% 50% / 0.15);
10
+ --debug-color: color-mix(in oklch, var(--ui-color-primary, #{t.$color-primary}) 15%, transparent);
12
11
  }
13
12
 
14
13
  .debug-grid::after {
@@ -31,8 +30,8 @@
31
30
 
32
31
  // Stronger grid at row intervals
33
32
  .debug-grid-rows {
34
- --debug-color: hsl(var(--ui-hue-primary, #{t.$hue-primary}) 80% 50% / 0.1);
35
- --debug-color-strong: hsl(var(--ui-hue-primary, #{t.$hue-primary}) 80% 50% / 0.25);
33
+ --debug-color: color-mix(in oklch, var(--ui-color-primary, #{t.$color-primary}) 10%, transparent);
34
+ --debug-color-strong: color-mix(in oklch, var(--ui-color-primary, #{t.$color-primary}) 25%, transparent);
36
35
  }
37
36
 
38
37
  .debug-grid-rows::after {
@@ -56,7 +55,7 @@
56
55
 
57
56
  // Baseline grid only (horizontal lines)
58
57
  .debug-baseline {
59
- --debug-color: hsl(var(--ui-hue-danger, 0) 80% 50% / 0.2);
58
+ --debug-color: color-mix(in oklch, var(--ui-color-danger, #{t.$color-danger}) 20%, transparent);
60
59
  }
61
60
 
62
61
  .debug-baseline::after {
@@ -5,29 +5,29 @@ description: Constrains a container to a specific aspect ratio. Media children f
5
5
 
6
6
  <!-- @presets -->
7
7
  <div class="ui-row ui-row--md">
8
- <div class="ui-aspect-ratio ui-aspect-ratio--square" style="inline-size: 160px; background: var(--ui-color-bg-muted)">
8
+ <div class="ui-aspect-ratio ui-aspect-ratio--square demo-swatch">
9
9
  <span class="ui-p-2">{{ t('square', 'square') }}</span>
10
10
  </div>
11
- <div class="ui-aspect-ratio ui-aspect-ratio--video" style="inline-size: 160px; background: var(--ui-color-bg-muted)">
11
+ <div class="ui-aspect-ratio ui-aspect-ratio--video demo-swatch">
12
12
  <span class="ui-p-2">{{ t('video', 'video') }}</span>
13
13
  </div>
14
- <div class="ui-aspect-ratio ui-aspect-ratio--photo" style="inline-size: 160px; background: var(--ui-color-bg-muted)">
14
+ <div class="ui-aspect-ratio ui-aspect-ratio--photo demo-swatch">
15
15
  <span class="ui-p-2">{{ t('photo', 'photo') }}</span>
16
16
  </div>
17
- <div class="ui-aspect-ratio ui-aspect-ratio--wide" style="inline-size: 160px; background: var(--ui-color-bg-muted)">
17
+ <div class="ui-aspect-ratio ui-aspect-ratio--wide demo-swatch">
18
18
  <span class="ui-p-2">{{ t('wide', 'wide') }}</span>
19
19
  </div>
20
- <div class="ui-aspect-ratio ui-aspect-ratio--portrait" style="inline-size: 160px; background: var(--ui-color-bg-muted)">
20
+ <div class="ui-aspect-ratio ui-aspect-ratio--portrait demo-swatch">
21
21
  <span class="ui-p-2">{{ t('portrait', 'portrait') }}</span>
22
22
  </div>
23
23
  </div>
24
24
 
25
25
  <!-- @with_media -->
26
26
  <div class="ui-row ui-row--md">
27
- <div class="ui-aspect-ratio ui-aspect-ratio--video" style="inline-size: 240px">
27
+ <div class="ui-aspect-ratio ui-aspect-ratio--video demo-swatch" style="--demo-w: 240px">
28
28
  <div style="inline-size: 100%; block-size: 100%; background: var(--ui-color-primary); color: var(--ui-color-on-primary); display: grid; place-items: center">{{ t('img_video', 'img (video)') }}</div>
29
29
  </div>
30
- <div class="ui-aspect-ratio ui-aspect-ratio--square" style="inline-size: 240px">
30
+ <div class="ui-aspect-ratio ui-aspect-ratio--square demo-swatch" style="--demo-w: 240px">
31
31
  <div style="inline-size: 100%; block-size: 100%; background: var(--ui-color-primary); color: var(--ui-color-on-primary); display: grid; place-items: center">{{ t('img_square', 'img (square)') }}</div>
32
32
  </div>
33
33
  </div>
@@ -5,19 +5,19 @@ description: Centers content horizontally and vertically.
5
5
 
6
6
  <!-- @basic -->
7
7
  <!-- Centers children both horizontally and vertically using flexbox. -->
8
- <div class="ui-center" style="height: var(--ui-row-4); background: var(--ui-color-bg-muted)">
8
+ <div class="ui-center demo-box ui-bg-muted" style="--demo-h: var(--ui-row-4)">
9
9
  <span>{{ t('centered_content', 'Centered content') }}</span>
10
10
  </div>
11
11
 
12
12
  <!-- @column_direction -->
13
13
  <!-- Stack centered children vertically. -->
14
- <div class="ui-center ui-center--column" style="height: var(--ui-row-6); background: var(--ui-color-bg-muted)">
14
+ <div class="ui-center ui-center--column demo-box ui-bg-muted" style="--demo-h: var(--ui-row-6)">
15
15
  <span>{{ t('first_line', 'First line') }}</span>
16
16
  <span>{{ t('second_line', 'Second line') }}</span>
17
17
  </div>
18
18
 
19
19
  <!-- @full_page_center -->
20
20
  <!-- Center content within a full viewport area, useful for loading or empty states. -->
21
- <div class="ui-center" style="height: var(--ui-row-8); background: var(--ui-color-bg-muted)">
21
+ <div class="ui-center demo-box ui-bg-muted" style="--demo-h: var(--ui-row-8)">
22
22
  <p>{{ t('no_results_found', 'No results found') }}</p>
23
23
  </div>
@@ -6,7 +6,7 @@
6
6
  .footer {
7
7
  --_space-2: var(--ui-space-2);
8
8
  --_border-width-sm: var(--ui-border-width-sm);
9
- --_hue-primary: var(--ui-hue-primary, #{t.$hue-primary});
9
+ --_shadow-color: color-mix(in oklch, var(--ui-color-neutral, #{t.$color-neutral}) 8%, transparent);
10
10
  // @desc Overall height
11
11
  --_height: var(--ui-footer-height, var(--ui-row-3));
12
12
  // @desc Background color
@@ -73,6 +73,6 @@
73
73
 
74
74
  // @modifier boolean raised
75
75
  .footer--raised {
76
- box-shadow: 0 calc(var(--_border-width-sm) * -1) 6px hsl(var(--_hue-primary) 10% 20% / 0.08);
76
+ box-shadow: 0 calc(var(--_border-width-sm) * -1) 6px var(--_shadow-color);
77
77
  }
78
78
  }
@@ -5,7 +5,7 @@ description: Main content area that accounts for sidebar and topbar offsets in a
5
5
 
6
6
  <!-- @default -->
7
7
  <!-- Offsets content for a start-side sidebar and optional topbar. -->
8
- <div style="position: relative; height: var(--ui-row-4)">
8
+ <div class="demo-box" style="--demo-h: var(--ui-row-4)">
9
9
  <main class="ui-main ui-bg-muted ui-p-2">
10
10
  <p>{{ t('main_content_area', 'Main content area') }}</p>
11
11
  </main>
@@ -13,7 +13,7 @@ description: Main content area that accounts for sidebar and topbar offsets in a
13
13
 
14
14
  <!-- @sidebar_end -->
15
15
  <!-- Offsets content for an end-side sidebar instead of start. -->
16
- <div style="position: relative; height: var(--ui-row-4)">
16
+ <div class="demo-box" style="--demo-h: var(--ui-row-4)">
17
17
  <main class="ui-main ui-main--sidebar-end ui-bg-muted ui-p-2">
18
18
  <p>{{ t('content_with_end_sidebar', 'Content with end sidebar') }}</p>
19
19
  </main>
@@ -21,7 +21,7 @@ description: Main content area that accounts for sidebar and topbar offsets in a
21
21
 
22
22
  <!-- @full_width -->
23
23
  <!-- No sidebar offset. Use when there is no sidebar. -->
24
- <div style="position: relative; height: var(--ui-row-4)">
24
+ <div class="demo-box" style="--demo-h: var(--ui-row-4)">
25
25
  <main class="ui-main ui-main--full ui-bg-muted ui-p-2">
26
26
  <p>{{ t('full_width_content', 'Full width content') }}</p>
27
27
  </main>
@@ -5,7 +5,7 @@ description: Narrow fixed vertical navigation rail for icon-based navigation wit
5
5
 
6
6
  <!-- @default -->
7
7
  <!-- Fixed narrow rail with icon items and bottom actions. -->
8
- <nav class="ui-nav-rail" style="position: relative; block-size: 320px">
8
+ <nav class="ui-nav-rail demo-box" style="--demo-h: 320px">
9
9
  <div class="ui-nav-rail__items">
10
10
  <button class="ui-button ui-button--ghost ui-button--icon">{{ t('h', 'H') }}</button>
11
11
  <button class="ui-button ui-button--ghost ui-button--icon">{{ t('s', 'S') }}</button>
@@ -10,13 +10,13 @@ description: Fixed-position sidebar for app layouts with adjustable widths and p
10
10
  </aside>
11
11
 
12
12
  <!-- @widths | column -->
13
- <aside class="ui-sidebar ui-sidebar--sm" style="position: relative; height: auto;">
13
+ <aside class="ui-sidebar ui-sidebar--sm ui-relative">
14
14
  <p>{{ t('small_192px', 'Small (192px)') }}</p>
15
15
  </aside>
16
- <aside class="ui-sidebar ui-sidebar--md" style="position: relative; height: auto;">
16
+ <aside class="ui-sidebar ui-sidebar--md ui-relative">
17
17
  <p>{{ t('medium_240px_default', 'Medium (240px, default)') }}</p>
18
18
  </aside>
19
- <aside class="ui-sidebar ui-sidebar--lg" style="position: relative; height: auto;">
19
+ <aside class="ui-sidebar ui-sidebar--lg ui-relative">
20
20
  <p>{{ t('large_320px', 'Large (320px)') }}</p>
21
21
  </aside>
22
22
 
@@ -5,7 +5,7 @@ description: Navigation component for sidebars with support for groups, nested i
5
5
 
6
6
  <!-- @basic -->
7
7
  <!-- Simple navigation with grouped items. -->
8
- <nav class="ui-sidebar-nav" aria-label="{{ t('main_navigation', 'Main navigation') }}" style="block-size: 400px;">
8
+ <nav class="ui-sidebar-nav" aria-label="{{ t('main_navigation', 'Main navigation') }}" class="demo-box" style="--demo-h: 400px">
9
9
  <div class="ui-sidebar-nav__header">
10
10
  <strong>{{ t('app_name', 'App Name') }}</strong>
11
11
  </div>
@@ -55,7 +55,7 @@ description: Navigation component for sidebars with support for groups, nested i
55
55
 
56
56
  <!-- @with_icons -->
57
57
  <!-- Navigation items with icons for visual clarity. -->
58
- <nav class="ui-sidebar-nav" aria-label="{{ t('navigation', 'Navigation') }}" style="block-size: 300px;">
58
+ <nav class="ui-sidebar-nav" aria-label="{{ t('navigation', 'Navigation') }}" class="demo-box" style="--demo-h: 300px">
59
59
  <div class="ui-sidebar-nav__content">
60
60
  <ul class="ui-sidebar-nav__group-items">
61
61
  <li>
@@ -96,7 +96,7 @@ description: Navigation component for sidebars with support for groups, nested i
96
96
 
97
97
  <!-- @with_badges -->
98
98
  <!-- Navigation items with badges for counts or status indicators. -->
99
- <nav class="ui-sidebar-nav" aria-label="{{ t('navigation', 'Navigation') }}" style="block-size: 200px;">
99
+ <nav class="ui-sidebar-nav" aria-label="{{ t('navigation', 'Navigation') }}" class="demo-box" style="--demo-h: 200px">
100
100
  <div class="ui-sidebar-nav__content">
101
101
  <ul class="ui-sidebar-nav__group-items">
102
102
  <li>
@@ -129,7 +129,7 @@ description: Navigation component for sidebars with support for groups, nested i
129
129
 
130
130
  <!-- @nested_items -->
131
131
  <!-- Navigation with nested/indented items for sub-sections. -->
132
- <nav class="ui-sidebar-nav" aria-label="{{ t('navigation', 'Navigation') }}" style="block-size: 280px;">
132
+ <nav class="ui-sidebar-nav" aria-label="{{ t('navigation', 'Navigation') }}" class="demo-box" style="--demo-h: 280px">
133
133
  <div class="ui-sidebar-nav__content">
134
134
  <div class="ui-sidebar-nav__group">
135
135
  <span class="ui-sidebar-nav__group-label">{{ t('components', 'Components') }}</span>
@@ -169,7 +169,7 @@ description: Navigation component for sidebars with support for groups, nested i
169
169
 
170
170
  <!-- @collapsed -->
171
171
  <!-- Icon-only mode for compact sidebars. -->
172
- <nav class="ui-sidebar-nav ui-sidebar-nav--collapsed" aria-label="{{ t('navigation', 'Navigation') }}" style="block-size: 200px;">
172
+ <nav class="ui-sidebar-nav ui-sidebar-nav--collapsed" aria-label="{{ t('navigation', 'Navigation') }}" class="demo-box" style="--demo-h: 200px">
173
173
  <div class="ui-sidebar-nav__content">
174
174
  <ul class="ui-sidebar-nav__group-items">
175
175
  <li>
@@ -209,7 +209,7 @@ description: Navigation component for sidebars with support for groups, nested i
209
209
 
210
210
  <!-- @disabled_items -->
211
211
  <!-- Non-interactive navigation items. -->
212
- <nav class="ui-sidebar-nav" aria-label="{{ t('navigation', 'Navigation') }}" style="block-size: 180px;">
212
+ <nav class="ui-sidebar-nav" aria-label="{{ t('navigation', 'Navigation') }}" class="demo-box" style="--demo-h: 180px">
213
213
  <div class="ui-sidebar-nav__content">
214
214
  <ul class="ui-sidebar-nav__group-items">
215
215
  <li>
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "position",
3
+ "type": "utility",
4
+ "utilities": ["relative", "absolute", "overflow-hidden", "inset-0"],
5
+ "cssVars": []
6
+ }
@@ -0,0 +1,29 @@
1
+ ---
2
+ title: Position
3
+ description: Position, overflow, and inset utilities for controlling element placement.
4
+ ---
5
+
6
+ <!-- @position -->
7
+ <!-- Set position type on any element. -->
8
+ <div class="ui-relative ui-bg-muted ui-p-2" style="block-size: var(--ui-row-4)">
9
+ <div class="ui-absolute ui-top-0 ui-end-0 ui-bg-subtle ui-p-1">{{ t('absolute_top_end', 'Absolute top-end') }}</div>
10
+ <div class="ui-absolute ui-bottom-0 ui-start-0 ui-bg-subtle ui-p-1">{{ t('absolute_bottom_start', 'Absolute bottom-start') }}</div>
11
+ </div>
12
+
13
+ <!-- @inset | row -->
14
+ <!-- Pin element to all edges or specific sides. -->
15
+ <div class="ui-relative ui-bg-muted" style="block-size: var(--ui-row-4)">
16
+ <div class="ui-absolute ui-inset-0 ui-bg-subtle ui-p-2">{{ t('inset_0_fills_parent', 'inset-0 fills parent') }}</div>
17
+ </div>
18
+ <div class="ui-relative ui-bg-muted" style="block-size: var(--ui-row-4)">
19
+ <div class="ui-absolute ui-inset-block-0 ui-start-0 ui-bg-subtle ui-p-2">{{ t('inset_block_0_start_0', 'inset-block-0 + start-0') }}</div>
20
+ </div>
21
+
22
+ <!-- @overflow | row -->
23
+ <!-- Control overflow behavior. -->
24
+ <div class="ui-overflow-hidden ui-bg-muted ui-p-2" style="block-size: var(--ui-row-3)">
25
+ <p>{{ t('overflow_hidden_long_content', 'This content is clipped when it overflows the container boundary. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt.') }}</p>
26
+ </div>
27
+ <div class="ui-overflow-auto ui-bg-muted ui-p-2" style="block-size: var(--ui-row-3)">
28
+ <p>{{ t('overflow_auto_long_content', 'This content gets a scrollbar when it overflows. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore.') }}</p>
29
+ </div>
@@ -0,0 +1,74 @@
1
+ // Position, overflow, and inset utilities
2
+
3
+ @layer utilities {
4
+ // Position
5
+ .relative {
6
+ position: relative;
7
+ }
8
+
9
+ .absolute {
10
+ position: absolute;
11
+ }
12
+
13
+ .fixed {
14
+ position: fixed;
15
+ }
16
+
17
+ .sticky {
18
+ position: sticky;
19
+ }
20
+
21
+ .static {
22
+ position: static;
23
+ }
24
+
25
+ // Inset (logical properties)
26
+ .inset-0 {
27
+ inset: 0;
28
+ }
29
+
30
+ .inset-block-0 {
31
+ inset-block: 0;
32
+ }
33
+
34
+ .inset-inline-0 {
35
+ inset-inline: 0;
36
+ }
37
+
38
+ .top-0 {
39
+ inset-block-start: 0;
40
+ }
41
+
42
+ .bottom-0 {
43
+ inset-block-end: 0;
44
+ }
45
+
46
+ .start-0 {
47
+ inset-inline-start: 0;
48
+ }
49
+
50
+ .end-0 {
51
+ inset-inline-end: 0;
52
+ }
53
+
54
+ // Overflow
55
+ .overflow-hidden {
56
+ overflow: hidden;
57
+ }
58
+
59
+ .overflow-auto {
60
+ overflow: auto;
61
+ }
62
+
63
+ .overflow-x-auto {
64
+ overflow-x: auto;
65
+ }
66
+
67
+ .overflow-y-auto {
68
+ overflow-y: auto;
69
+ }
70
+
71
+ .overflow-visible {
72
+ overflow: visible;
73
+ }
74
+ }
@@ -6,7 +6,7 @@ description: Scroll-driven animation utilities for progress indicators and viewp
6
6
  <!-- @scroll_progress_indicator -->
7
7
  <!-- Fixed bar at the top of the viewport that fills as the user scrolls down. -->
8
8
  <div style="position: relative; block-size: 12rem; overflow-y: auto;">
9
- <div class="ui-scroll-progress" style="position: absolute;"></div>
9
+ <div class="ui-scroll-progress ui-absolute"></div>
10
10
  <div style="block-size: 40rem; padding: var(--ui-space-2);">
11
11
  <p>{{ t('scroll_down_to_see_the_progress_bar_fill', 'Scroll down to see the progress bar fill.') }}</p>
12
12
  </div>