fix(ui): improve background glow contrast (#11409)

This commit is contained in:
Alejandro Bailo
2026-06-01 14:25:23 +02:00
committed by GitHub
parent e05519ff9f
commit 9d2a8d9108
2 changed files with 39 additions and 2 deletions
@@ -0,0 +1,37 @@
import { render, screen } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import MainLayout from "./main-layout";
vi.mock("@/hooks/use-sidebar", () => ({
useSidebar: vi.fn(),
}));
vi.mock("@/hooks/use-store", () => ({
useStore: () => ({
getOpenState: () => true,
settings: { disabled: false },
}),
}));
vi.mock("../sidebar/sidebar", () => ({
Sidebar: () => <aside data-testid="sidebar" />,
}));
describe("MainLayout", () => {
it("renders subdued background glows for side-nav contrast", () => {
render(
<MainLayout>
<div>Page content</div>
</MainLayout>,
);
const topGlow =
screen.getByTestId("sidebar").previousElementSibling
?.previousElementSibling;
const bottomGlow = screen.getByTestId("sidebar").previousElementSibling;
expect(topGlow).toHaveClass("h-[120%]", "w-[160%]", "opacity-[7%]");
expect(bottomGlow).toHaveClass("h-[50%]", "w-[50%]", "opacity-[7%]");
});
});
+2 -2
View File
@@ -17,7 +17,7 @@ export default function MainLayout({
<div className="relative flex h-dvh items-center justify-center overflow-hidden">
{/* Top-left gradient halo */}
<div
className="pointer-events-none fixed top-0 left-0 z-0 size-[600px] opacity-20 blur-3xl"
className="pointer-events-none fixed top-0 left-0 z-0 h-[120%] w-[160%] opacity-[7%] blur-3xl"
style={{
background: "linear-gradient(90deg, #31E59F 0%, #60E0EC 100%)",
transform: "translate(-50%, -50%)",
@@ -26,7 +26,7 @@ export default function MainLayout({
{/* Bottom-right gradient halo */}
<div
className="pointer-events-none fixed right-0 bottom-0 z-0 size-[600px] opacity-20 blur-3xl"
className="pointer-events-none fixed right-0 bottom-0 z-0 h-[50%] w-[50%] opacity-[7%] blur-3xl"
style={{
background: "linear-gradient(90deg, #31E59F 0%, #60E0EC 100%)",
transform: "translate(50%, 50%)",