Skip to content

Commit 83734be

Browse files
committed
refactor(ui): replace hardcoded colors with semantic tokens
- Editor toolbar: bg-white → bg-base-100 - ToolbarLoader dividers: bg-slate-200 → bg-base-300 - DocTitle hover border: slate-400 → base-300 - Avatar container and fallback: bg-slate-100 → bg-base-200 - Auth error page: use semantic tokens for background, card, and text - EmojiBody: ensure em-emoji host stays theme-consistent Made-with: Cursor
1 parent f6e0292 commit 83734be

File tree

6 files changed

+24
-20
lines changed

6 files changed

+24
-20
lines changed

packages/webapp/src/components/TipTap/DocTitle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ const DocTitle = ({ className }: { className?: string }) => {
183183
<div
184184
dangerouslySetInnerHTML={{ __html: title || '' }}
185185
contentEditable
186-
className="truncate rounded-sm border border-transparent px-1 py-0 text-lg font-medium hover:border-slate-400"
186+
className="hover:border-base-300 truncate rounded-sm border border-transparent px-1 py-0 text-lg font-medium"
187187
style={{ flex: 1 }}
188188
onBlur={saveData}
189189
onKeyDown={(e) => {

packages/webapp/src/components/chatroom/components/MessageCard/components/MessageContent/components/EmojiBody.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const EmojiBody = () => {
5454
{emojiArray.map((emoji: string, index: number) => (
5555
<Tooltip key={index} title={emojiTitles[index] || 'emoji'} placement="top">
5656
<div className="hover:bg-base-200 flex items-center justify-center rounded-xl p-1 transition-colors">
57-
{/* @ts-expect-error – em-emoji is a web component from @emoji-mart */}
57+
{/* @ts-expect-error – em-emoji is a web component from emoji-mart; host styled theme-aware in globals.scss */}
5858
<em-emoji native={emoji} set="native" size="4rem" />
5959
</div>
6060
</Tooltip>

packages/webapp/src/components/skeleton/ToolbarLoader.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const ToolbarSkeleton = () => {
44
{/* Text formatting dropdown */}
55
<div className="skeleton h-6 w-24 rounded" />
66

7-
<div className="h-5 w-px bg-slate-200" />
7+
<div className="bg-base-300 h-5 w-px" />
88

99
{/* Formatting buttons */}
1010
<div className="flex gap-1">
@@ -13,7 +13,7 @@ const ToolbarSkeleton = () => {
1313
<div className="skeleton size-7 rounded" />
1414
</div>
1515

16-
<div className="h-5 w-px bg-slate-200" />
16+
<div className="bg-base-300 h-5 w-px" />
1717

1818
{/* More buttons */}
1919
<div className="flex gap-1">
@@ -25,7 +25,7 @@ const ToolbarSkeleton = () => {
2525
{/* Right side actions */}
2626
<div className="ml-auto flex gap-2">
2727
<div className="skeleton size-7 rounded" />
28-
<div className="h-5 w-px bg-slate-200" />
28+
<div className="bg-base-300 h-5 w-px" />
2929
<div className="skeleton size-7 rounded" />
3030
<div className="skeleton size-7 rounded" />
3131
</div>

packages/webapp/src/components/ui/Avatar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ export const Avatar = forwardRef<HTMLImageElement, AvatarProps>(
151151
const cursorClass = clickable && id ? 'cursor-pointer' : 'cursor-default'
152152

153153
// Container uses daisyUI avatar class with custom styling
154-
// Uses subtle gray ring instead of white border for visibility on any background
154+
// Theme-aware base so fallback/placeholder works in light and dark
155155
const containerClass = twMerge(
156156
'avatar',
157157
sizeClass,
158158
'rounded-full',
159-
'bg-slate-100',
159+
'bg-base-200',
160160
'!ring-1 ring-base-300',
161161
'!overflow-visible',
162162
displayPresence && (online ? 'avatar-online' : 'avatar-offline'),
@@ -170,7 +170,7 @@ export const Avatar = forwardRef<HTMLImageElement, AvatarProps>(
170170
'size-full',
171171
'rounded-full',
172172
'object-cover',
173-
'bg-slate-100',
173+
'bg-base-200',
174174
'shadow-[inset_0_0_0_1px_color-mix(in_oklch,var(--color-base-content)_6%,transparent)]',
175175
cursorClass,
176176
imageClassName,

packages/webapp/src/pages/auth/error.tsx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ const AuthErrorPage = () => {
3030
}
3131

3232
return (
33-
<div className="flex min-h-[100dvh] items-center justify-center bg-slate-50 p-4">
33+
<div className="bg-base-200 flex min-h-[100dvh] items-center justify-center p-4">
3434
<div className="w-full max-w-md">
3535
{/* Error card */}
36-
<div className="rounded-2xl bg-white p-6 shadow-xl shadow-slate-200/50 sm:p-8">
36+
<div className="rounded-box bg-base-100 p-6 shadow-xl sm:p-8">
3737
{/* Icon */}
3838
<div className="mb-6 flex justify-center">
3939
<div className="bg-error/10 flex size-16 items-center justify-center rounded-full">
@@ -42,33 +42,37 @@ const AuthErrorPage = () => {
4242
</div>
4343

4444
{/* Title */}
45-
<h1 className="mb-2 text-center text-2xl font-bold text-slate-800">
45+
<h1 className="text-base-content mb-2 text-center text-2xl font-bold">
4646
Authentication Error
4747
</h1>
48-
<p className="mb-6 text-center text-sm text-slate-500">
48+
<p className="text-base-content/60 mb-6 text-center text-sm">
4949
Something went wrong during authentication.
5050
</p>
5151

5252
{/* Error details */}
5353
<div className="border-error/20 bg-error/5 mb-6 space-y-3 rounded-xl border p-4">
5454
<div>
55-
<p className="text-xs font-medium tracking-wide text-slate-500 uppercase">Error</p>
56-
<p className="font-medium text-slate-800">{errorDetails.error}</p>
55+
<p className="text-base-content/50 text-xs font-medium tracking-wide uppercase">
56+
Error
57+
</p>
58+
<p className="text-base-content font-medium">{errorDetails.error}</p>
5759
</div>
5860

5961
{errorDetails.errorCode && (
6062
<div>
61-
<p className="text-xs font-medium tracking-wide text-slate-500 uppercase">Code</p>
62-
<p className="font-mono text-sm text-slate-700">{errorDetails.errorCode}</p>
63+
<p className="text-base-content/50 text-xs font-medium tracking-wide uppercase">
64+
Code
65+
</p>
66+
<p className="text-base-content/80 font-mono text-sm">{errorDetails.errorCode}</p>
6367
</div>
6468
)}
6569

6670
{errorDetails.errorDescription && (
6771
<div>
68-
<p className="text-xs font-medium tracking-wide text-slate-500 uppercase">
72+
<p className="text-base-content/50 text-xs font-medium tracking-wide uppercase">
6973
Details
7074
</p>
71-
<p className="text-sm text-slate-600">{errorDetails.errorDescription}</p>
75+
<p className="text-base-content/70 text-sm">{errorDetails.errorDescription}</p>
7276
</div>
7377
)}
7478
</div>
@@ -89,7 +93,7 @@ const AuthErrorPage = () => {
8993
</div>
9094

9195
{/* Help text */}
92-
<p className="mt-6 text-center text-sm text-slate-500">
96+
<p className="text-base-content/60 mt-6 text-center text-sm">
9397
If this problem persists, please{' '}
9498
<a
9599
href="https://docs.plus/support"

packages/webapp/src/pages/editor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const EditorPage = ({ localPersistence, docName }: EditorPageProps) => {
7373
return (
7474
<div className="flex h-screen flex-col overflow-hidden">
7575
{/* Toolbar */}
76-
<div className="toolbars w-full shrink-0 bg-white">
76+
<div className="toolbars bg-base-100 w-full shrink-0">
7777
<EditorToolbar />
7878
<Controllers editor={editor} />
7979
</div>

0 commit comments

Comments
 (0)