Skip to content

Dark Mode issue#157 #246

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

Merged
merged 1 commit into from
Apr 1, 2025
Merged

Conversation

DecodersLord
Copy link
Contributor

@DecodersLord DecodersLord commented Feb 11, 2025

This pull request introduces several changes to enhance the color theming and add a theme toggle button to the application. The most important changes include the creation of a new ThemeContext, integration of the ThemeToggleButton, and updates to various components and styles to support the new theming system.

Theming Enhancements:

  • New ThemeContext:

    • Created a ThemeContext with a provider to manage light and dark modes. (context/ThemeContext.tsx)
  • Theme Toggle Button:

    • Added a ThemeToggleButton component to allow users to switch between light and dark modes. (components/Header/ThemeToggleButton.tsx)
    • Integrated the ThemeToggleButton into the Header component. (components/Header/Header.tsx) [1] [2] [3]
  • Color Styles:

    • Defined ColorStyles for the react-select component to match the new theming system. (components/ColorStyles.tsx)
    • Applied ColorStyles to LanguageFilter and SDGFilter components. (components/LanguageFilter.tsx) [1] [2] (components/SDGFilter.tsx) [3] [4]

Component and Style Updates:

  • Header Component:

    • Updated Header component to remove the data-color-mode attribute and use the new ThemeContext. (components/Header/Header.tsx)
    • Updated Header.module.scss to improve styling and align items in the header. (components/Header/Header.module.scss) [1] [2]
  • Global Styles:

    • Updated various global styles to use CSS variables for colors, ensuring consistency across themes. (styles/globals.scss) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • App Component:

    • Modified the App component to wrap the application with the new ThemeProvider and apply the theme context. (pages/_app.tsx) [1] [2]

Dependency Updates:

  • Package.json:
    • Added @primer/octicons-react dependency for theme icons. (package.json)- ThemeContext Implemented ThemeContext to provide a light/dark theme.
  • ThemeToggleButton Added a toggle button to header
  • _app Refined the structure of Map to now utilize PrimerTheme and ThemeContext to utilize theme change easily.
  • Header Adding ThemeToggleButton to the header.
    Fixing UI with flex and div
  • Header.scss Fixing UI with flex and justify content
  • package.json Added octicons to utilize theme icons
  • global.scss utilizing react-primer's built in theming to implement light/dark mode. The global css simply applied using the themeProvider's data-color-mode
  • ColourStyles.tsx Added in order to override the react-select components to override default styles and follow current theme.
  • LanguageFilter & SDGFilter Override default react-select style with newly implemented ColourStyles.

Should Address issue #157

- ThemeContext
Implemented ThemeContext to provide a light/dark theme.
- ThemeToggleButton
Added a toggle button to header
- _app
Refined the structure of Map to now utilize PrimerTheme and ThemeContext to utilize theme change easily.
- Header
Adding ThemeToggleButton to the header.
Fixing UI with flex and div
- Header.scss
Fixing UI with flex and justify content
- package.json
Added octicons to utilize theme icons
- global.scss
utilizing react-primer's built in theming to implement light/dark mode. The global css simply applied using the themeProvider's data-color-mode
- ColourStyles.tsx
Added in order to override the react-select components to override default styles and follow current theme.
- LanguageFilter & SDGFilter
Override default react-select style with newly implemented ColourStyles.
Copy link
Member

@seanmarcia seanmarcia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@seanmarcia
Copy link
Member

Sorry for the delay, was waiting for design to sign off :)

@seanmarcia seanmarcia merged commit bfb04e9 into github:main Apr 1, 2025
@DecodersLord
Copy link
Contributor Author

DecodersLord commented Apr 4, 2025

@seanmarcia I see that the changes were pushed and later reverted, May I know what changed? was there some issues with the PR?

Would love to make necessary changes if required

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.

2 participants