-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Colorscheme refactoring and fixes #179
Conversation
frontend/components/Navbar.vue
Outdated
setThemeElements(theme); | ||
theme.value = setTheme(); | ||
const isDarkTheme: boolean = | ||
theme.value === "dark" || theme.value === null ? true : false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- theme.value === "dark" || theme.value === null ? true : false;
+ theme.value === "dark" || theme.value === null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
frontend/utils/themeutils.ts
Outdated
export const getThemeElements = (theme: globalThis.Ref<string>): boolean => { | ||
if (theme.value === null || theme.value === 'dark') { | ||
return true | ||
} | ||
document.querySelector("body")?.setAttribute("data-theme", theme.value); | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be replaced with
+ return theme.value === null || theme.value === 'dark'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Description
As stated in the title, this PR aims to improve the code regarding the color scheme.
Proposed Changes
In detail:
The reason for these changes is code optimization.
Checklist