Skip to content

Add dark/light theme toggle to the browser UI #20

@niklabh

Description

@niklabh

Description

Oxide currently uses a single dark theme. Many users prefer a light theme, and having a toggle is a standard browser feature. This is listed in the roadmap under Phase 9 (Platform Maturity).

What to implement

  1. Add a theme toggle button to the browser toolbar (top bar in ui.rs), e.g. a sun/moon icon or a simple "Theme" button
  2. Store the preference using eframe's persistence or the existing sled store so it survives restarts
  3. Apply the theme using egui's built-in Visuals::dark() and Visuals::light() via ctx.set_visuals()

Implementation hints

egui makes this straightforward:

if dark_mode {
    ctx.set_visuals(egui::Visuals::dark());
} else {
    ctx.set_visuals(egui::Visuals::light());
}

The toggle state can be stored in the OxideBrowser struct and persisted with eframe::Storage.

Files involved

  • oxide-browser/src/ui.rs — add toggle button and apply visuals

Difficulty

Beginner — egui has built-in dark/light theme support. Mostly UI wiring.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions