Skip to content

Commit 577a673

Browse files
committed
Fix light/dark mode styling for user profile dropdown and sign-in page
1 parent 985ca2c commit 577a673

File tree

3 files changed

+108
-13
lines changed

3 files changed

+108
-13
lines changed

frontend/app/login/page.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ export default function LoginPage() {
3737
}
3838

3939
return (
40-
<div className="flex items-center justify-center min-h-screen bg-gray-50">
41-
<Card className="w-full max-w-md p-8 space-y-6">
40+
<div className="flex items-center justify-center min-h-screen bg-gray-50 dark:bg-slate-900">
41+
<Card className="w-full max-w-md p-8 space-y-6 bg-white dark:bg-slate-800 border-gray-200 dark:border-slate-700">
4242
<div className="text-center">
43-
<h1 className="text-3xl font-bold font-bold text-gray-900 dark:text-[#33b5ff]">Sign In</h1>
44-
<p className="mt-2 text-gray-600">
43+
<h1 className="text-3xl font-bold font-bold text-blue-600 dark:text-blue-400">Sign In</h1>
44+
<p className="mt-2 text-gray-600 dark:text-gray-400">
4545
Access your tariff application dashboard
4646
</p>
4747
</div>
4848

4949
<Button
5050
onClick={handleSignIn}
51-
className="w-full"
51+
className="w-full bg-blue-600 hover:bg-blue-700 text-white"
5252
size="lg"
5353
>
5454
Sign in with AWS Cognito

frontend/components/TopBar.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,26 +148,26 @@ export default function TopBar({ sidebarOpen, onToggleSidebar, activeTab, onTabC
148148
{/* Dropdown Menu */}
149149
{showUserMenu && (
150150
<div className="absolute right-0 top-full mt-2 z-50">
151-
<Card className="w-80 shadow-lg">
151+
<Card className="w-80 shadow-lg bg-white dark:bg-slate-800 border-slate-200 dark:border-slate-700">
152152
<CardHeader>
153-
<CardTitle className="text-sm">User Profile</CardTitle>
153+
<CardTitle className="text-sm text-slate-900 dark:text-slate-100">User Profile</CardTitle>
154154
</CardHeader>
155155
<CardContent className="space-y-3">
156156
{/* User Info */}
157-
<div className="text-xs space-y-2">
157+
<div className="text-xs space-y-2 text-slate-700 dark:text-slate-300">
158158
<div>
159-
<strong>Username:</strong> {user?.username || 'N/A'}
159+
<strong className="text-slate-900 dark:text-slate-100">Username:</strong> {user?.username || 'N/A'}
160160
</div>
161161
<div>
162-
<strong>Email:</strong> {user?.email || 'N/A'}
162+
<strong className="text-slate-900 dark:text-slate-100">Email:</strong> {user?.email || 'N/A'}
163163
</div>
164164
<div>
165-
<strong>Groups:</strong> {user?.groups?.join(', ') || 'None'}
165+
<strong className="text-slate-900 dark:text-slate-100">Groups:</strong> {user?.groups?.join(', ') || 'None'}
166166
</div>
167167

168168
{/* Session Status */}
169169
<div>
170-
<strong>Session Status:</strong>
170+
<strong className="text-slate-900 dark:text-slate-100">Session Status:</strong>
171171
{sessionError ? ` Error: ${sessionError}` : ' Active'}
172172
</div>
173173
</div>
@@ -177,7 +177,7 @@ export default function TopBar({ sidebarOpen, onToggleSidebar, activeTab, onTabC
177177
onClick={handleSignOut}
178178
variant="destructive"
179179
size="sm"
180-
className="w-full"
180+
className="w-full bg-red-600 hover:bg-red-700 text-white"
181181
>
182182
<LogOut className="h-4 w-4 mr-2" />
183183
Sign Out

frontend/public/cognito-custom.css

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/* AWS Cognito Hosted UI Custom CSS */
2+
/* Fix for light mode button visibility */
3+
4+
/* Primary button styling */
5+
.btn-primary,
6+
button[type="submit"],
7+
input[type="submit"] {
8+
background-color: #0070f3 !important;
9+
color: white !important;
10+
border: 1px solid #0070f3 !important;
11+
font-weight: 600 !important;
12+
padding: 12px 24px !important;
13+
border-radius: 6px !important;
14+
cursor: pointer !important;
15+
transition: all 0.2s ease !important;
16+
}
17+
18+
.btn-primary:hover,
19+
button[type="submit"]:hover,
20+
input[type="submit"]:hover {
21+
background-color: #0051cc !important;
22+
border-color: #0051cc !important;
23+
}
24+
25+
/* Secondary buttons */
26+
.btn-secondary {
27+
background-color: white !important;
28+
color: #333 !important;
29+
border: 1px solid #ddd !important;
30+
}
31+
32+
.btn-secondary:hover {
33+
background-color: #f5f5f5 !important;
34+
}
35+
36+
/* Input fields - ensure good contrast */
37+
input[type="text"],
38+
input[type="password"],
39+
input[type="email"] {
40+
border: 1px solid #ddd !important;
41+
background-color: white !important;
42+
color: #333 !important;
43+
padding: 10px !important;
44+
border-radius: 4px !important;
45+
}
46+
47+
input[type="text"]:focus,
48+
input[type="password"]:focus,
49+
input[type="email"]:focus {
50+
border-color: #0070f3 !important;
51+
outline: none !important;
52+
box-shadow: 0 0 0 3px rgba(0, 112, 243, 0.1) !important;
53+
}
54+
55+
/* Labels */
56+
label {
57+
color: #333 !important;
58+
font-weight: 500 !important;
59+
margin-bottom: 6px !important;
60+
display: block !important;
61+
}
62+
63+
/* Links */
64+
a {
65+
color: #0070f3 !important;
66+
text-decoration: none !important;
67+
}
68+
69+
a:hover {
70+
text-decoration: underline !important;
71+
}
72+
73+
/* Error messages */
74+
.error-message,
75+
.alert-danger {
76+
background-color: #fee !important;
77+
color: #c00 !important;
78+
border: 1px solid #fcc !important;
79+
padding: 10px !important;
80+
border-radius: 4px !important;
81+
margin-bottom: 16px !important;
82+
}
83+
84+
/* Container */
85+
.container {
86+
background-color: white !important;
87+
padding: 32px !important;
88+
border-radius: 8px !important;
89+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
90+
}
91+
92+
/* Headings */
93+
h1, h2, h3 {
94+
color: #111 !important;
95+
}

0 commit comments

Comments
 (0)