Skip to content

Commit 6ab76c2

Browse files
Al Aqsa Reto WijayaAl Aqsa Reto Wijaya
authored andcommitted
feat: implement logo dark theme filtering
Add theme-logo class with CSS filters to properly display logo in dark mode across all navigation components.
1 parent afb5aba commit 6ab76c2

5 files changed

Lines changed: 32 additions & 22 deletions

File tree

src/App.jsx

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import Logo from './assets/tulis-logo.png';
1+
import Logo from "./assets/tulis-logo.png";
22

33
function App() {
4-
54
return (
65
<div className="container mx-auto mt-5">
76
{/* <!-- Navbar Start --> */}
87
<div className="flex gap-3 items-center">
9-
<img width={100} src={Logo} />
8+
<img width={100} src={Logo} alt="Tulis Logo" className="theme-logo" />
109
<div className="flex gap-3 ml-auto">
1110
<a
1211
href="/"
@@ -51,9 +50,7 @@ function App() {
5150
className="w-full h-64 object-cover rounded-md"
5251
/>
5352
<h2 className="mt-3 font-semibold">KUPU-KUPU</h2>
54-
<p className="text-gray-600">
55-
Colored Pencil
56-
</p>
53+
<p className="text-gray-600">Colored Pencil</p>
5754
<p className="font-bold mt-2">Rp 129.000 / 24pcs</p>
5855
</div>
5956

@@ -129,9 +126,7 @@ function App() {
129126
{/* <!-- Login Page Start --> */}
130127
<div className="grid grid-cols-6 gap-5 max-w-screen-xl mx-auto">
131128
<div className="col-span-3 flex justify-center items-center">
132-
<h1 className="text-5xl font-bold">
133-
Login
134-
</h1>
129+
<h1 className="text-5xl font-bold">Login</h1>
135130
</div>
136131
<div className="col-span-3 px-20 min-h-[calc(100vh-200px)] flex flex-col justify-center">
137132
<form className="w-full">
@@ -151,15 +146,15 @@ function App() {
151146
</div>
152147
<button
153148
className=" bg-sky-700 rounded-lg py-3 px-2 w-full text-white font-bold mt-5"
154-
type="submit">
149+
type="submit"
150+
>
155151
Login
156152
</button>
157153
</form>
158154

159155
<div className="justify-center mt-3 text-center">
160156
Don't have an account?
161-
<a href="/register"
162-
className="underline hover:text-sky-700">
157+
<a href="/register" className="underline hover:text-sky-700">
163158
Register here
164159
</a>
165160
</div>
@@ -206,12 +201,10 @@ function App() {
206201
</form>
207202
<div className="justify-center mt-3 text-center">
208203
Already have an account?
209-
<a href="/login"
210-
className="underline hover:text-sky-700">
204+
<a href="/login" className="underline hover:text-sky-700">
211205
Login here
212206
</a>
213207
</div>
214-
215208
</div>
216209
</div>
217210
{/* <!-- Register Page End --> */}

src/components/AdminNavbar.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function AdminNavbar() {
2626
<>
2727
{/* <!-- Navbar Start --> */}
2828
<div className="flex gap-3 items-center">
29-
<img width={100} src={Logo} alt="Tulis Logo" />
29+
<img width={100} src={Logo} alt="Tulis Logo" className="theme-logo" />
3030
<div className="flex gap-3 ml-auto items-center">
3131
<Link
3232
to="/admin"

src/components/Navbar.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function Navbar() {
1515
const handleLogout = async () => {
1616
try {
1717
await signOut(auth);
18-
successAlert("Success!", "Logout success");
18+
successAlert("Success!", "Logout success");
1919
navigate("/");
2020
} catch (err) {
2121
console.error(err);
@@ -26,7 +26,7 @@ function Navbar() {
2626
<>
2727
{/* <!-- Navbar Start --> */}
2828
<div className="flex gap-3 items-center">
29-
<img width={100} src={Logo} alt="Tulis Logo" />
29+
<img width={100} src={Logo} alt="Tulis Logo" className="theme-logo" />
3030
{user ? (
3131
<div className="flex gap-3 ml-auto items-center">
3232
<Link

src/index.css

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
@import "tailwindcss";
2-
32
/* CSS Custom Properties for Theme Support */
43
:root {
54
/* Light theme colors */
@@ -93,13 +92,22 @@ body {
9392
background-color: var(--color-accent-hover);
9493
}
9594

95+
/* Logo theming */
96+
.theme-logo {
97+
filter: none;
98+
}
99+
100+
.dark .theme-logo {
101+
filter: invert(1);
102+
}
103+
96104
/* Enhanced transitions for smooth theme switching */
97105
* {
98-
transition-property: background-color, border-color, color, fill, stroke;
106+
transition-property: background-color, border-color, color, fill, stroke,
107+
filter;
99108
transition-duration: 0.3s;
100109
transition-timing-function: ease;
101110
}
102-
103111
/* Custom scrollbar for dark theme */
104112
::-webkit-scrollbar {
105113
width: 8px;
@@ -116,4 +124,4 @@ body {
116124

117125
::-webkit-scrollbar-thumb:hover {
118126
background: var(--color-border-hover);
119-
}
127+
}

tailwind.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/** @type {import('tailwindcss').Config} */
2+
export default {
3+
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
4+
darkMode: "class",
5+
theme: {
6+
extend: {},
7+
},
8+
plugins: [],
9+
};

0 commit comments

Comments
 (0)