Update app.ts, editor.ts

This commit is contained in:
Nate Butler
2022-04-04 12:13:59 -07:00
committed by Keith Simmons
parent 70b15e4c90
commit d88e20477d
5 changed files with 48 additions and 41 deletions
+28 -37
View File
@@ -1,10 +1,10 @@
import { backgroundColor, text } from "./components";
import selectorModal from "./selector-modal";
import workspace from "./workspace";
import editor from "./editor";
import Theme from "./theme";
import projectPanel from "./project-panel";
import chatPanel from "./chat-panel"; import chatPanel from "./chat-panel";
import { backgroundColor, border, borderColor, player, text } from "./components";
import editor from "./editor";
import projectPanel from "./project-panel";
import selectorModal from "./selector-modal";
import Theme from "./theme";
import workspace from "./workspace";
export const panel = { export const panel = {
padding: { top: 12, left: 12, bottom: 12, right: 12 }, padding: { top: 12, left: 12, bottom: 12, right: 12 },
@@ -35,27 +35,27 @@ export default function app(theme: Theme): Object {
contactsPanel: { contactsPanel: {
extends: "$panel", extends: "$panel",
hostRowHeight: 28, hostRowHeight: 28,
treeBranchColor: "$surface.100", treeBranchColor: borderColor(theme, "muted"),
treeBranchWidth: 1, treeBranchWidth: 1,
hostAvatar: { hostAvatar: {
cornerRadius: 10, cornerRadius: 10,
width: 18, width: 18,
}, },
hostUsername: { hostUsername: {
extends: "$text.primary", ...text(theme, "mono", "muted"),
padding: { padding: {
left: 8, left: 8,
}, },
}, },
hoveredSharedProject: { hoveredSharedProject: {
background: "$state.hover",
cornerRadius: 6,
extends: "$contacts_panel.sharedProject", extends: "$contacts_panel.sharedProject",
background: theme.editor.line.active.value,
cornerRadius: 6,
}, },
hoveredUnsharedProject: { hoveredUnsharedProject: {
background: "$state.hover",
cornerRadius: 6,
extends: "$contacts_panel.unsharedProject", extends: "$contacts_panel.unsharedProject",
background: theme.editor.line.active.value,
cornerRadius: 6,
}, },
project: { project: {
guestAvatarSpacing: 4, guestAvatarSpacing: 4,
@@ -65,7 +65,7 @@ export default function app(theme: Theme): Object {
width: 14, width: 14,
}, },
name: { name: {
extends: "$text.secondary", extends: text(theme, "mono", "secondary"),
margin: { margin: {
right: 6, right: 6,
}, },
@@ -77,7 +77,7 @@ export default function app(theme: Theme): Object {
sharedProject: { sharedProject: {
extends: "$contactsPanel.project", extends: "$contactsPanel.project",
name: { name: {
color: "$text.primary.color", color: text(theme, "mono", "primary"),
}, },
}, },
unsharedProject: { unsharedProject: {
@@ -86,28 +86,25 @@ export default function app(theme: Theme): Object {
}, },
search: { search: {
background: backgroundColor(theme, 300), background: backgroundColor(theme, 300),
matchBackground: "$state.highlightedLine", matchBackground: theme.editor.highlight.match,
tabIconSpacing: 4, tabIconSpacing: 4,
tabIconWidth: 14, tabIconWidth: 14,
activeHoveredOptionButton: { activeHoveredOptionButton: {
background: "$surface.100",
extends: "$search.option_button", extends: "$search.option_button",
background: backgroundColor(theme, 100),
}, },
activeOptionButton: { activeOptionButton: {
background: "$surface.100",
extends: "$search.option_button", extends: "$search.option_button",
background: backgroundColor(theme, 100),
}, },
editor: { editor: {
background: "$surface.500", background: backgroundColor(theme, 500),
cornerRadius: 6, cornerRadius: 6,
maxWidth: 400, maxWidth: 400,
placeholderText: "$text.muted", placeholderText: text(theme, "mono", "placeholder"),
selection: "$selection.host", selection: player(theme, 1).selection,
text: "$text.primary", text: text(theme, "mono", "primary"),
border: { border: border(theme, "primary"),
color: "$border.primary",
width: 1,
},
margin: { margin: {
bottom: 5, bottom: 5,
left: 5, left: 5,
@@ -122,28 +119,22 @@ export default function app(theme: Theme): Object {
}, },
}, },
hoveredOptionButton: { hoveredOptionButton: {
background: "$surface.100",
extends: "$search.optionButton", extends: "$search.optionButton",
background: backgroundColor(theme, 100),
}, },
invalidEditor: { invalidEditor: {
extends: "$search.editor", extends: "$search.editor",
border: { border: border(theme, "error"),
color: "$status.bad",
width: 1,
},
}, },
matchIndex: { matchIndex: {
extends: "$text.secondary", ...text(theme, "mono", "secondary"),
padding: 6, padding: 6,
}, },
optionButton: { optionButton: {
...text(theme, "mono", "secondary"),
background: backgroundColor(theme, 300), background: backgroundColor(theme, 300),
cornerRadius: 6, cornerRadius: 6,
extends: "$text.secondary", border: border(theme, "primary"),
border: {
color: "$border.primary",
width: 1,
},
margin: { margin: {
left: 1, left: 1,
right: 1, right: 1,
@@ -162,7 +153,7 @@ export default function app(theme: Theme): Object {
}, },
}, },
resultsStatus: { resultsStatus: {
extends: "$text.primary", ...text(theme, "mono", "primary"),
size: 18, size: 18,
}, },
}, },
+4
View File
@@ -47,6 +47,10 @@ export function border(
}; };
} }
export function borderColor(theme: Theme, color: keyof Theme["borderColor"]) {
return theme.borderColor[color].value;
}
export function iconColor(theme: Theme, color: keyof Theme["iconColor"]) { export function iconColor(theme: Theme, color: keyof Theme["iconColor"]) {
return theme.iconColor[color].value; return theme.iconColor[color].value;
} }
+2 -2
View File
@@ -4,7 +4,7 @@ import {
iconColor, iconColor,
player, player,
text, text,
TextColor, TextColor
} from "./components"; } from "./components";
import Theme from "./theme"; import Theme from "./theme";
@@ -89,7 +89,7 @@ export default function editor(theme: Theme) {
diagnosticHeader: { diagnosticHeader: {
background: theme.editor.background.value, background: theme.editor.background.value,
iconWidthFactor: 1.5, iconWidthFactor: 1.5,
textScaleFactor: 0.857, textScaleFactor: 0.857, // NateQ: Will we need dynamic sizing for text? If so let's create tokens for these.
border: border(theme, "secondary", { border: border(theme, "secondary", {
bottom: true, bottom: true,
top: true, top: true,
+12
View File
@@ -71,6 +71,18 @@ export default interface Theme {
active: { active: {
value: Color; value: Color;
}; };
ok: {
value: Color;
};
error: {
value: Color;
};
warning: {
value: Color;
};
info: {
value: Color;
};
}; };
textColor: { textColor: {
primary: { primary: {
+2 -2
View File
@@ -42,8 +42,8 @@ export default function workspace(theme: Theme) {
}; };
const sidebarItem = { const sidebarItem = {
height: "$workspace.tab.height", height: 32,
iconColor: "$text.muted.color", iconColor: iconColor(theme, "secondary"),
iconSize: 18, iconSize: 18,
}; };
const sidebar = { const sidebar = {