Skip to content

Commit ee8a366

Browse files
authored
Merge pull request #24 from browser-use/light-mode
nice light mode
2 parents 1a37c58 + c2db340 commit ee8a366

6 files changed

Lines changed: 199 additions & 76 deletions

File tree

Cargo.lock

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ sha1 = "0.10.6"
4343
sha2 = "0.10"
4444
similar = "2.7.0"
4545
tempfile = "3"
46+
terminal-colorsaurus = "0.4"
4647
thiserror = "1"
4748
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
4849
tokio-util = "0.7"

crates/browser-use-tui/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ serde_json.workspace = true
2727
signal-hook = "0.3.18"
2828
syntect.workspace = true
2929
tempfile.workspace = true
30+
terminal-colorsaurus.workspace = true
3031
toml.workspace = true
3132
tokio = { workspace = true, features = ["rt", "rt-multi-thread", "macros", "io-util", "sync", "time", "net"] }
3233
tokio-util.workspace = true

crates/browser-use-tui/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7195,6 +7195,7 @@ fn main() -> Result<()> {
71957195
return Ok(());
71967196
}
71977197
app.track_app_opened();
7198+
theme::init(theme::detect_palette());
71987199
run_terminal(app)
71997200
}
72007201

crates/browser-use-tui/src/markdown.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -968,9 +968,12 @@ fn syntax_set() -> &'static SyntaxSet {
968968
fn syntax_theme() -> &'static Theme {
969969
static THEME: OnceLock<Theme> = OnceLock::new();
970970
THEME.get_or_init(|| {
971-
two_face::theme::extra()
972-
.get(EmbeddedThemeName::CatppuccinMocha)
973-
.clone()
971+
let name = if crate::theme::is_light() {
972+
EmbeddedThemeName::CatppuccinLatte
973+
} else {
974+
EmbeddedThemeName::CatppuccinMocha
975+
};
976+
two_face::theme::extra().get(name).clone()
974977
})
975978
}
976979

0 commit comments

Comments
 (0)