feat(settings): implement the ui part #1818
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to implement a night theme, update the dark theme, and refactor the database initialization. The most important changes include adding a new Vite plugin for the night theme, updating the dark and night theme styles, and modifying the database initialization logic.
Theme Updates:
apps/desktop/electron.vite.config.ts
andapps/web/vite.config.ts
: Added a new Vite plugin namedelement-plus-night-theme
to transform the CSS for the night theme by replacinghtml.dark
withhtml.night
. [1] [2]packages/ui/src/styles/themes/dark.scss
: Updated the dark theme styles with new color values for background, font, border, and shadow colors. [1] [2]packages/ui/src/styles/themes/night.scss
: Updated the night theme styles to align with the new dark theme values. [1] [2]packages/ui/src/styles/variable.scss
: Refactored the SCSS variables to use@use
instead of@forward
for importing theme styles and added a color-scheme for the night theme. [1] [2]Database Initialization:
apps/web/src/database/index.ts
: Refactored the database initialization logic to ensurewindow.db
is assigned before injectingRxMqttxDatabase
and removed debugging code that wrote the database instance towindow
. [1] [2]Store Update:
packages/ui/src/stores/useSettingsStore.ts
: Added a watcher to sync the OS theme with the application theme and update the HTML class list accordingly. [1] [2]