Skip to content

feat: Implement dark mode#1

Open
xmurcia wants to merge 1 commit intomasterfrom
feat/dark-mode
Open

feat: Implement dark mode#1
xmurcia wants to merge 1 commit intomasterfrom
feat/dark-mode

Conversation

@xmurcia
Copy link
Copy Markdown
Owner

@xmurcia xmurcia commented May 23, 2025

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant