Skip to content

Commit da67ee2

Browse files
committed
Fix radial gradients not covering full canvas
1 parent 9a05150 commit da67ee2

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

components/layouts/shared/background-style.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ type LayoutGeometry =
1313
* This allows the same gradient colors to render differently per layout.
1414
*/
1515
function getLayoutGeometry(layoutId: string, variant?: string): LayoutGeometry {
16-
// Spotlight: radial toward screenshot side
16+
// Spotlight: radial toward screenshot side, farthest-corner ensures full coverage
1717
if (layoutId.startsWith("hero-center")) {
1818
return {
1919
type: "radial",
20-
direction: variant === "right" ? "ellipse at 70% 50%" : "ellipse at 30% 50%",
20+
direction:
21+
variant === "right"
22+
? "ellipse farthest-corner at 70% 50%"
23+
: "ellipse farthest-corner at 30% 50%",
2124
};
2225
}
2326

@@ -31,9 +34,9 @@ function getLayoutGeometry(layoutId: string, variant?: string): LayoutGeometry {
3134
return { type: "linear", angle: angles[variant ?? "center"] ?? 180 };
3235
}
3336

34-
// Backdrop: subtle centered radial
37+
// Backdrop: subtle centered radial, farthest-corner ensures full coverage
3538
if (layoutId === "adaptive-stage") {
36-
return { type: "radial", direction: "circle at 50% 50%" };
39+
return { type: "radial", direction: "circle farthest-corner at 50% 50%" };
3740
}
3841

3942
// Code snippet: diagonal linear

0 commit comments

Comments
 (0)