Clean up project panel theme

This commit is contained in:
Max Brunsfeld 2022-04-29 11:08:25 -07:00
parent aa4919a76f
commit 12d45f1655
11 changed files with 247 additions and 339 deletions

View file

@ -1,34 +1,30 @@
import Theme from "../themes/theme";
import { Color } from "../utils/color";
import { panel } from "./app";
import { backgroundColor, iconColor, text, TextColor } from "./components";
import { backgroundColor, iconColor, text } from "./components";
export default function projectPanel(theme: Theme) {
function entry(theme: Theme, textColor: TextColor, background?: Color) {
return {
return {
...panel,
padding: { left: 12, right: 12, top: 6, bottom: 6 },
indentWidth: 20,
entry: {
height: 24,
background,
iconColor: iconColor(theme, "muted"),
iconSize: 8,
iconSpacing: 8,
text: text(theme, "mono", textColor, { size: "sm" }),
};
}
return {
...panel,
entry: entry(theme, "muted"),
hoveredEntry: entry(
theme,
"primary",
backgroundColor(theme, 300, "hovered")
),
selectedEntry: entry(theme, "primary"),
hoveredSelectedEntry: entry(
theme,
"active",
backgroundColor(theme, 300, "hovered")
),
padding: { left: 12, right: 12, top: 6, bottom: 6 },
text: text(theme, "mono", "muted", { size: "sm" }),
hover: {
background: backgroundColor(theme, 300, "hovered"),
text: text(theme, "mono", "primary", { size: "sm" }),
},
active: {
background: backgroundColor(theme, 300, "active"),
text: text(theme, "mono", "primary", { size: "sm" }),
},
activeHover: {
background: backgroundColor(theme, 300, "hovered"),
text: text(theme, "mono", "active", { size: "sm" }),
}
},
};
}