feat(desktop): offset SVG previews, accent elements, grid spacing

- Position SVG at bottom-right (90% size, offset -1) showing the
  theme's muted background behind it — matches the original style
- Add accent color elements (border line, title bar, primary squares)
  to SystemPreferencePreviewSvg light half
- Use light theme's muted color as SystemPreferencePreviewFrame background
- Increase grid gap from gap-3 to gap-4 for more breathing room
- Fix accent color row clipping with padding on container
This commit is contained in:
klopez4212
2026-07-06 13:56:51 +01:00
parent d2a9eda9d7
commit 9b192b62e4
2 changed files with 32 additions and 5 deletions

View File

@@ -437,7 +437,7 @@ function ThemeSettingsCard() {
{/* Theme grid based on selected mode */}
<div className="mb-6">
<div className="flex flex-wrap gap-3 p-1">
<div className="flex flex-wrap gap-4 p-1">
{selectedMode === "system" &&
pairedLight.map((lightName) => {
const darkName = getThemePair(lightName);
@@ -477,9 +477,9 @@ function ThemeSettingsCard() {
</div>
{/* Accent color picker */}
<div className="mt-2 shrink-0 pb-2">
<div className="mt-2 shrink-0 px-1 pb-2">
<h3 className="mb-2 text-sm font-medium">Accent color</h3>
<div className="flex flex-wrap gap-2">
<div className="flex flex-wrap gap-2 p-1">
{ACCENT_COLORS.map((color) => {
const isNeutral = color.value === NEUTRAL_ACCENT;
const swatchColor = isNeutral

View File

@@ -220,6 +220,10 @@ function SystemPreferencePreviewSvg({
// Light half colors
const lightBg = hsl(lightVars, "--background");
const lightBorder = hsl(lightVars, "--border");
const lightForeground = hsl(lightVars, "--foreground");
const lightPrimary = hsl(lightVars, "--primary");
const lightPrimarySoft = hslAlpha(lightVars, "--primary", 0.68);
const lightSidebar = hsl(lightVars, "--sidebar-background");
const lightSidebarFg = hslAlpha(lightVars, "--sidebar-foreground", 0.58);
const lightMutedFg = hsl(lightVars, "--muted-foreground");
@@ -363,6 +367,24 @@ function SystemPreferencePreviewSvg({
x="3.60156"
y="43.875"
/>
<line stroke={lightBorder} x1="57" x2="118" y1="10.5" y2="10.5" />
<rect
fill={lightForeground}
height="2"
rx="0.5"
width="21"
x="60"
y="4"
/>
<rect fill={lightPrimary} height="4" rx="1" width="4" x="105" y="3" />
<rect
fill={lightPrimarySoft}
height="4"
rx="1"
width="4"
x="111"
y="3"
/>
</g>
{/* Dark half (bottom) — clipped to bottom portion */}
@@ -475,7 +497,7 @@ export function ThemePreviewFrame({
borderColor: hsl(vars, "--border"),
}}
>
<div className="absolute inset-0">
<div className="absolute -bottom-1 -right-1 h-[90%] w-[90%]">
<ThemePreviewSvg vars={vars} />
</div>
</div>
@@ -501,8 +523,13 @@ export function SystemPreferencePreviewFrame({
"relative overflow-hidden rounded-2xl border border-border/70",
className,
)}
style={{
backgroundColor: hsl(lightVars, "--muted"),
}}
>
<SystemPreferencePreviewSvg darkVars={darkVars} lightVars={lightVars} />
<div className="absolute -bottom-1 -right-1 h-[90%] w-[90%]">
<SystemPreferencePreviewSvg darkVars={darkVars} lightVars={lightVars} />
</div>
</div>
);
}