mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 10:27:56 +01:00
refactor(theme): replace hardcoded modal/drawer hex with CSS tokens
CLAUDE.md is explicit: 'Use shadcn theme tokens — never hardcode hex'.
The modal/drawer surface colors #0f1117 and #0c0e14 were duplicated
across 10 files, violating SSOT.
- globals.css: add --surface-modal / --surface-drawer custom properties
in :root and .dark, register as Tailwind colors via @theme inline
- 10 components: bg-[#0f1117] → bg-surface-modal,
bg-[#0c0e14] → bg-surface-drawer
A future palette tweak now changes 1 file, not 10.
Verified bg-surface-{modal,drawer} classes are present in the prod CSS.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
11 files changed
+17
-11
No files matched your search
@@ -39,6 +39,8 @@
|
||||
--color-popover: var(--popover);
|
||||
--color-card-foreground: var(--card-foreground);
|
||||
--color-card: var(--card);
|
||||
--color-surface-modal: var(--surface-modal);
|
||||
--color-surface-drawer: var(--surface-drawer);
|
||||
--radius-sm: calc(var(--radius) * 0.6);
|
||||
--radius-md: calc(var(--radius) * 0.8);
|
||||
--radius-lg: var(--radius);
|
||||
@@ -81,6 +83,8 @@
|
||||
--sidebar-accent-foreground: oklch(0.205 0 0);
|
||||
--sidebar-border: oklch(0.922 0 0);
|
||||
--sidebar-ring: oklch(0.708 0 0);
|
||||
--surface-modal: #0f1117;
|
||||
--surface-drawer: #0c0e14;
|
||||
}
|
||||
|
||||
.dark {
|
||||
@@ -115,6 +119,8 @@
|
||||
--sidebar-accent-foreground: oklch(0.985 0 0);
|
||||
--sidebar-border: oklch(1 0 0 / 10%);
|
||||
--sidebar-ring: oklch(0.556 0 0);
|
||||
--surface-modal: #0f1117;
|
||||
--surface-drawer: #0c0e14;
|
||||
}
|
||||
|
||||
@layer base {
|
||||
|
||||
@@ -74,7 +74,7 @@ export function NewGoalButton({ goals }: { goals: GoalWithChildren[] }) {
|
||||
{open && (
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center p-4">
|
||||
<div className="absolute inset-0 bg-black/70 backdrop-blur-sm" onClick={close} />
|
||||
<div className="relative w-full max-w-md bg-[#0f1117] border border-white/10 rounded-2xl shadow-2xl p-5 space-y-4">
|
||||
<div className="relative w-full max-w-md bg-surface-modal border border-white/10 rounded-2xl shadow-2xl p-5 space-y-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="text-sm font-semibold">New Goal</div>
|
||||
<button onClick={close} className="p-1 text-white/40 hover:text-white/70 rounded">
|
||||
|
||||
@@ -66,7 +66,7 @@ export function NewSubscriptionButton() {
|
||||
{open && (
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center p-4">
|
||||
<div className="absolute inset-0 bg-black/70 backdrop-blur-sm" onClick={close} />
|
||||
<div className="relative w-full max-w-md bg-[#0f1117] border border-white/10 rounded-2xl shadow-2xl p-5 space-y-4">
|
||||
<div className="relative w-full max-w-md bg-surface-modal border border-white/10 rounded-2xl shadow-2xl p-5 space-y-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="text-sm font-semibold">Add Subscription</div>
|
||||
<button onClick={close} className="p-1 text-white/40 hover:text-white/70 rounded">
|
||||
|
||||
@@ -52,7 +52,7 @@ export function NewPersonButton() {
|
||||
{open && (
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center p-4">
|
||||
<div className="absolute inset-0 bg-black/70 backdrop-blur-sm" onClick={close} />
|
||||
<div className="relative w-full max-w-sm bg-[#0f1117] border border-white/10 rounded-2xl shadow-2xl p-5 space-y-4">
|
||||
<div className="relative w-full max-w-sm bg-surface-modal border border-white/10 rounded-2xl shadow-2xl p-5 space-y-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="text-sm font-semibold">Add Person</div>
|
||||
<button onClick={close} className="p-1 text-white/40 hover:text-white/70 rounded">
|
||||
|
||||
@@ -52,7 +52,7 @@ export function NewProjectButton() {
|
||||
{open && (
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center p-4">
|
||||
<div className="absolute inset-0 bg-black/70 backdrop-blur-sm" onClick={close} />
|
||||
<div className="relative w-full max-w-sm bg-[#0f1117] border border-white/10 rounded-2xl shadow-2xl p-5 space-y-4">
|
||||
<div className="relative w-full max-w-sm bg-surface-modal border border-white/10 rounded-2xl shadow-2xl p-5 space-y-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="text-sm font-semibold">Add Project</div>
|
||||
<button onClick={close} className="p-1 text-white/40 hover:text-white/70 rounded">
|
||||
|
||||
@@ -46,7 +46,7 @@ export function ProjectDetail({
|
||||
<div className="fixed inset-0 z-50 flex justify-end">
|
||||
<div className="absolute inset-0 bg-black/60" onClick={onClose} />
|
||||
|
||||
<div className="relative w-full max-w-xl bg-[#0c0e14] border-l border-white/10 flex flex-col shadow-2xl">
|
||||
<div className="relative w-full max-w-xl bg-surface-drawer border-l border-white/10 flex flex-col shadow-2xl">
|
||||
<ProjectDetailHeader
|
||||
data={data}
|
||||
loading={loading}
|
||||
|
||||
@@ -115,7 +115,7 @@ export function ProjectDetailHeader({
|
||||
const hasIssues = ISSUE_ATTRS.some((k) => attrs[k]);
|
||||
|
||||
return (
|
||||
<div className="shrink-0 bg-[#0c0e14] border-b border-white/10">
|
||||
<div className="shrink-0 bg-surface-drawer border-b border-white/10">
|
||||
<div className="flex items-start gap-3 px-5 pt-4 pb-3">
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex items-center gap-2 flex-wrap">
|
||||
|
||||
@@ -64,7 +64,7 @@ export function RunModal({
|
||||
return (
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center p-4">
|
||||
<div className="absolute inset-0 bg-black/70 backdrop-blur-sm" onClick={!running ? onClose : undefined} />
|
||||
<div className="relative w-full max-w-2xl bg-[#0f1117] border border-white/10 rounded-2xl shadow-2xl flex flex-col max-h-[85vh]">
|
||||
<div className="relative w-full max-w-2xl bg-surface-modal border border-white/10 rounded-2xl shadow-2xl flex flex-col max-h-[85vh]">
|
||||
{/* Header */}
|
||||
<div className="flex items-start justify-between gap-3 p-5 border-b border-white/10 shrink-0">
|
||||
<div>
|
||||
|
||||
@@ -48,7 +48,7 @@ export function ScheduleModal({
|
||||
return (
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center p-4">
|
||||
<div className="absolute inset-0 bg-black/70 backdrop-blur-sm" onClick={onClose} />
|
||||
<div className="relative w-full max-w-lg bg-[#0f1117] border border-white/10 rounded-2xl shadow-2xl p-5 space-y-4">
|
||||
<div className="relative w-full max-w-lg bg-surface-modal border border-white/10 rounded-2xl shadow-2xl p-5 space-y-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="text-sm font-semibold">Schedule Job</div>
|
||||
<button onClick={onClose} className="p-1 text-white/40 hover:text-white/70 rounded">
|
||||
|
||||
@@ -139,7 +139,7 @@ export function AskIvyModal({ onClose }: { onClose: () => void }) {
|
||||
<div className="fixed inset-0 z-50 flex items-end md:items-center justify-center">
|
||||
<div className="absolute inset-0 bg-black/70 backdrop-blur-sm" onClick={() => !loading && onClose()} />
|
||||
|
||||
<div className="relative w-full max-w-2xl mx-4 mb-4 md:mb-0 bg-[#0f1117] border border-white/10 rounded-2xl shadow-2xl flex flex-col max-h-[85vh]">
|
||||
<div className="relative w-full max-w-2xl mx-4 mb-4 md:mb-0 bg-surface-modal border border-white/10 rounded-2xl shadow-2xl flex flex-col max-h-[85vh]">
|
||||
|
||||
{/* Header */}
|
||||
<div className="flex items-center justify-between px-4 py-3 border-b border-white/10 shrink-0">
|
||||
|
||||
@@ -87,9 +87,9 @@ export function JobDetail({
|
||||
return (
|
||||
<div className="fixed inset-0 z-50 flex justify-end">
|
||||
<div className="absolute inset-0 bg-black/60" onClick={onClose} />
|
||||
<div className="relative w-full max-w-lg bg-[#0f1117] border-l border-white/10 overflow-y-auto flex flex-col">
|
||||
<div className="relative w-full max-w-lg bg-surface-modal border-l border-white/10 overflow-y-auto flex flex-col">
|
||||
{/* Header */}
|
||||
<div className="sticky top-0 z-10 flex items-start justify-between gap-3 p-4 border-b border-white/10 bg-[#0f1117]">
|
||||
<div className="sticky top-0 z-10 flex items-start justify-between gap-3 p-4 border-b border-white/10 bg-surface-modal">
|
||||
<div className="min-w-0">
|
||||
<div className="flex items-center gap-2">
|
||||
<Bot className="h-4 w-4 text-emerald-400 shrink-0" />
|
||||
|
||||
Reference in new issue
Block a user