From 29de420b59b4734a8c23f313d77d2cab3042093e Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Wed, 7 Jun 2023 12:50:37 -0400 Subject: [PATCH] Organize misc files into `theme`, `themes` and `styleTrees` --- styles/src/buildThemes.ts | 6 +- styles/src/common.ts | 4 +- styles/src/styleTree/app.ts | 2 +- styles/src/styleTree/assistant.ts | 156 +++++++++--------- styles/src/styleTree/commandPalette.ts | 4 +- styles/src/styleTree/components.ts | 2 +- styles/src/styleTree/contactFinder.ts | 2 +- styles/src/styleTree/contactList.ts | 2 +- styles/src/styleTree/contactNotification.ts | 2 +- styles/src/styleTree/contactsPopover.ts | 2 +- styles/src/styleTree/contextMenu.ts | 2 +- styles/src/styleTree/copilot.ts | 2 +- styles/src/styleTree/editor.ts | 15 +- styles/src/styleTree/feedback.ts | 2 +- styles/src/styleTree/hoverPopover.ts | 2 +- .../src/styleTree/incomingCallNotification.ts | 2 +- styles/src/styleTree/picker.ts | 4 +- styles/src/styleTree/projectDiagnostics.ts | 2 +- styles/src/styleTree/projectPanel.ts | 14 +- .../styleTree/projectSharedNotification.ts | 2 +- styles/src/styleTree/search.ts | 6 +- styles/src/styleTree/sharedScreen.ts | 2 +- .../styleTree/simpleMessageNotification.ts | 2 +- styles/src/styleTree/statusBar.ts | 2 +- styles/src/styleTree/tabBar.ts | 6 +- styles/src/styleTree/terminal.ts | 2 +- styles/src/styleTree/tooltip.ts | 2 +- styles/src/styleTree/updateNotification.ts | 2 +- styles/src/styleTree/welcome.ts | 4 +- styles/src/styleTree/workspace.ts | 8 +- styles/src/{utils => theme}/color.ts | 0 .../{themes/common => theme}/colorScheme.ts | 2 +- styles/src/{themes/common => theme}/index.ts | 2 +- styles/src/{themes/common => theme}/ramps.ts | 2 +- styles/src/{themes/common => theme}/syntax.ts | 2 +- styles/src/{ => theme}/themeConfig.ts | 2 +- styles/src/themes/index.ts | 2 +- 37 files changed, 141 insertions(+), 136 deletions(-) rename styles/src/{utils => theme}/color.ts (100%) rename styles/src/{themes/common => theme}/colorScheme.ts (99%) rename styles/src/{themes/common => theme}/index.ts (69%) rename styles/src/{themes/common => theme}/ramps.ts (98%) rename styles/src/{themes/common => theme}/syntax.ts (99%) rename styles/src/{ => theme}/themeConfig.ts (98%) diff --git a/styles/src/buildThemes.ts b/styles/src/buildThemes.ts index bba300989f..8d807d62f3 100644 --- a/styles/src/buildThemes.ts +++ b/styles/src/buildThemes.ts @@ -2,7 +2,7 @@ import * as fs from "fs" import { tmpdir } from "os" import * as path from "path" import app from "./styleTree/app" -import { ColorScheme, createColorScheme } from "./themes/common/colorScheme" +import { ColorScheme, createColorScheme } from "./theme/colorScheme" import snakeCase from "./utils/snakeCase" import { themes } from "./themes" @@ -35,7 +35,9 @@ function writeThemes(colorSchemes: ColorScheme[], outputDirectory: string) { } } -const colorSchemes: ColorScheme[] = themes.map((theme) => createColorScheme(theme)) +const colorSchemes: ColorScheme[] = themes.map((theme) => + createColorScheme(theme) +) // Write new themes to theme directory writeThemes(colorSchemes, `${assetsDirectory}/themes`) diff --git a/styles/src/common.ts b/styles/src/common.ts index 5b6ddff422..ee47bcc6bd 100644 --- a/styles/src/common.ts +++ b/styles/src/common.ts @@ -1,5 +1,5 @@ import chroma from "chroma-js" -export * from "./themes/common" +export * from "./theme" export { chroma } export const fontFamilies = { @@ -27,7 +27,7 @@ export type FontWeight = | "bold" | "extra_bold" | "black" - + export const fontWeights: { [key: string]: FontWeight } = { thin: "thin", extra_light: "extra_light", diff --git a/styles/src/styleTree/app.ts b/styles/src/styleTree/app.ts index a9700a8d99..7398432ec3 100644 --- a/styles/src/styleTree/app.ts +++ b/styles/src/styleTree/app.ts @@ -18,7 +18,7 @@ import tooltip from "./tooltip" import terminal from "./terminal" import contactList from "./contactList" import incomingCallNotification from "./incomingCallNotification" -import { ColorScheme } from "../themes/common/colorScheme" +import { ColorScheme } from "../theme/colorScheme" import feedback from "./feedback" import welcome from "./welcome" import copilot from "./copilot" diff --git a/styles/src/styleTree/assistant.ts b/styles/src/styleTree/assistant.ts index 5e33967b50..bbb4aae5e1 100644 --- a/styles/src/styleTree/assistant.ts +++ b/styles/src/styleTree/assistant.ts @@ -1,85 +1,85 @@ -import { ColorScheme } from "../themes/common/colorScheme" +import { ColorScheme } from "../theme/colorScheme" import { text, border, background, foreground } from "./components" import editor from "./editor" export default function assistant(colorScheme: ColorScheme) { - const layer = colorScheme.highest; + const layer = colorScheme.highest return { - container: { - background: editor(colorScheme).background, - padding: { left: 12 } - }, - header: { - border: border(layer, "default", { bottom: true, top: true }), - margin: { bottom: 6, top: 6 }, - background: editor(colorScheme).background - }, - userSender: { - ...text(layer, "sans", "default", { size: "sm", weight: "bold" }), - }, - assistantSender: { - ...text(layer, "sans", "accent", { size: "sm", weight: "bold" }), - }, - systemSender: { - ...text(layer, "sans", "variant", { size: "sm", weight: "bold" }), - }, - sentAt: { - margin: { top: 2, left: 8 }, - ...text(layer, "sans", "default", { size: "2xs" }), - }, - modelInfoContainer: { - margin: { right: 16, top: 4 }, - }, - model: { - background: background(layer, "on"), - border: border(layer, "on", { overlay: true }), - padding: 4, - cornerRadius: 4, - ...text(layer, "sans", "default", { size: "xs" }), - hover: { - background: background(layer, "on", "hovered"), - } - }, - remainingTokens: { - background: background(layer, "on"), - border: border(layer, "on", { overlay: true }), - padding: 4, - margin: { left: 4 }, - cornerRadius: 4, - ...text(layer, "sans", "positive", { size: "xs" }), - }, - noRemainingTokens: { - background: background(layer, "on"), - border: border(layer, "on", { overlay: true }), - padding: 4, - margin: { left: 4 }, - cornerRadius: 4, - ...text(layer, "sans", "negative", { size: "xs" }), - }, - errorIcon: { - margin: { left: 8 }, - color: foreground(layer, "negative"), - width: 12, - }, - apiKeyEditor: { - background: background(layer, "on"), - cornerRadius: 6, - text: text(layer, "mono", "on"), - placeholderText: text(layer, "mono", "on", "disabled", { - size: "xs", - }), - selection: colorScheme.players[0], - border: border(layer, "on"), - padding: { - bottom: 4, - left: 8, - right: 8, - top: 4, - }, - }, - apiKeyPrompt: { - padding: 10, - ...text(layer, "sans", "default", { size: "xs" }), - } + container: { + background: editor(colorScheme).background, + padding: { left: 12 }, + }, + header: { + border: border(layer, "default", { bottom: true, top: true }), + margin: { bottom: 6, top: 6 }, + background: editor(colorScheme).background, + }, + userSender: { + ...text(layer, "sans", "default", { size: "sm", weight: "bold" }), + }, + assistantSender: { + ...text(layer, "sans", "accent", { size: "sm", weight: "bold" }), + }, + systemSender: { + ...text(layer, "sans", "variant", { size: "sm", weight: "bold" }), + }, + sentAt: { + margin: { top: 2, left: 8 }, + ...text(layer, "sans", "default", { size: "2xs" }), + }, + modelInfoContainer: { + margin: { right: 16, top: 4 }, + }, + model: { + background: background(layer, "on"), + border: border(layer, "on", { overlay: true }), + padding: 4, + cornerRadius: 4, + ...text(layer, "sans", "default", { size: "xs" }), + hover: { + background: background(layer, "on", "hovered"), + }, + }, + remainingTokens: { + background: background(layer, "on"), + border: border(layer, "on", { overlay: true }), + padding: 4, + margin: { left: 4 }, + cornerRadius: 4, + ...text(layer, "sans", "positive", { size: "xs" }), + }, + noRemainingTokens: { + background: background(layer, "on"), + border: border(layer, "on", { overlay: true }), + padding: 4, + margin: { left: 4 }, + cornerRadius: 4, + ...text(layer, "sans", "negative", { size: "xs" }), + }, + errorIcon: { + margin: { left: 8 }, + color: foreground(layer, "negative"), + width: 12, + }, + apiKeyEditor: { + background: background(layer, "on"), + cornerRadius: 6, + text: text(layer, "mono", "on"), + placeholderText: text(layer, "mono", "on", "disabled", { + size: "xs", + }), + selection: colorScheme.players[0], + border: border(layer, "on"), + padding: { + bottom: 4, + left: 8, + right: 8, + top: 4, + }, + }, + apiKeyPrompt: { + padding: 10, + ...text(layer, "sans", "default", { size: "xs" }), + }, } } diff --git a/styles/src/styleTree/commandPalette.ts b/styles/src/styleTree/commandPalette.ts index 038a009007..c49e1f194c 100644 --- a/styles/src/styleTree/commandPalette.ts +++ b/styles/src/styleTree/commandPalette.ts @@ -1,5 +1,5 @@ -import { ColorScheme } from "../themes/common/colorScheme" -import { withOpacity } from "../utils/color" +import { ColorScheme } from "../theme/colorScheme" +import { withOpacity } from "../theme/color" import { text, background } from "./components" export default function commandPalette(colorScheme: ColorScheme) { diff --git a/styles/src/styleTree/components.ts b/styles/src/styleTree/components.ts index efd4a95672..a575dad527 100644 --- a/styles/src/styleTree/components.ts +++ b/styles/src/styleTree/components.ts @@ -1,5 +1,5 @@ import { fontFamilies, fontSizes, FontWeight } from "../common" -import { Layer, Styles, StyleSets, Style } from "../themes/common/colorScheme" +import { Layer, Styles, StyleSets, Style } from "../theme/colorScheme" function isStyleSet(key: any): key is StyleSets { return [ diff --git a/styles/src/styleTree/contactFinder.ts b/styles/src/styleTree/contactFinder.ts index 7b76cde444..e45647c3d6 100644 --- a/styles/src/styleTree/contactFinder.ts +++ b/styles/src/styleTree/contactFinder.ts @@ -1,5 +1,5 @@ import picker from "./picker" -import { ColorScheme } from "../themes/common/colorScheme" +import { ColorScheme } from "../theme/colorScheme" import { background, border, foreground, text } from "./components" export default function contactFinder(colorScheme: ColorScheme): any { diff --git a/styles/src/styleTree/contactList.ts b/styles/src/styleTree/contactList.ts index 8ff5d903d8..a597e44d9f 100644 --- a/styles/src/styleTree/contactList.ts +++ b/styles/src/styleTree/contactList.ts @@ -1,4 +1,4 @@ -import { ColorScheme } from "../themes/common/colorScheme" +import { ColorScheme } from "../theme/colorScheme" import { background, border, borderColor, foreground, text } from "./components" export default function contactsPanel(colorScheme: ColorScheme) { diff --git a/styles/src/styleTree/contactNotification.ts b/styles/src/styleTree/contactNotification.ts index 186f7e8685..85a0b9d0de 100644 --- a/styles/src/styleTree/contactNotification.ts +++ b/styles/src/styleTree/contactNotification.ts @@ -1,4 +1,4 @@ -import { ColorScheme } from "../themes/common/colorScheme" +import { ColorScheme } from "../theme/colorScheme" import { background, foreground, text } from "./components" const avatarSize = 12 diff --git a/styles/src/styleTree/contactsPopover.ts b/styles/src/styleTree/contactsPopover.ts index 5e865aff17..5946bfb82c 100644 --- a/styles/src/styleTree/contactsPopover.ts +++ b/styles/src/styleTree/contactsPopover.ts @@ -1,4 +1,4 @@ -import { ColorScheme } from "../themes/common/colorScheme" +import { ColorScheme } from "../theme/colorScheme" import { background, border, text } from "./components" export default function contactsPopover(colorScheme: ColorScheme) { diff --git a/styles/src/styleTree/contextMenu.ts b/styles/src/styleTree/contextMenu.ts index b4a21deba4..f14cd90219 100644 --- a/styles/src/styleTree/contextMenu.ts +++ b/styles/src/styleTree/contextMenu.ts @@ -1,4 +1,4 @@ -import { ColorScheme } from "../themes/common/colorScheme" +import { ColorScheme } from "../theme/colorScheme" import { background, border, borderColor, text } from "./components" export default function contextMenu(colorScheme: ColorScheme) { diff --git a/styles/src/styleTree/copilot.ts b/styles/src/styleTree/copilot.ts index 9fa86cd741..8614cb6976 100644 --- a/styles/src/styleTree/copilot.ts +++ b/styles/src/styleTree/copilot.ts @@ -1,4 +1,4 @@ -import { ColorScheme } from "../themes/common/colorScheme" +import { ColorScheme } from "../theme/colorScheme" import { background, border, foreground, svg, text } from "./components" export default function copilot(colorScheme: ColorScheme) { diff --git a/styles/src/styleTree/editor.ts b/styles/src/styleTree/editor.ts index 66074aa684..55f3da6e90 100644 --- a/styles/src/styleTree/editor.ts +++ b/styles/src/styleTree/editor.ts @@ -1,9 +1,9 @@ -import { withOpacity } from "../utils/color" -import { ColorScheme, Layer, StyleSets } from "../themes/common/colorScheme" +import { withOpacity } from "../theme/color" +import { ColorScheme, Layer, StyleSets } from "../theme/colorScheme" import { background, border, borderColor, foreground, text } from "./components" import hoverPopover from "./hoverPopover" -import { buildSyntax } from "../themes/common/syntax" +import { buildSyntax } from "../theme/syntax" export default function editor(colorScheme: ColorScheme) { const { isLight } = colorScheme @@ -186,7 +186,10 @@ export default function editor(colorScheme: ColorScheme) { }, }, source: { - text: text(colorScheme.middle, "sans", { size: "sm", weight: "bold", }), + text: text(colorScheme.middle, "sans", { + size: "sm", + weight: "bold", + }), }, message: { highlightText: text(colorScheme.middle, "sans", { @@ -250,7 +253,7 @@ export default function editor(colorScheme: ColorScheme) { right: true, left: true, bottom: false, - } + }, }, git: { deleted: isLight @@ -262,7 +265,7 @@ export default function editor(colorScheme: ColorScheme) { inserted: isLight ? withOpacity(colorScheme.ramps.green(0.5).hex(), 0.8) : withOpacity(colorScheme.ramps.green(0.4).hex(), 0.8), - } + }, }, compositionMark: { underline: { diff --git a/styles/src/styleTree/feedback.ts b/styles/src/styleTree/feedback.ts index ba688d1e2e..5eef4b4279 100644 --- a/styles/src/styleTree/feedback.ts +++ b/styles/src/styleTree/feedback.ts @@ -1,4 +1,4 @@ -import { ColorScheme } from "../themes/common/colorScheme" +import { ColorScheme } from "../theme/colorScheme" import { background, border, text } from "./components" export default function feedback(colorScheme: ColorScheme) { diff --git a/styles/src/styleTree/hoverPopover.ts b/styles/src/styleTree/hoverPopover.ts index b01402e069..f8988f1f3a 100644 --- a/styles/src/styleTree/hoverPopover.ts +++ b/styles/src/styleTree/hoverPopover.ts @@ -1,4 +1,4 @@ -import { ColorScheme } from "../themes/common/colorScheme" +import { ColorScheme } from "../theme/colorScheme" import { background, border, foreground, text } from "./components" export default function HoverPopover(colorScheme: ColorScheme) { diff --git a/styles/src/styleTree/incomingCallNotification.ts b/styles/src/styleTree/incomingCallNotification.ts index 8a57554fce..c42558059c 100644 --- a/styles/src/styleTree/incomingCallNotification.ts +++ b/styles/src/styleTree/incomingCallNotification.ts @@ -1,4 +1,4 @@ -import { ColorScheme } from "../themes/common/colorScheme" +import { ColorScheme } from "../theme/colorScheme" import { background, border, text } from "./components" export default function incomingCallNotification( diff --git a/styles/src/styleTree/picker.ts b/styles/src/styleTree/picker.ts index 66a0d2c126..d84bd6fc7a 100644 --- a/styles/src/styleTree/picker.ts +++ b/styles/src/styleTree/picker.ts @@ -1,5 +1,5 @@ -import { ColorScheme } from "../themes/common/colorScheme" -import { withOpacity } from "../utils/color" +import { ColorScheme } from "../theme/colorScheme" +import { withOpacity } from "../theme/color" import { background, border, text } from "./components" export default function picker(colorScheme: ColorScheme): any { diff --git a/styles/src/styleTree/projectDiagnostics.ts b/styles/src/styleTree/projectDiagnostics.ts index 127cbdb353..cf0f07dd8c 100644 --- a/styles/src/styleTree/projectDiagnostics.ts +++ b/styles/src/styleTree/projectDiagnostics.ts @@ -1,4 +1,4 @@ -import { ColorScheme } from "../themes/common/colorScheme" +import { ColorScheme } from "../theme/colorScheme" import { background, text } from "./components" export default function projectDiagnostics(colorScheme: ColorScheme) { diff --git a/styles/src/styleTree/projectPanel.ts b/styles/src/styleTree/projectPanel.ts index d2cc129452..a86ae010b6 100644 --- a/styles/src/styleTree/projectPanel.ts +++ b/styles/src/styleTree/projectPanel.ts @@ -1,5 +1,5 @@ -import { ColorScheme } from "../themes/common/colorScheme" -import { withOpacity } from "../utils/color" +import { ColorScheme } from "../theme/colorScheme" +import { withOpacity } from "../theme/color" import { background, border, foreground, text } from "./components" export default function projectPanel(colorScheme: ColorScheme) { @@ -24,8 +24,8 @@ export default function projectPanel(colorScheme: ColorScheme) { : colorScheme.ramps.green(0.5).hex(), conflict: isLight ? colorScheme.ramps.red(0.6).hex() - : colorScheme.ramps.red(0.5).hex() - } + : colorScheme.ramps.red(0.5).hex(), + }, } let entry = { @@ -44,7 +44,7 @@ export default function projectPanel(colorScheme: ColorScheme) { background: background(layer, "active"), text: text(layer, "mono", "active", { size: "sm" }), }, - status + status, } return { @@ -79,7 +79,7 @@ export default function projectPanel(colorScheme: ColorScheme) { text: text(layer, "mono", "on", { size: "sm" }), background: withOpacity(background(layer, "on"), 0.9), border: border(layer), - status + status, }, ignoredEntry: { ...entry, @@ -88,7 +88,7 @@ export default function projectPanel(colorScheme: ColorScheme) { active: { ...entry.active, iconColor: foreground(layer, "variant"), - } + }, }, cutEntry: { ...entry, diff --git a/styles/src/styleTree/projectSharedNotification.ts b/styles/src/styleTree/projectSharedNotification.ts index af731f8850..d05eb1b0c5 100644 --- a/styles/src/styleTree/projectSharedNotification.ts +++ b/styles/src/styleTree/projectSharedNotification.ts @@ -1,4 +1,4 @@ -import { ColorScheme } from "../themes/common/colorScheme" +import { ColorScheme } from "../theme/colorScheme" import { background, border, text } from "./components" export default function projectSharedNotification( diff --git a/styles/src/styleTree/search.ts b/styles/src/styleTree/search.ts index 2094a2e369..d69c4bb2d9 100644 --- a/styles/src/styleTree/search.ts +++ b/styles/src/styleTree/search.ts @@ -1,5 +1,5 @@ -import { ColorScheme } from "../themes/common/colorScheme" -import { withOpacity } from "../utils/color" +import { ColorScheme } from "../theme/colorScheme" +import { withOpacity } from "../theme/color" import { background, border, foreground, text } from "./components" export default function search(colorScheme: ColorScheme) { @@ -30,7 +30,7 @@ export default function search(colorScheme: ColorScheme) { ...editor, minWidth: 100, maxWidth: 250, - }; + } return { // TODO: Add an activeMatchBackground on the rust side to differentiate between active and inactive diff --git a/styles/src/styleTree/sharedScreen.ts b/styles/src/styleTree/sharedScreen.ts index cd0d44236e..2563e718ff 100644 --- a/styles/src/styleTree/sharedScreen.ts +++ b/styles/src/styleTree/sharedScreen.ts @@ -1,4 +1,4 @@ -import { ColorScheme } from "../themes/common/colorScheme" +import { ColorScheme } from "../theme/colorScheme" import { background } from "./components" export default function sharedScreen(colorScheme: ColorScheme) { diff --git a/styles/src/styleTree/simpleMessageNotification.ts b/styles/src/styleTree/simpleMessageNotification.ts index 2e057ed783..8d88f05c53 100644 --- a/styles/src/styleTree/simpleMessageNotification.ts +++ b/styles/src/styleTree/simpleMessageNotification.ts @@ -1,4 +1,4 @@ -import { ColorScheme } from "../themes/common/colorScheme" +import { ColorScheme } from "../theme/colorScheme" import { background, border, foreground, text } from "./components" const headerPadding = 8 diff --git a/styles/src/styleTree/statusBar.ts b/styles/src/styleTree/statusBar.ts index eca537c150..a8d926f40e 100644 --- a/styles/src/styleTree/statusBar.ts +++ b/styles/src/styleTree/statusBar.ts @@ -1,4 +1,4 @@ -import { ColorScheme } from "../themes/common/colorScheme" +import { ColorScheme } from "../theme/colorScheme" import { background, border, foreground, text } from "./components" export default function statusBar(colorScheme: ColorScheme) { diff --git a/styles/src/styleTree/tabBar.ts b/styles/src/styleTree/tabBar.ts index 39a1ef0407..c5b397b34a 100644 --- a/styles/src/styleTree/tabBar.ts +++ b/styles/src/styleTree/tabBar.ts @@ -1,5 +1,5 @@ -import { ColorScheme } from "../themes/common/colorScheme" -import { withOpacity } from "../utils/color" +import { ColorScheme } from "../theme/colorScheme" +import { withOpacity } from "../theme/color" import { text, border, background, foreground } from "./components" export default function tabBar(colorScheme: ColorScheme) { @@ -96,7 +96,7 @@ export default function tabBar(colorScheme: ColorScheme) { }, active: { color: foreground(layer, "accent"), - } + }, }, paneButtonContainer: { background: tab.background, diff --git a/styles/src/styleTree/terminal.ts b/styles/src/styleTree/terminal.ts index 4158ace300..8a7eb7a549 100644 --- a/styles/src/styleTree/terminal.ts +++ b/styles/src/styleTree/terminal.ts @@ -1,4 +1,4 @@ -import { ColorScheme } from "../themes/common/colorScheme" +import { ColorScheme } from "../theme/colorScheme" export default function terminal(colorScheme: ColorScheme) { /** diff --git a/styles/src/styleTree/tooltip.ts b/styles/src/styleTree/tooltip.ts index bb66cd413c..1666ce5658 100644 --- a/styles/src/styleTree/tooltip.ts +++ b/styles/src/styleTree/tooltip.ts @@ -1,4 +1,4 @@ -import { ColorScheme } from "../themes/common/colorScheme" +import { ColorScheme } from "../theme/colorScheme" import { background, border, text } from "./components" export default function tooltip(colorScheme: ColorScheme) { diff --git a/styles/src/styleTree/updateNotification.ts b/styles/src/styleTree/updateNotification.ts index 44472a7662..281012e62f 100644 --- a/styles/src/styleTree/updateNotification.ts +++ b/styles/src/styleTree/updateNotification.ts @@ -1,4 +1,4 @@ -import { ColorScheme } from "../themes/common/colorScheme" +import { ColorScheme } from "../theme/colorScheme" import { foreground, text } from "./components" const headerPadding = 8 diff --git a/styles/src/styleTree/welcome.ts b/styles/src/styleTree/welcome.ts index 23e29c4a40..10e6e02b95 100644 --- a/styles/src/styleTree/welcome.ts +++ b/styles/src/styleTree/welcome.ts @@ -1,5 +1,5 @@ -import { ColorScheme } from "../themes/common/colorScheme" -import { withOpacity } from "../utils/color" +import { ColorScheme } from "../theme/colorScheme" +import { withOpacity } from "../theme/color" import { border, background, diff --git a/styles/src/styleTree/workspace.ts b/styles/src/styleTree/workspace.ts index ec992c9c0b..ae8de178f8 100644 --- a/styles/src/styleTree/workspace.ts +++ b/styles/src/styleTree/workspace.ts @@ -1,5 +1,5 @@ -import { ColorScheme } from "../themes/common/colorScheme" -import { withOpacity } from "../utils/color" +import { ColorScheme } from "../theme/colorScheme" +import { withOpacity } from "../theme/color" import { background, border, @@ -123,7 +123,7 @@ export default function workspace(colorScheme: ColorScheme) { cursor: "Arrow", background: isLight ? withOpacity(background(colorScheme.lowest), 0.8) - : withOpacity(background(colorScheme.highest), 0.6) + : withOpacity(background(colorScheme.highest), 0.6), }, zoomedPaneForeground: { margin: 16, @@ -143,7 +143,7 @@ export default function workspace(colorScheme: ColorScheme) { }, right: { border: border(layer, { left: true }), - } + }, }, paneDivider: { color: borderColor(layer), diff --git a/styles/src/utils/color.ts b/styles/src/theme/color.ts similarity index 100% rename from styles/src/utils/color.ts rename to styles/src/theme/color.ts diff --git a/styles/src/themes/common/colorScheme.ts b/styles/src/theme/colorScheme.ts similarity index 99% rename from styles/src/themes/common/colorScheme.ts rename to styles/src/theme/colorScheme.ts index d4ef2ae013..9a81073086 100644 --- a/styles/src/themes/common/colorScheme.ts +++ b/styles/src/theme/colorScheme.ts @@ -5,7 +5,7 @@ import { ThemeConfig, ThemeAppearance, ThemeConfigInputColors, -} from "../../themeConfig" +} from "./themeConfig" import { getRamps } from "./ramps" export interface ColorScheme { diff --git a/styles/src/themes/common/index.ts b/styles/src/theme/index.ts similarity index 69% rename from styles/src/themes/common/index.ts rename to styles/src/theme/index.ts index cd7cf9b0f4..2bf625521c 100644 --- a/styles/src/themes/common/index.ts +++ b/styles/src/theme/index.ts @@ -1,4 +1,4 @@ export * from "./colorScheme" export * from "./ramps" export * from "./syntax" -export * from "../../themeConfig" +export * from "./themeConfig" diff --git a/styles/src/themes/common/ramps.ts b/styles/src/theme/ramps.ts similarity index 98% rename from styles/src/themes/common/ramps.ts rename to styles/src/theme/ramps.ts index ef93ee163f..f8c44ba3f9 100644 --- a/styles/src/themes/common/ramps.ts +++ b/styles/src/theme/ramps.ts @@ -3,7 +3,7 @@ import { RampSet } from "./colorScheme" import { ThemeConfigInputColors, ThemeConfigInputColorsKeys, -} from "../../themeConfig" +} from "./themeConfig" export function colorRamp(color: Color): Scale { let endColor = color.desaturate(1).brighten(5) diff --git a/styles/src/themes/common/syntax.ts b/styles/src/theme/syntax.ts similarity index 99% rename from styles/src/themes/common/syntax.ts rename to styles/src/theme/syntax.ts index 258b845142..380fd31786 100644 --- a/styles/src/themes/common/syntax.ts +++ b/styles/src/theme/syntax.ts @@ -1,5 +1,5 @@ import deepmerge from "deepmerge" -import { FontWeight, fontWeights } from "../../common" +import { FontWeight, fontWeights } from "../common" import { ColorScheme } from "./colorScheme" import chroma from "chroma-js" diff --git a/styles/src/themeConfig.ts b/styles/src/theme/themeConfig.ts similarity index 98% rename from styles/src/themeConfig.ts rename to styles/src/theme/themeConfig.ts index 5c62b94c52..0342d0226d 100644 --- a/styles/src/themeConfig.ts +++ b/styles/src/theme/themeConfig.ts @@ -1,5 +1,5 @@ import { Scale, Color } from "chroma-js" -import { Syntax } from "./themes/common/syntax" +import { Syntax } from "./syntax" interface ThemeMeta { /** The name of the theme */ diff --git a/styles/src/themes/index.ts b/styles/src/themes/index.ts index 52ce1b9327..75853bc042 100644 --- a/styles/src/themes/index.ts +++ b/styles/src/themes/index.ts @@ -1,4 +1,4 @@ -import { ThemeConfig } from "./common" +import { ThemeConfig } from "../theme" import { darkDefault as gruvboxDark } from "./gruvbox/gruvbox-dark" import { darkHard as gruvboxDarkHard } from "./gruvbox/gruvbox-dark-hard" import { darkSoft as gruvboxDarkSoft } from "./gruvbox/gruvbox-dark-soft"