Skip to content

Commit c1485de

Browse files
andresdjassoclaude
andcommitted
fix(loader): correct theme mapping + per-shape gradient (Figma exact)
Two fixes against the Figma loader frames (simMothershipLoader_lightTheme 82:122 / _darkTheme 82:119): - Theme mapping was inverted. Light mode must show the DARK-grey loader (#4F4F4F→#6F6F6F, glow 0.6) so it reads on white; dark mode shows the LIGHT-grey loader (#A7A7A7→#D6D6D6, glow 0.9). The squeeze ring's currentColor stroke already tracked that polarity, so only the gradient vars swapped. - Gradient is now objectBoundingBox (per shape) instead of one canvas-wide radial. Figma fits the radial to each shape's box, so every blob — including small/offset dots — reads glossy (center dark → edge light) rather than flat. Verified computed values live in both themes and rendered against the Figma frames. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent d0ceb84 commit c1485de

2 files changed

Lines changed: 20 additions & 12 deletions

File tree

apps/sim/components/emcn/components/thinking-loader/thinking-loader.module.css

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,19 @@
1616
*/
1717

1818
.frame {
19+
/* currentColor paints the squeeze ring's stroked arcs (the only non-filled
20+
geometry). It tracks the loader polarity — dark on light, light on dark —
21+
matching the gradient stops below. */
1922
color: #4f4f4f;
2023
flex: none;
2124
/* Loader fill is a radial gradient (center → edge) plus a soft white inner
2225
glow, per the Figma loader spec. Stops and glow opacity are theme vars,
2326
inherited by the gradient stops and feFlood inside the SVG, so one set of
24-
defs serves both themes. Light: #A7A7A7 → #D6D6D6, glow white 0.9. */
25-
--tl-grad-inner: #a7a7a7;
26-
--tl-grad-outer: #d6d6d6;
27-
--tl-glow: rgba(255, 255, 255, 0.9);
27+
defs serves both themes. Light mode = the DARK-grey loader (reads on white):
28+
#4F4F4F → #6F6F6F, glow white 0.6. */
29+
--tl-grad-inner: #4f4f4f;
30+
--tl-grad-outer: #6f6f6f;
31+
--tl-glow: rgba(255, 255, 255, 0.6);
2832
}
2933

3034
/* Gradient stops + glow flood read the theme vars via CSS (a raw `var()` in an
@@ -50,10 +54,11 @@
5054

5155
:global(.dark) .frame {
5256
color: #d6d6d6;
53-
/* Dark: #4F4F4F → #6F6F6F, glow white 0.6. */
54-
--tl-grad-inner: #4f4f4f;
55-
--tl-grad-outer: #6f6f6f;
56-
--tl-glow: rgba(255, 255, 255, 0.6);
57+
/* Dark mode = the LIGHT-grey loader (reads on dark): #A7A7A7 → #D6D6D6,
58+
glow white 0.9. */
59+
--tl-grad-inner: #a7a7a7;
60+
--tl-grad-outer: #d6d6d6;
61+
--tl-glow: rgba(255, 255, 255, 0.9);
5762
}
5863

5964
.labelRow {

apps/sim/components/emcn/components/thinking-loader/thinking-loader.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ export function ThinkingLoader({ variant, size = 20, label, className }: Thinkin
257257
k3='1'
258258
result='innerMask'
259259
/>
260-
{/* Glow color + per-theme opacity ride a CSS var (light 0.9 / dark
261-
0.6) so one filter serves both themes. */}
260+
{/* Glow color + per-theme opacity ride a CSS var (light 0.6 / dark
261+
0.9) so one filter serves both themes. */}
262262
<feFlood className={styles.glow} result='glowColor' />
263263
<feComposite in='glowColor' in2='innerMask' operator='in' result='glow' />
264264
<feMerge>
@@ -267,8 +267,11 @@ export function ThinkingLoader({ variant, size = 20, label, className }: Thinkin
267267
</feMerge>
268268
</filter>
269269
{/* Radial gradient (center → edge), theme stops via CSS vars. Matches
270-
the Figma loader: dark #4F4F4F→#6F6F6F, light #A7A7A7→#D6D6D6. */}
271-
<radialGradient id={gradientId} cx='50' cy='50' r='50' gradientUnits='userSpaceOnUse'>
270+
the Figma loader: light #4F4F4F→#6F6F6F, dark #A7A7A7→#D6D6D6.
271+
objectBoundingBox (default units) so EACH blob is shaded on its own
272+
box — Figma fits the gradient per shape, so small/offset dots read
273+
glossy (center dark, edge light) instead of flat. */}
274+
<radialGradient id={gradientId} cx='0.5' cy='0.5' r='0.5'>
272275
<stop className={styles.gradInner} />
273276
<stop offset='1' className={styles.gradOuter} />
274277
</radialGradient>

0 commit comments

Comments
 (0)