Refactored theme handler functions on themeutils.ts and Navbar.vue component.
Removed useless code logic and cleaned existent codebase.
Additional Information
With those changes, the theme handler is more efficient and stable using localStorage to store user theme preference.
In the future, we'd like to make sure to apply theme preference on website pre-rendering stage, to provide a powerful theme handler to users.
Major changes
Created a composable useTheme function to inject a Ref globally on the project:
Description
Refactored theme handler functions on
themeutils.ts
andNavbar.vue
component. Removed useless code logic and cleaned existent codebase.Additional Information
With those changes, the theme handler is more efficient and stable using localStorage to store user theme preference. In the future, we'd like to make sure to apply theme preference on website pre-rendering stage, to provide a powerful theme handler to users.
Major changes
useTheme
function to inject aRef
globally on the project:setTheme()
function touseTheme()
composable inNavbar.vue
component:setThemeValue(color: string)
function to set the theme based on function argument:Refactored functions on
themeutils.ts
:setTheme function
setThemeLogoPath function
setLocalStorage function
Checklist