Skip to content

Commit 14b4d9e

Browse files
committed
Fix dark mode logo
1 parent af0ade8 commit 14b4d9e

File tree

3 files changed

+40
-4
lines changed

3 files changed

+40
-4
lines changed

theme/components/Landingpage/features.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ web:
256256
- code: |
257257
post /signin {
258258
body {
259-
username: str
260-
password: str
259+
username: str,
260+
password: str,
261261
}
262262
263263
// Verify username and password correctly
@@ -743,4 +743,4 @@ std-library:
743743
// sort - Sort the array
744744
let sorted = numbers.sort();
745745
print(sorted); // expect: [1, 3, 3, 5, 8, 10, 15, 20, 30, 40]
746-
filename: builtin.ai
746+
filename: builtin.ai

theme/components/hero/index.module.scss

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,35 @@
8282
height: 180px;
8383
}
8484

85+
.lightLogo {
86+
display: block;
87+
}
88+
89+
.darkLogo {
90+
display: none;
91+
}
92+
93+
:global(.dark) & {
94+
.lightLogo {
95+
display: none;
96+
}
97+
98+
.darkLogo {
99+
display: block;
100+
}
101+
}
102+
}
103+
104+
:global {
105+
.dark .logo {
106+
.lightLogo {
107+
display: none;
108+
}
109+
110+
.darkLogo {
111+
display: block;
112+
}
113+
}
85114
}
86115

87116
.title {

theme/components/hero/index.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ type HeroProps = {
6565

6666
showStars?: boolean;
6767
logoUrl?: string;
68+
darkLogoUrl?: string;
6869
title?: string;
6970
subTitle?: string;
7071
description?: string;
@@ -78,6 +79,7 @@ export const Hero: FC<HeroProps> = ({
7879
onClickLearnMore,
7980
showStars = false,
8081
logoUrl = '/aiscript-logo.svg',
82+
darkLogoUrl = '/aiscript-logo-white.svg',
8183
title = '',
8284
subTitle = '',
8385
description = '',
@@ -107,7 +109,12 @@ export const Hero: FC<HeroProps> = ({
107109
<div className={styles.logo}>
108110
<img
109111
src={logoUrl}
110-
className={`${styles.logoImg} rs-logo`}
112+
className={`${styles.logoImg} ${styles.lightLogo} rs-logo`}
113+
alt="logo"
114+
/>
115+
<img
116+
src={darkLogoUrl}
117+
className={`${styles.logoImg} ${styles.darkLogo} rs-logo`}
111118
alt="logo"
112119
/>
113120
</div>

0 commit comments

Comments
 (0)