@rdlabo/ionic-theme-ios27 1.0.3 → 1.0.4-beta.pr183.shaedc618dbeda8

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.
@@ -119,6 +119,17 @@ export const registerSegmentEffect = (targetElement: HTMLElement): registeredEff
119
119
  animation?.cancel();
120
120
  handoff.forEach((effect) => effect.cancel());
121
121
  handoff = [];
122
+ // WebKit can paint the newly unhidden element once at its underlying
123
+ // top-left position before the replacement WAAPI effect is sampled.
124
+ // Prime that underlying style so interrupted/reversed selections always
125
+ // hand off from the first frame instead of briefly flashing at (0, 0).
126
+ const first = frames[0];
127
+ if (first) {
128
+ lens.style.transform = String(first['transform']);
129
+ lens.style.width = String(first['width']);
130
+ lens.style.height = String(first['height']);
131
+ lens.style.backgroundColor = String(first['backgroundColor']);
132
+ }
122
133
  segment.classList.add('ios27-animated');
123
134
  lens.hidden = false;
124
135
  const running = lens.animate(frames, { duration, easing: 'linear', fill: 'forwards' });
@@ -82,8 +82,12 @@ ion-segment.ios:not(.ios-theme-disabled, .ios26-disabled) {
82
82
  }
83
83
  }
84
84
 
85
- ion-segment-button:is(.in-toolbar-color, .in-segment-color)::part(indicator-background) {
86
- // Ionic sets a direct background for color contexts, bypassing --indicator-color.
85
+ ion-segment-button.in-segment-color::part(indicator-background) {
86
+ // Ionic sets a direct background for segment color contexts, bypassing --indicator-color.
87
+ background: var(--indicator-color);
88
+ }
89
+
90
+ ion-segment-button.in-toolbar-color:not(.in-segment-color)::part(indicator-background) {
87
91
  background: var(--indicator-color);
88
92
  }
89
93
 
@@ -195,3 +199,8 @@ ion-segment-button.ios:not(.ios-theme-disabled, .ios26-disabled) {
195
199
  :where(ion-segment.ios:not(.ios-theme-disabled, .ios26-disabled) ion-segment-button) {
196
200
  --indicator-color: var(--ion-background-color, #fff);
197
201
  }
202
+ :where(ion-segment.ios:not(.ios-theme-disabled, .ios26-disabled) ion-segment-button.in-toolbar-color:not(.in-segment-color)) {
203
+ // Match Ionic's colored-toolbar contract while preserving its public
204
+ // toolbar and segment-button customization properties.
205
+ --indicator-color: var(--ion-toolbar-segment-indicator-color, var(--ion-color-contrast));
206
+ }
@@ -35,4 +35,7 @@
35
35
  :where(ion-segment.ios:not(.ios-theme-disabled, .ios26-disabled) ion-segment-button) {
36
36
  --indicator-color: color-mix(in srgb, rgb(var(--ion-color-medium-rgb, 152, 154, 162)) 59%, var(--ion-background-color, #000));
37
37
  }
38
+ :where(ion-segment.ios:not(.ios-theme-disabled, .ios26-disabled) ion-segment-button.in-toolbar-color:not(.in-segment-color)) {
39
+ --indicator-color: var(--ion-toolbar-segment-indicator-color, var(--ion-color-contrast));
40
+ }
38
41
  }