Skip to content

[Brave Midnight] Add Brave Midnight (Darker) theme feature and pref #30520

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sangwoo108
Copy link
Collaborator

@sangwoo108 sangwoo108 commented Aug 7, 2025

This commit introduces the Brave Midnight theme, a darker variant of the existing dark theme, providing users with enhanced customization options for their browsing experience.

Key changes:

  • Add feature flag kBraveMidnightTheme to control theme availability
  • Create new preference kBraveDarkerMode to store user's theme choice
  • Implement UI toggle in Customize Chrome side panel for theme switching
  • Add Mojo interface methods for theme state management

Technical implementation:

  • Created browser/ui/color/features.{cc,h} for feature flag definition
  • Added feature flag to about_flags.cc for experimental access
  • Registered preference in brave_profile_prefs.cc when feature is enabled
  • Extended Customize Chrome UI with DarkerThemeToggle component
  • Added Mojo interface methods GetUseDarkerTheme/SetUseDarkerTheme

The feature is disabled by default and can be enabled via the brave-midnight-theme flag in brave://flags. When enabled, users can toggle the darker theme through the Customize Chrome side panel.

image image

Resolves brave/brave-browser#48192
Resolves brave/brave-browser#48193

@github-actions github-actions bot added CI/storybook-url Deploy storybook and provide a unique URL for each build CI/run-upstream-tests Run upstream unit and browser tests on Linux and Windows (otherwise only on Linux) labels Aug 7, 2025
@brave-builds
Copy link
Collaborator

Warning

You have got a presubmit warning. Please address it if possible.

Found 5 lines longer than 80 characters (first 5 shown).

Items:

chromium_src/chrome/browser/resources/side_panel/customize_chrome/app.ts, line 45, 107 chars
chromium_src/chrome/browser/resources/side_panel/customize_chrome/app.ts, line 46, 107 chars
chromium_src/chrome/browser/resources/side_panel/customize_chrome/app.ts, line 48, 87 chars
chromium_src/chrome/browser/resources/side_panel/customize_chrome/app.ts, line 85, 94 chars
chromium_src/chrome/browser/resources/side_panel/customize_chrome/app.ts, line 99, 81 chars

@sangwoo108 sangwoo108 force-pushed the sko/midnight branch 2 times, most recently from 18bee19 to 4ea19ce Compare August 7, 2025 06:24
@sangwoo108 sangwoo108 changed the title [Brave Midnight] Add Brave Midnight (Darker) theme feature [Brave Midnight] Add Brave Midnight (Darker) theme feature and pref Aug 7, 2025
@sangwoo108 sangwoo108 force-pushed the sko/midnight branch 2 times, most recently from 64ecc00 to 6d48523 Compare August 7, 2025 22:53
This commit introduces the Brave Midnight theme, a darker variant of the
existing dark theme, providing users with enhanced customization options
for their browsing experience.

Key changes:
* Add feature flag `kBraveMidnightTheme` to control theme availability
* Create new preference `kBraveDarkerMode` to store user's theme choice
* Implement UI toggle in Customize Chrome side panel for theme switching
* Add Mojo interface methods for theme state management

Technical implementation:
- Created `browser/ui/color/features.{cc,h}` for feature flag definition
- Added feature flag to `about_flags.cc` for experimental access
- Registered preference in `brave_profile_prefs.cc` when feature is enabled
- Extended Customize Chrome UI with `DarkerThemeToggle` component
- Added Mojo interface methods `GetUseDarkerTheme`/`SetUseDarkerTheme`

The feature is disabled by default and can be enabled via the
`brave-midnight-theme` flag in brave://flags. When enabled, users can
toggle the darker theme through the Customize Chrome side panel.
@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/run-upstream-tests Run upstream unit and browser tests on Linux and Windows (otherwise only on Linux) CI/storybook-url Deploy storybook and provide a unique URL for each build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Brave Midnight] Make a feature flag to guard Brave Midnight development [Brave Midnight] Make a preference to use darker theme
2 participants