mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 06:05:24 +00:00
fix: readable terminal selection with the light theme (#1319)
This commit is contained in:
1 parent
e88df7827b
commit
d30875483d
2 files changed
+25
-1
No files matched your search
@@ -41,7 +41,10 @@ export function resolveTermixThemeColors(
|
|||||||
}
|
}
|
||||||
const uiColors =
|
const uiColors =
|
||||||
TERMIX_DEFAULT_COLORS[resolvedUiTheme] ?? TERMIX_DEFAULT_COLORS.dark;
|
TERMIX_DEFAULT_COLORS[resolvedUiTheme] ?? TERMIX_DEFAULT_COLORS.dark;
|
||||||
const base = TERMINAL_THEMES.termixDark.colors;
|
const base =
|
||||||
|
resolvedUiTheme === "light"
|
||||||
|
? TERMINAL_THEMES.termixLight.colors
|
||||||
|
: TERMINAL_THEMES.termixDark.colors;
|
||||||
return {
|
return {
|
||||||
...base,
|
...base,
|
||||||
background: uiColors.background,
|
background: uiColors.background,
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
import { resolveTermixThemeColors } from "../../../src/frontend/look/terminal-theme";
|
||||||
|
import { TERMINAL_THEMES } from "../../../src/frontend/look/terminal-themes";
|
||||||
|
|
||||||
|
describe("resolveTermixThemeColors", () => {
|
||||||
|
it("uses the light selection color with the light UI theme", () => {
|
||||||
|
const colors = resolveTermixThemeColors("termix", "light");
|
||||||
|
expect(colors.background).toBe("#ffffff");
|
||||||
|
expect(colors.selectionBackground).toBe(
|
||||||
|
TERMINAL_THEMES.termixLight.colors.selectionBackground,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("keeps the dark selection color with dark UI themes", () => {
|
||||||
|
const colors = resolveTermixThemeColors("termix", "dracula");
|
||||||
|
expect(colors.background).toBe("#282a36");
|
||||||
|
expect(colors.selectionBackground).toBe(
|
||||||
|
TERMINAL_THEMES.termixDark.colors.selectionBackground,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in new issue
Block a user