Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

💄 Light mode surface fixes: sidebar, selection states, tiles (#3497)

Luke Vellaff932453a306
diff --git a/apps/landing/src/components/home/how-it-works/create-step-demo.tsx b/apps/landing/src/components/home/how-it-works/create-step-demo.tsx
index b9489eec2..5f6da9d6f 100644
--- a/apps/landing/src/components/home/how-it-works/create-step-demo.tsx
+++ b/apps/landing/src/components/home/how-it-works/create-step-demo.tsx
@@ -8,7 +8,7 @@ import { ACCENT } from "./accent";
import type { CursorStop } from "./demo-cursor";
import { DemoCursor } from "./demo-cursor";
import type { Playback } from "./motion";
-import { EASE_OUT, EXIT } from "./motion";
+import { EXIT } from "./motion";
import { PressButton } from "./press-button";
// A textless mock of the poll creation form: title field and a month
@@ -101,32 +101,30 @@ export const CreateStepDemo = ({ playback }: { playback: Playback }) => {
// biome-ignore lint/suspicious/noArrayIndexKey: calendar cells are positional
key={index}
ref={cellRefs[pickedAt]}
- className="h-3.5 rounded bg-gray-100"
- initial={false}
- animate={
+ // Color is a CSS transition so it follows the theme's gray
+ // tokens, which motion cannot interpolate.
+ className={cn(
+ "h-3.5 rounded transition-colors ease-[cubic-bezier(0.23,1,0.32,1)]",
on
- ? {
- backgroundColor: "#d1d5db",
- scale: instant ? 1 : [0.88, 1],
- }
- : { backgroundColor: "#f3f4f6", scale: 1 }
- }
+ ? "bg-gray-300 duration-220"
+ : "bg-gray-100 duration-180",
+ instant && "duration-0",
+ )}
+ style={{
+ transitionDelay:
+ on && !instant ? `${pickAt(pickedAt)}s` : undefined,
+ }}
+ initial={false}
+ animate={{ scale: on && !instant ? [0.88, 1] : 1 }}
transition={
instant
? { duration: 0 }
: on
? {
- backgroundColor: {
- duration: 0.22,
- ease: EASE_OUT,
- delay: pickAt(pickedAt),
- },
- scale: {
- type: "spring",
- duration: 0.44,
- bounce: 0.42,
- delay: pickAt(pickedAt),
- },
+ type: "spring",
+ duration: 0.44,
+ bounce: 0.42,
+ delay: pickAt(pickedAt),
}
: EXIT
}
diff --git a/apps/web/src/app/[locale]/(space)/settings/layout.tsx b/apps/web/src/app/[locale]/(space)/settings/layout.tsx
index 83c6f824f..1df772112 100644
--- a/apps/web/src/app/[locale]/(space)/settings/layout.tsx
+++ b/apps/web/src/app/[locale]/(space)/settings/layout.tsx
@@ -93,7 +93,7 @@ export default function Layout({ children }: { children?: React.ReactNode }) {
<SidebarInset id="main-content" tabIndex={-1}>
<PastDueAlert />
<div className="flex flex-1 flex-col">
- <header className="sticky top-0 z-10 border-b bg-background/90 p-3 backdrop-blur-xs md:hidden">
+ <header className="sticky top-0 z-10 border-b bg-sidebar/90 p-3 backdrop-blur-xs md:hidden">
<div className="flex items-center gap-4">
<SidebarTrigger />
<div className="flex items-center gap-2">
diff --git a/apps/web/src/app/[locale]/control-panel/layout.tsx b/apps/web/src/app/[locale]/control-panel/layout.tsx
index bd85a3648..78bbfc28d 100644
--- a/apps/web/src/app/[locale]/control-panel/layout.tsx
+++ b/apps/web/src/app/[locale]/control-panel/layout.tsx
@@ -34,7 +34,7 @@ async function AdminGate({ children }: { children: React.ReactNode }) {
<SidebarInset id="main-content" tabIndex={-1}>
<LicenseLimitWarning />
<div className="flex flex-1 flex-col">
- <header className="sticky top-0 z-10 border-b bg-background/90 p-3 backdrop-blur-xs md:hidden">
+ <header className="sticky top-0 z-10 border-b bg-sidebar/90 p-3 backdrop-blur-xs md:hidden">
<div className="flex items-center gap-4">
<SidebarTrigger />
<div className="flex items-center gap-2">
diff --git a/apps/web/src/components/data-list.tsx b/apps/web/src/components/data-list.tsx
index 68dfab072..3ee18f928 100644
--- a/apps/web/src/components/data-list.tsx
+++ b/apps/web/src/components/data-list.tsx
@@ -133,7 +133,7 @@ export function DataList<TData>({
key={group.id}
className="col-span-full not-first:mt-5 grid grid-cols-subgrid"
>
- <h2 className="col-span-full mb-1 flex h-12 items-center gap-2 rounded-lg bg-muted/60 px-4 text-sm">
+ <h2 className="col-span-full mb-1 flex h-12 items-center gap-2 rounded-lg bg-gray-200/60 px-4 text-sm dark:bg-muted/60">
{group.label}
</h2>
<ul
diff --git a/apps/web/src/components/list-view.tsx b/apps/web/src/components/list-view.tsx
index 84836db27..d0432c7dc 100644
--- a/apps/web/src/components/list-view.tsx
+++ b/apps/web/src/components/list-view.tsx
@@ -18,9 +18,7 @@ export function ListViewHeader({
children,
className,
}: React.PropsWithChildren<{ className?: string }>) {
- return (
- <div className={cn("shrink-0 bg-background", className)}>{children}</div>
- );
+ return <div className={cn("shrink-0", className)}>{children}</div>;
}
export function ListViewTitleBar({
diff --git a/apps/web/src/components/page-icons.tsx b/apps/web/src/components/page-icons.tsx
index 5603fca87..b22c35421 100644
--- a/apps/web/src/components/page-icons.tsx
+++ b/apps/web/src/components/page-icons.tsx
@@ -23,7 +23,7 @@ const pageIconVariants = cva("inline-flex items-center justify-center", {
darkGray:
"bg-gray-700 text-gray-300 dark:bg-gray-400/10 dark:text-gray-400",
indigo: "bg-indigo-500 text-white",
- gray: "bg-gray-100 text-gray-500 dark:bg-gray-400/10 dark:text-gray-400",
+ gray: "bg-gray-200 text-gray-500 dark:bg-gray-400/10 dark:text-gray-400",
lime: "bg-lime-500 text-white",
blue: "bg-blue-500 text-white",
rose: "bg-rose-500 text-rose-50 dark:bg-rose-400/10 dark:text-rose-400",
diff --git a/apps/web/src/components/pill-variants.ts b/apps/web/src/components/pill-variants.ts
index ef6dd7d52..caea23c2c 100644
--- a/apps/web/src/components/pill-variants.ts
+++ b/apps/web/src/components/pill-variants.ts
@@ -5,9 +5,8 @@ export const pillVariants = cva(
{
variants: {
selected: {
- true: "bg-white text-sidebar-accent-foreground ring-button-outline dark:bg-muted",
- false:
- "text-muted-foreground ring-transparent hover:bg-white dark:hover:bg-muted",
+ true: "bg-sidebar-accent text-sidebar-accent-foreground ring-button-outline",
+ false: "text-muted-foreground ring-transparent hover:bg-sidebar-accent",
},
},
defaultVariants: {
diff --git a/apps/web/src/features/poll/components/finalize-poll-dialog.tsx b/apps/web/src/features/poll/components/finalize-poll-dialog.tsx
index e79041a11..6a3313f28 100644
--- a/apps/web/src/features/poll/components/finalize-poll-dialog.tsx
+++ b/apps/web/src/features/poll/components/finalize-poll-dialog.tsx
@@ -121,7 +121,7 @@ const TOP_OPTIONS = 5;
const medalClassName: Record<number, string> = {
1: "bg-amber-400",
- 2: "bg-zinc-400",
+ 2: "bg-gray-400",
3: "bg-amber-700",
};
diff --git a/packages/tailwind-config/shared-styles.css b/packages/tailwind-config/shared-styles.css
index 3889223c6..fe5f7b35c 100644
--- a/packages/tailwind-config/shared-styles.css
+++ b/packages/tailwind-config/shared-styles.css
@@ -9,6 +9,9 @@
@source "../../packages/ui/src/**/*.{ts,tsx}";
:root {
+ /* Hue of the --color-gray-* scale in @theme; change both together */
+ --gray-hue: 286.033;
+
--radius: 0.625rem;
--primary: var(--primary-light, var(--color-indigo-600));
--primary-foreground: var(--primary-light-foreground, var(--color-white));
@@ -31,7 +34,7 @@
--background: var(--color-white);
--foreground: var(--color-gray-800);
- --accent: oklch(0.552 0.016 285.938 / 0.1);
+ --accent: color-mix(in oklab, var(--color-gray-500) 10%, transparent);
--accent-border: var(--color-gray-300);
--accent-foreground: var(--color-gray-800);
@@ -45,7 +48,7 @@
--popover: var(--color-white);
--popover-foreground: var(--color-gray-800);
- --popover-accent: oklch(0.552 0.016 285.938 / 0.1);
+ --popover-accent: color-mix(in oklab, var(--color-gray-500) 10%, transparent);
--popover-border: var(--color-gray-200);
--card: var(--color-white);
@@ -53,11 +56,11 @@
--card-accent: rgba(0, 0, 0, 0.02);
--card-foreground: var(--color-gray-800);
- --sidebar: var(--color-gray-100);
+ --sidebar: var(--color-gray-50);
--sidebar-foreground: var(--color-gray-800);
--sidebar-border: var(--color-gray-200);
- --sidebar-accent: var(--color-gray-200);
+ --sidebar-accent: var(--color-gray-100);
--sidebar-accent-foreground: var(--color-gray-800);
}
@@ -77,9 +80,9 @@
--sidebar-border: var(--color-gray-800);
--sidebar-accent: var(--color-gray-800);
- --sidebar-accent-foreground: #f9fafb;
+ --sidebar-accent-foreground: var(--color-gray-50);
- --border: oklch(0.32 0.006 286.033);
+ --border: oklch(0.32 0.006 var(--gray-hue));
--border-muted: var(--color-gray-800);
--input: rgba(255, 255, 255, 0.1);
@@ -103,10 +106,10 @@
--popover-foreground: var(--color-gray-100);
--popover-accent: var(--color-gray-700);
- --card: oklch(0.24 0.006 286.033);
+ --card: oklch(0.24 0.006 var(--gray-hue));
--card-border: var(--color-gray-700);
--card-foreground: var(--color-white);
- --card-accent: oklch(0.26 0.006 286.033);
+ --card-accent: oklch(0.26 0.006 var(--gray-hue));
}
/*
@@ -121,7 +124,7 @@
}
.dark :where([data-slot="dialog-content"], [data-slot="popover-content"]) {
- --card: oklch(0.31 0.006 286.033);
+ --card: oklch(0.31 0.006 var(--gray-hue));
}
@theme inline {
@@ -341,6 +344,9 @@
"rlig" 1,
"calt" 1;
}
+ body:has([data-sidebar="wrapper"]) {
+ @apply bg-sidebar;
+ }
html.light body:has(.page-bg-gray-100) {
@apply bg-gray-100;
}
diff --git a/packages/ui/src/sidebar.tsx b/packages/ui/src/sidebar.tsx
index 2cb2e8c9d..15f124286 100644
--- a/packages/ui/src/sidebar.tsx
+++ b/packages/ui/src/sidebar.tsx
@@ -125,6 +125,7 @@ const SidebarProvider = React.forwardRef<
<SidebarContext.Provider value={contextValue}>
<TooltipProvider delay={0}>
<div
+ data-sidebar="wrapper"
style={
{
"--sidebar-width": SIDEBAR_WIDTH,
@@ -318,7 +319,7 @@ const SidebarInset = React.forwardRef<
<main
ref={ref}
className={cn(
- "flex w-full flex-1 flex-col bg-background",
+ "flex w-full flex-1 flex-col bg-sidebar",
"md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-lg md:peer-data-[variant=inset]:border md:peer-data-[variant=inset]:shadow-2xs",
className,
)}
diff --git a/packages/ui/src/tile.tsx b/packages/ui/src/tile.tsx
index 3ba5e62b7..8cec58cae 100644
--- a/packages/ui/src/tile.tsx
+++ b/packages/ui/src/tile.tsx
@@ -17,7 +17,7 @@ function Tile({
props: mergeProps<"div">(
{
className: cn(
- "relative flex flex-col justify-end rounded-xl bg-card p-3 text-card-foreground ring-1 ring-button-outline ring-inset transition-transform hover:bg-card-accent active:translate-y-0.5",
+ "relative flex flex-col justify-end rounded-xl bg-white/50 p-3 text-card-foreground ring-1 ring-button-outline ring-inset transition-transform hover:bg-white/75 active:translate-y-0.5 dark:bg-card dark:hover:bg-card-accent",
className,
),
},
diff --git a/packages/ui/src/vote-icon.tsx b/packages/ui/src/vote-icon.tsx
index 611db4fea..048ec1241 100644
--- a/packages/ui/src/vote-icon.tsx
+++ b/packages/ui/src/vote-icon.tsx
@@ -13,8 +13,8 @@ const voteIconVariants = cva("", {
type: {
yes: "text-green-500",
ifNeedBe: "text-amber-400",
- no: "text-zinc-500",
- pending: "text-zinc-300",
+ no: "text-gray-500",
+ pending: "text-gray-300",
},
},
defaultVariants: {