Skip to content

Commit f8f4442

Browse files
committed
docs(header): fix bug moon/sun theme change
1 parent b7415d0 commit f8f4442

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

apps/website/src/components/header/header.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,10 @@ export default component$(({ showVersion = false }: HeaderProps) => {
130130
const { theme, setTheme } = useTheme();
131131

132132
const switchLightDark = $((input: string | string[]): string | string[] | undefined => {
133-
const switchWord = (word: string): string => {
134-
if (word.includes('light')) {
135-
return word.replace('light', 'dark');
136-
} else if (word.includes('dark')) {
137-
return word.replace('dark', 'light');
138-
}
139-
return word;
140-
};
141-
133+
const switchWord = (word: string): string =>
134+
word.includes('light')
135+
? word.replace('light', 'dark')
136+
: word.replace('dark', 'light');
142137
if (typeof input === 'string') {
143138
return switchWord(input);
144139
} else if (Array.isArray(input)) {

apps/website/src/root.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export default component$(() => {
5555
<body lang="en">
5656
<ThemeProvider
5757
attribute="class"
58+
enableSystem={false}
5859
themes={[
5960
...modeOptions,
6061
...fontOptions,

0 commit comments

Comments
 (0)