Open
Conversation
Adds a dark mode feature to the application, allowing you to switch between light and dark themes.
Key changes:
- Defined CSS variables for light and dark themes in `src/styles/_variables.scss`.
- Created `src/styles/_dark-theme.scss` for specific dark theme style overrides.
- Imported dark theme styles into the global `src/styles/styles.scss`.
- Implemented theme switching logic in `src/app/app.component.ts`:
- Manages theme state (`isDarkMode`).
- Toggles a `dark-theme` class on the `body` element.
- Persists your preference in `localStorage`.
- Detects system theme preference as an initial default.
- Added a toggle button in `src/app/app.component.html` with corresponding styles in `src/app/app.component.scss`.
- The button text dynamically updates based on the current theme.
- Styles leverage CSS variables for easy theming and maintenance.
Manual testing is recommended to ensure visual consistency and functionality across browsers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds a dark mode feature to the application, allowing you to switch between light and dark themes.
Key changes:
src/styles/_variables.scss.src/styles/_dark-theme.scssfor specific dark theme style overrides.src/styles/styles.scss.src/app/app.component.ts:isDarkMode).dark-themeclass on thebodyelement.localStorage.src/app/app.component.htmlwith corresponding styles insrc/app/app.component.scss.Manual testing is recommended to ensure visual consistency and functionality across browsers.