From 56f9543a95ded43066505521f6178758ad139e90 Mon Sep 17 00:00:00 2001 From: K Simmons Date: Wed, 21 Sep 2022 12:39:59 -0700 Subject: [PATCH 01/50] reworked style tree to use colorScheme instead of old theme. Very limited style for now --- Cargo.lock | 17 - crates/chat_panel/Cargo.toml | 20 - crates/chat_panel/src/chat_panel.rs | 433 ------------------ crates/terminal/src/mappings/colors.rs | 130 +++--- crates/terminal/src/terminal.rs | 2 +- .../terminal/src/terminal_container_view.rs | 12 +- crates/terminal/src/terminal_element.rs | 25 +- crates/terminal/src/terminal_view.rs | 1 - crates/theme/src/theme.rs | 19 - crates/zed/Cargo.toml | 1 - crates/zed/src/main.rs | 1 - styles/src/buildThemes.ts | 22 +- styles/src/colorSchemes.ts | 31 ++ styles/src/styleTree/app.ts | 42 +- styles/src/styleTree/chatPanel.ts | 108 ----- styles/src/styleTree/commandPalette.ts | 15 +- styles/src/styleTree/components.ts | 183 +++++--- styles/src/styleTree/contactFinder.ts | 19 +- styles/src/styleTree/contactNotification.ts | 21 +- styles/src/styleTree/contactsPanel.ts | 67 +-- styles/src/styleTree/contextMenu.ts | 33 +- styles/src/styleTree/editor.ts | 219 ++++++--- styles/src/styleTree/hoverPopover.ts | 38 +- styles/src/styleTree/picker.ts | 38 +- styles/src/styleTree/projectDiagnostics.ts | 11 +- styles/src/styleTree/projectPanel.ts | 27 +- styles/src/styleTree/search.ts | 50 +- styles/src/styleTree/statusBar.ts | 77 ++-- styles/src/styleTree/tabBar.ts | 52 ++- styles/src/styleTree/terminal.ts | 79 ++-- styles/src/styleTree/tooltip.ts | 20 +- styles/src/styleTree/updateNotification.ts | 17 +- styles/src/styleTree/workspace.ts | 101 ++-- styles/src/themes.ts | 31 -- styles/src/themes/abruzzo.ts | 4 +- styles/src/themes/andromeda.ts | 4 +- styles/src/themes/brushtrees.ts | 6 +- styles/src/themes/cave.ts | 6 +- styles/src/themes/common/base16.ts | 288 ------------ styles/src/themes/common/colorScheme.ts | 83 ++++ styles/src/themes/common/ramps.ts | 176 +++++++ styles/src/themes/common/theme.ts | 164 ------- styles/src/themes/one-dark.ts | 4 +- styles/src/themes/one-light.ts | 4 +- styles/src/themes/rose-pine-dawn.ts | 4 +- styles/src/themes/rose-pine-moon.ts | 4 +- styles/src/themes/rose-pine.ts | 4 +- styles/src/themes/sandcastle.ts | 4 +- styles/src/themes/solarized.ts | 6 +- styles/src/themes/sulphurpool.ts | 6 +- styles/src/themes/summercamp.ts | 4 +- styles/src/themes/summerfruit.ts | 6 +- styles/src/themes/template.ts | 10 +- 53 files changed, 1016 insertions(+), 1733 deletions(-) delete mode 100644 crates/chat_panel/Cargo.toml delete mode 100644 crates/chat_panel/src/chat_panel.rs create mode 100644 styles/src/colorSchemes.ts delete mode 100644 styles/src/styleTree/chatPanel.ts delete mode 100644 styles/src/themes.ts delete mode 100644 styles/src/themes/common/base16.ts create mode 100644 styles/src/themes/common/colorScheme.ts create mode 100644 styles/src/themes/common/ramps.ts delete mode 100644 styles/src/themes/common/theme.ts diff --git a/Cargo.lock b/Cargo.lock index dad1219ddf33923c80845edef255020bd3e4813e..ea877a39d26286dc99d98aea9ea60769b70a7a27 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -814,22 +814,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chat_panel" -version = "0.1.0" -dependencies = [ - "client", - "editor", - "gpui", - "menu", - "postage", - "settings", - "theme", - "time 0.3.11", - "util", - "workspace", -] - [[package]] name = "chrono" version = "0.4.19" @@ -7138,7 +7122,6 @@ dependencies = [ "auto_update", "backtrace", "breadcrumbs", - "chat_panel", "chrono", "cli", "client", diff --git a/crates/chat_panel/Cargo.toml b/crates/chat_panel/Cargo.toml deleted file mode 100644 index 3f3a2651b0e63022d21b66bcdeb62ca981d90a55..0000000000000000000000000000000000000000 --- a/crates/chat_panel/Cargo.toml +++ /dev/null @@ -1,20 +0,0 @@ -[package] -name = "chat_panel" -version = "0.1.0" -edition = "2021" - -[lib] -path = "src/chat_panel.rs" -doctest = false - -[dependencies] -client = { path = "../client" } -editor = { path = "../editor" } -gpui = { path = "../gpui" } -menu = { path = "../menu" } -settings = { path = "../settings" } -theme = { path = "../theme" } -util = { path = "../util" } -workspace = { path = "../workspace" } -postage = { version = "0.4.1", features = ["futures-traits"] } -time = { version = "0.3", features = ["serde", "serde-well-known"] } diff --git a/crates/chat_panel/src/chat_panel.rs b/crates/chat_panel/src/chat_panel.rs deleted file mode 100644 index 6744ae9339ec027623673901218bd53d90d860d6..0000000000000000000000000000000000000000 --- a/crates/chat_panel/src/chat_panel.rs +++ /dev/null @@ -1,433 +0,0 @@ -use client::{ - channel::{Channel, ChannelEvent, ChannelList, ChannelMessage}, - Client, -}; -use editor::Editor; -use gpui::{ - actions, - elements::*, - platform::CursorStyle, - views::{ItemType, Select, SelectStyle}, - AnyViewHandle, AppContext, Entity, ModelHandle, MouseButton, MutableAppContext, RenderContext, - Subscription, Task, View, ViewContext, ViewHandle, -}; -use menu::Confirm; -use postage::prelude::Stream; -use settings::{Settings, SoftWrap}; -use std::sync::Arc; -use time::{OffsetDateTime, UtcOffset}; -use util::{ResultExt, TryFutureExt}; - -const MESSAGE_LOADING_THRESHOLD: usize = 50; - -pub struct ChatPanel { - rpc: Arc, - channel_list: ModelHandle, - active_channel: Option<(ModelHandle, Subscription)>, - message_list: ListState, - input_editor: ViewHandle, - channel_select: ViewHandle, - local_timezone: UtcOffset, - _observe_status: Task<()>, -} - -pub enum Event {} - -actions!(chat_panel, [LoadMoreMessages]); - -pub fn init(cx: &mut MutableAppContext) { - cx.add_action(ChatPanel::send); - cx.add_action(ChatPanel::load_more_messages); -} - -impl ChatPanel { - pub fn new( - rpc: Arc, - channel_list: ModelHandle, - cx: &mut ViewContext, - ) -> Self { - let input_editor = cx.add_view(|cx| { - let mut editor = - Editor::auto_height(4, Some(|theme| theme.chat_panel.input_editor.clone()), cx); - editor.set_soft_wrap_mode(SoftWrap::EditorWidth, cx); - editor - }); - let channel_select = cx.add_view(|cx| { - let channel_list = channel_list.clone(); - Select::new(0, cx, { - move |ix, item_type, is_hovered, cx| { - Self::render_channel_name( - &channel_list, - ix, - item_type, - is_hovered, - &cx.global::().theme.chat_panel.channel_select, - cx, - ) - } - }) - .with_style(move |cx| { - let theme = &cx.global::().theme.chat_panel.channel_select; - SelectStyle { - header: theme.header.container, - menu: theme.menu, - } - }) - }); - - let mut message_list = ListState::new(0, Orientation::Bottom, 1000., cx, { - let this = cx.weak_handle(); - move |_, ix, cx| { - let this = this.upgrade(cx).unwrap().read(cx); - let message = this.active_channel.as_ref().unwrap().0.read(cx).message(ix); - this.render_message(message, cx) - } - }); - message_list.set_scroll_handler(|visible_range, cx| { - if visible_range.start < MESSAGE_LOADING_THRESHOLD { - cx.dispatch_action(LoadMoreMessages); - } - }); - let _observe_status = cx.spawn_weak(|this, mut cx| { - let mut status = rpc.status(); - async move { - while (status.recv().await).is_some() { - if let Some(this) = this.upgrade(&cx) { - this.update(&mut cx, |_, cx| cx.notify()); - } else { - break; - } - } - } - }); - - let mut this = Self { - rpc, - channel_list, - active_channel: Default::default(), - message_list, - input_editor, - channel_select, - local_timezone: cx.platform().local_timezone(), - _observe_status, - }; - - this.init_active_channel(cx); - cx.observe(&this.channel_list, |this, _, cx| { - this.init_active_channel(cx); - }) - .detach(); - cx.observe(&this.channel_select, |this, channel_select, cx| { - let selected_ix = channel_select.read(cx).selected_index(); - let selected_channel = this.channel_list.update(cx, |channel_list, cx| { - let available_channels = channel_list.available_channels()?; - let channel_id = available_channels.get(selected_ix)?.id; - channel_list.get_channel(channel_id, cx) - }); - if let Some(selected_channel) = selected_channel { - this.set_active_channel(selected_channel, cx); - } - }) - .detach(); - - this - } - - fn init_active_channel(&mut self, cx: &mut ViewContext) { - let (active_channel, channel_count) = self.channel_list.update(cx, |list, cx| { - let channel_count; - let mut active_channel = None; - - if let Some(available_channels) = list.available_channels() { - channel_count = available_channels.len(); - if self.active_channel.is_none() { - if let Some(channel_id) = available_channels.first().map(|channel| channel.id) { - active_channel = list.get_channel(channel_id, cx); - } - } - } else { - channel_count = 0; - } - - (active_channel, channel_count) - }); - - if let Some(active_channel) = active_channel { - self.set_active_channel(active_channel, cx); - } else { - self.message_list.reset(0); - self.active_channel = None; - } - - self.channel_select.update(cx, |select, cx| { - select.set_item_count(channel_count, cx); - }); - } - - fn set_active_channel(&mut self, channel: ModelHandle, cx: &mut ViewContext) { - if self.active_channel.as_ref().map(|e| &e.0) != Some(&channel) { - { - let channel = channel.read(cx); - self.message_list.reset(channel.message_count()); - let placeholder = format!("Message #{}", channel.name()); - self.input_editor.update(cx, move |editor, cx| { - editor.set_placeholder_text(placeholder, cx); - }); - } - let subscription = cx.subscribe(&channel, Self::channel_did_change); - self.active_channel = Some((channel, subscription)); - } - } - - fn channel_did_change( - &mut self, - _: ModelHandle, - event: &ChannelEvent, - cx: &mut ViewContext, - ) { - match event { - ChannelEvent::MessagesUpdated { - old_range, - new_count, - } => { - self.message_list.splice(old_range.clone(), *new_count); - } - } - cx.notify(); - } - - fn render_channel(&self, cx: &mut RenderContext) -> ElementBox { - let theme = &cx.global::().theme; - Flex::column() - .with_child( - Container::new(ChildView::new(&self.channel_select, cx).boxed()) - .with_style(theme.chat_panel.channel_select.container) - .boxed(), - ) - .with_child(self.render_active_channel_messages()) - .with_child(self.render_input_box(cx)) - .boxed() - } - - fn render_active_channel_messages(&self) -> ElementBox { - let messages = if self.active_channel.is_some() { - List::new(self.message_list.clone()).boxed() - } else { - Empty::new().boxed() - }; - - FlexItem::new(messages).flex(1., true).boxed() - } - - fn render_message(&self, message: &ChannelMessage, cx: &AppContext) -> ElementBox { - let now = OffsetDateTime::now_utc(); - let settings = cx.global::(); - let theme = if message.is_pending() { - &settings.theme.chat_panel.pending_message - } else { - &settings.theme.chat_panel.message - }; - - Container::new( - Flex::column() - .with_child( - Flex::row() - .with_child( - Container::new( - Label::new( - message.sender.github_login.clone(), - theme.sender.text.clone(), - ) - .boxed(), - ) - .with_style(theme.sender.container) - .boxed(), - ) - .with_child( - Container::new( - Label::new( - format_timestamp(message.timestamp, now, self.local_timezone), - theme.timestamp.text.clone(), - ) - .boxed(), - ) - .with_style(theme.timestamp.container) - .boxed(), - ) - .boxed(), - ) - .with_child(Text::new(message.body.clone(), theme.body.clone()).boxed()) - .boxed(), - ) - .with_style(theme.container) - .boxed() - } - - fn render_input_box(&self, cx: &AppContext) -> ElementBox { - let theme = &cx.global::().theme; - Container::new(ChildView::new(&self.input_editor, cx).boxed()) - .with_style(theme.chat_panel.input_editor.container) - .boxed() - } - - fn render_channel_name( - channel_list: &ModelHandle, - ix: usize, - item_type: ItemType, - is_hovered: bool, - theme: &theme::ChannelSelect, - cx: &AppContext, - ) -> ElementBox { - let channel = &channel_list.read(cx).available_channels().unwrap()[ix]; - let theme = match (item_type, is_hovered) { - (ItemType::Header, _) => &theme.header, - (ItemType::Selected, false) => &theme.active_item, - (ItemType::Selected, true) => &theme.hovered_active_item, - (ItemType::Unselected, false) => &theme.item, - (ItemType::Unselected, true) => &theme.hovered_item, - }; - Container::new( - Flex::row() - .with_child( - Container::new(Label::new("#".to_string(), theme.hash.text.clone()).boxed()) - .with_style(theme.hash.container) - .boxed(), - ) - .with_child(Label::new(channel.name.clone(), theme.name.clone()).boxed()) - .boxed(), - ) - .with_style(theme.container) - .boxed() - } - - fn render_sign_in_prompt(&self, cx: &mut RenderContext) -> ElementBox { - let theme = cx.global::().theme.clone(); - let rpc = self.rpc.clone(); - let this = cx.handle(); - - enum SignInPromptLabel {} - - Align::new( - MouseEventHandler::::new(0, cx, |mouse_state, _| { - Label::new( - "Sign in to use chat".to_string(), - if mouse_state.hovered() { - theme.chat_panel.hovered_sign_in_prompt.clone() - } else { - theme.chat_panel.sign_in_prompt.clone() - }, - ) - .boxed() - }) - .with_cursor_style(CursorStyle::PointingHand) - .on_click(MouseButton::Left, move |_, cx| { - let rpc = rpc.clone(); - let this = this.clone(); - cx.spawn(|mut cx| async move { - if rpc - .authenticate_and_connect(true, &cx) - .log_err() - .await - .is_some() - { - cx.update(|cx| { - if let Some(this) = this.upgrade(cx) { - if this.is_focused(cx) { - this.update(cx, |this, cx| cx.focus(&this.input_editor)); - } - } - }) - } - }) - .detach(); - }) - .boxed(), - ) - .boxed() - } - - fn send(&mut self, _: &Confirm, cx: &mut ViewContext) { - if let Some((channel, _)) = self.active_channel.as_ref() { - let body = self.input_editor.update(cx, |editor, cx| { - let body = editor.text(cx); - editor.clear(cx); - body - }); - - if let Some(task) = channel - .update(cx, |channel, cx| channel.send_message(body, cx)) - .log_err() - { - task.detach(); - } - } - } - - fn load_more_messages(&mut self, _: &LoadMoreMessages, cx: &mut ViewContext) { - if let Some((channel, _)) = self.active_channel.as_ref() { - channel.update(cx, |channel, cx| { - channel.load_more_messages(cx); - }) - } - } -} - -impl Entity for ChatPanel { - type Event = Event; -} - -impl View for ChatPanel { - fn ui_name() -> &'static str { - "ChatPanel" - } - - fn render(&mut self, cx: &mut RenderContext) -> ElementBox { - let element = if self.rpc.user_id().is_some() { - self.render_channel(cx) - } else { - self.render_sign_in_prompt(cx) - }; - let theme = &cx.global::().theme; - ConstrainedBox::new( - Container::new(element) - .with_style(theme.chat_panel.container) - .boxed(), - ) - .with_min_width(150.) - .boxed() - } - - fn focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext) { - if matches!( - *self.rpc.status().borrow(), - client::Status::Connected { .. } - ) { - cx.focus(&self.input_editor); - } - } -} - -fn format_timestamp( - mut timestamp: OffsetDateTime, - mut now: OffsetDateTime, - local_timezone: UtcOffset, -) -> String { - timestamp = timestamp.to_offset(local_timezone); - now = now.to_offset(local_timezone); - - let today = now.date(); - let date = timestamp.date(); - let mut hour = timestamp.hour(); - let mut part = "am"; - if hour > 12 { - hour -= 12; - part = "pm"; - } - if date == today { - format!("{:02}:{:02}{}", hour, timestamp.minute(), part) - } else if date.next_day() == Some(today) { - format!("yesterday at {:02}:{:02}{}", hour, timestamp.minute(), part) - } else { - format!("{:02}/{}/{}", date.month() as u32, date.day(), date.year()) - } -} From 0d9eecd2edc3fca520b02bb8265ec57ed47d03cd Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Wed, 19 Oct 2022 14:55:22 -0400 Subject: [PATCH 46/50] WIP command palette changes --- styles/src/styleTree/commandPalette.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/styles/src/styleTree/commandPalette.ts b/styles/src/styleTree/commandPalette.ts index 1aa45c8c57f927566128e62b422646ea2278c03f..4bde81f7d895176a93a6379a6f0f9deb943277ba 100644 --- a/styles/src/styleTree/commandPalette.ts +++ b/styles/src/styleTree/commandPalette.ts @@ -7,7 +7,7 @@ export default function commandPalette(colorScheme: ColorScheme) { return { keystrokeSpacing: 8, key: { - text: text(layer, "mono", "on", "default", { size: "xs" }), + text: text(layer, "mono", "variant", "default", { size: "xs" }), cornerRadius: 2, background: background(layer, "on"), padding: { @@ -22,7 +22,7 @@ export default function commandPalette(colorScheme: ColorScheme) { left: 2, }, active: { - text: text(layer, "mono", "on", "inverted", { size: "xs" }), + text: text(layer, "mono", "on", "default", { size: "xs" }), background: withOpacity(background(layer, "on"), 0.2), }, }, From e3809c267d51a5ebac6975d545c5de5ca670a722 Mon Sep 17 00:00:00 2001 From: K Simmons Date: Wed, 19 Oct 2022 13:02:51 -0700 Subject: [PATCH 47/50] flattened layers and elevations --- Cargo.lock | 16 --- crates/theme/src/theme.rs | 18 +-- crates/theme_testbench/src/theme_testbench.rs | 109 ++++-------------- styles/src/styleTree/app.ts | 70 +++-------- styles/src/styleTree/commandPalette.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 | 4 +- styles/src/styleTree/contextMenu.ts | 5 +- styles/src/styleTree/editor.ts | 97 ++++++++-------- styles/src/styleTree/hoverPopover.ts | 10 +- .../src/styleTree/incomingCallNotification.ts | 2 +- styles/src/styleTree/picker.ts | 5 +- styles/src/styleTree/projectDiagnostics.ts | 2 +- styles/src/styleTree/projectPanel.ts | 2 +- .../styleTree/projectSharedNotification.ts | 5 +- styles/src/styleTree/search.ts | 2 +- styles/src/styleTree/statusBar.ts | 2 +- styles/src/styleTree/tabBar.ts | 7 +- styles/src/styleTree/terminal.ts | 64 +++++----- styles/src/styleTree/tooltip.ts | 5 +- styles/src/styleTree/updateNotification.ts | 2 +- styles/src/styleTree/workspace.ts | 37 +++--- styles/src/themes/common/colorScheme.ts | 22 ++-- styles/src/themes/common/ramps.ts | 107 +++++------------ 26 files changed, 203 insertions(+), 398 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b442f8d71613551e843247b849a7a6eeb0a8291e..d960b467ad6e7b2b14ecb8017118374cf9c733cb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -855,22 +855,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chat_panel" -version = "0.1.0" -dependencies = [ - "client", - "editor", - "gpui", - "menu", - "postage", - "settings", - "theme", - "time 0.3.15", - "util", - "workspace", -] - [[package]] name = "chrono" version = "0.4.22" diff --git a/crates/theme/src/theme.rs b/crates/theme/src/theme.rs index 11296af6ab2b646e451ee7c74b3ee34d5782344e..b2e97ac8319795407f93bd44930357dc1afa0e96 100644 --- a/crates/theme/src/theme.rs +++ b/crates/theme/src/theme.rs @@ -797,22 +797,16 @@ pub struct ColorScheme { pub name: String, pub is_light: bool, - pub lowest: Elevation, - pub middle: Elevation, - pub highest: Elevation, - - pub players: Vec, -} - -#[derive(Clone, Deserialize, Default)] -pub struct Elevation { pub ramps: RampSet, - pub bottom: Layer, + pub lowest: Layer, pub middle: Layer, - pub top: Layer, + pub highest: Layer, + + pub popover_shadow: Shadow, + pub modal_shadow: Shadow, - pub shadow: Option, + pub players: Vec, } #[derive(Clone, Deserialize, Default)] diff --git a/crates/theme_testbench/src/theme_testbench.rs b/crates/theme_testbench/src/theme_testbench.rs index f9f0d96f4e877fa540279258b3fc6f6b7d24480f..ac78cce1c93c0286a5412e5193d83ebe828a58f7 100644 --- a/crates/theme_testbench/src/theme_testbench.rs +++ b/crates/theme_testbench/src/theme_testbench.rs @@ -11,7 +11,7 @@ use gpui::{ use project::{Project, ProjectEntryId, ProjectPath}; use settings::Settings; use smallvec::SmallVec; -use theme::{ColorScheme, Elevation, Layer, Style, StyleSet}; +use theme::{ColorScheme, Layer, Style, StyleSet}; use workspace::{Item, Workspace}; actions!(theme, [DeployThemeTestbench]); @@ -51,38 +51,15 @@ impl ThemeTestbench { } Flex::column() - .with_child(display_ramp(&color_scheme.lowest.ramps.neutral)) - .with_child(display_ramp(&color_scheme.lowest.ramps.red)) - .with_child(display_ramp(&color_scheme.lowest.ramps.orange)) - .with_child(display_ramp(&color_scheme.lowest.ramps.yellow)) - .with_child(display_ramp(&color_scheme.lowest.ramps.green)) - .with_child(display_ramp(&color_scheme.lowest.ramps.cyan)) - .with_child(display_ramp(&color_scheme.lowest.ramps.blue)) - .with_child(display_ramp(&color_scheme.lowest.ramps.violet)) - .with_child(display_ramp(&color_scheme.lowest.ramps.magenta)) - } - - fn render_elevation( - elevation_index: usize, - elevation: &Elevation, - cx: &mut RenderContext<'_, Self>, - ) -> Flex { - Flex::column() - .with_child( - Self::render_layer(elevation_index * 1000 + 100, &elevation.bottom, cx) - .flex(1., true) - .boxed(), - ) - .with_child( - Self::render_layer(elevation_index * 1000 + 200, &elevation.middle, cx) - .flex(1., true) - .boxed(), - ) - .with_child( - Self::render_layer(elevation_index * 1000 + 300, &elevation.top, cx) - .flex(1., true) - .boxed(), - ) + .with_child(display_ramp(&color_scheme.ramps.neutral)) + .with_child(display_ramp(&color_scheme.ramps.red)) + .with_child(display_ramp(&color_scheme.ramps.orange)) + .with_child(display_ramp(&color_scheme.ramps.yellow)) + .with_child(display_ramp(&color_scheme.ramps.green)) + .with_child(display_ramp(&color_scheme.ramps.cyan)) + .with_child(display_ramp(&color_scheme.ramps.blue)) + .with_child(display_ramp(&color_scheme.ramps.violet)) + .with_child(display_ramp(&color_scheme.ramps.magenta)) } fn render_layer( @@ -272,44 +249,6 @@ impl ThemeTestbench { Label::new(text, text_style) } - - fn elevation_style(elevation: &Elevation) -> ContainerStyle { - let style = ContainerStyle { - margin: Margin { - top: 10., - bottom: 10., - left: 10., - right: 10., - }, - background_color: Some(elevation.bottom.base.default.background), - ..Default::default() - }; - - if elevation.shadow.is_some() { - ContainerStyle { - padding: Padding { - top: 10., - bottom: 10., - left: 10., - right: 10., - }, - border: Border { - width: 1., - color: elevation.bottom.base.default.border, - overlay: false, - top: true, - bottom: true, - left: true, - right: true, - }, - corner_radius: 32., - shadow: elevation.shadow, - ..style - } - } else { - style - } - } } impl Entity for ThemeTestbench { @@ -333,32 +272,24 @@ impl View for ThemeTestbench { .boxed(), ) .with_child( - Self::render_elevation(0, &color_scheme.lowest, cx) - .flex(1., true) - .boxed(), - ) - .with_child( - Flex::row() + Flex::column() .with_child( - Self::render_elevation(1, &color_scheme.middle, cx) + Self::render_layer(100, &color_scheme.lowest, cx) .flex(1., true) .boxed(), ) .with_child( - Container::new( - Self::render_elevation(2, &color_scheme.highest, cx).boxed(), - ) - .with_style(Self::elevation_style(&color_scheme.highest)) - .flex(1., true) - .boxed(), + Self::render_layer(200, &color_scheme.middle, cx) + .flex(1., true) + .boxed(), + ) + .with_child( + Self::render_layer(300, &color_scheme.highest, cx) + .flex(1., true) + .boxed(), ) - .contained() - .with_style(Self::elevation_style(&color_scheme.middle)) - .flex(2., true) .boxed(), ) - .contained() - .with_style(Self::elevation_style(&color_scheme.lowest)) .boxed() } } diff --git a/styles/src/styleTree/app.ts b/styles/src/styleTree/app.ts index 3a800c415bc5deba15f73d569b9faadf7cce54c9..bc4b992ed3bace303615bd94f4cf2b2c54bd85d1 100644 --- a/styles/src/styleTree/app.ts +++ b/styles/src/styleTree/app.ts @@ -18,10 +18,6 @@ import contactList from "./contactList"; import incomingCallNotification from "./incomingCallNotification"; import { ColorScheme } from "../themes/common/colorScheme"; -// export const panel = { -// padding: { top: 12, bottom: 12 }, -// }; - export default function app(colorScheme: ColorScheme): Object { return { meta: { @@ -43,68 +39,28 @@ export default function app(colorScheme: ColorScheme): Object { contactList: contactList(colorScheme), search: search(colorScheme), breadcrumbs: { - ...text(colorScheme.lowest.top, "sans", "variant"), + ...text(colorScheme.highest, "sans", "variant"), padding: { left: 6, }, }, updateNotification: updateNotification(colorScheme), tooltip: tooltip(colorScheme), - terminal: terminal(colorScheme.lowest, colorScheme.players[0].cursor), + terminal: terminal(colorScheme), colorScheme: { ...colorScheme, - lowest: { - ...colorScheme.lowest, - ramps: { - neutral: colorScheme.lowest.ramps.neutral.colors(100, "hex"), - red: colorScheme.lowest.ramps.red.colors(100, "hex"), - orange: colorScheme.lowest.ramps.orange.colors(100, "hex"), - yellow: colorScheme.lowest.ramps.yellow.colors(100, "hex"), - green: colorScheme.lowest.ramps.green.colors(100, "hex"), - cyan: colorScheme.lowest.ramps.cyan.colors(100, "hex"), - blue: colorScheme.lowest.ramps.blue.colors(100, "hex"), - violet: colorScheme.lowest.ramps.violet.colors(100, "hex"), - magenta: colorScheme.lowest.ramps.magenta.colors(100, "hex"), - }, - }, - middle: { - ...colorScheme.middle, - ramps: { - neutral: colorScheme.middle.ramps.neutral.colors(100, "hex"), - red: colorScheme.middle.ramps.red.colors(100, "hex"), - orange: colorScheme.middle.ramps.orange.colors(100, "hex"), - yellow: colorScheme.middle.ramps.yellow.colors(100, "hex"), - green: colorScheme.middle.ramps.green.colors(100, "hex"), - cyan: colorScheme.middle.ramps.cyan.colors(100, "hex"), - blue: colorScheme.middle.ramps.blue.colors(100, "hex"), - violet: colorScheme.middle.ramps.violet.colors(100, "hex"), - magenta: colorScheme.middle.ramps.magenta.colors(100, "hex"), - }, - }, - highest: { - ...colorScheme.highest, - ramps: { - neutral: colorScheme.highest.ramps.neutral.colors(100, "hex"), - red: colorScheme.highest.ramps.red.colors(100, "hex"), - orange: colorScheme.highest.ramps.orange.colors(100, "hex"), - yellow: colorScheme.highest.ramps.yellow.colors(100, "hex"), - green: colorScheme.highest.ramps.green.colors(100, "hex"), - cyan: colorScheme.highest.ramps.cyan.colors(100, "hex"), - blue: colorScheme.highest.ramps.blue.colors(100, "hex"), - violet: colorScheme.highest.ramps.violet.colors(100, "hex"), - magenta: colorScheme.highest.ramps.magenta.colors(100, "hex"), - }, + players: Object.values(colorScheme.players), + ramps: { + neutral: colorScheme.ramps.neutral.colors(100, "hex"), + red: colorScheme.ramps.red.colors(100, "hex"), + orange: colorScheme.ramps.orange.colors(100, "hex"), + yellow: colorScheme.ramps.yellow.colors(100, "hex"), + green: colorScheme.ramps.green.colors(100, "hex"), + cyan: colorScheme.ramps.cyan.colors(100, "hex"), + blue: colorScheme.ramps.blue.colors(100, "hex"), + violet: colorScheme.ramps.violet.colors(100, "hex"), + magenta: colorScheme.ramps.magenta.colors(100, "hex"), }, - players: [ - colorScheme.players["0"], - colorScheme.players["1"], - colorScheme.players["2"], - colorScheme.players["3"], - colorScheme.players["4"], - colorScheme.players["5"], - colorScheme.players["6"], - colorScheme.players["7"], - ], }, }; } diff --git a/styles/src/styleTree/commandPalette.ts b/styles/src/styleTree/commandPalette.ts index 4bde81f7d895176a93a6379a6f0f9deb943277ba..0e0c10bed087be1351830bf3b243d638213dfb54 100644 --- a/styles/src/styleTree/commandPalette.ts +++ b/styles/src/styleTree/commandPalette.ts @@ -3,7 +3,7 @@ import { withOpacity } from "../utils/color"; import { text, background } from "./components"; export default function commandPalette(colorScheme: ColorScheme) { - let layer = colorScheme.highest.top; + let layer = colorScheme.highest; return { keystrokeSpacing: 8, key: { diff --git a/styles/src/styleTree/contactFinder.ts b/styles/src/styleTree/contactFinder.ts index 4ed49ef26c36d19b4a30f4449a74ceb9a5d468f1..c389c126a36b00f78d38f158043f60a2ec094f96 100644 --- a/styles/src/styleTree/contactFinder.ts +++ b/styles/src/styleTree/contactFinder.ts @@ -3,7 +3,7 @@ import { ColorScheme } from "../themes/common/colorScheme"; import { background, border, foreground, text } from "./components"; export default function contactFinder(colorScheme: ColorScheme) { - let layer = colorScheme.highest.top; + let layer = colorScheme.highest; const sideMargin = 6; const contactButton = { diff --git a/styles/src/styleTree/contactList.ts b/styles/src/styleTree/contactList.ts index 42f6ce884e846759e7ebf50d1a9fd0a56917425d..a58bf90fd1f17f543911c27ff2c18523ea5f1426 100644 --- a/styles/src/styleTree/contactList.ts +++ b/styles/src/styleTree/contactList.ts @@ -11,7 +11,7 @@ export default function contactsPanel(colorScheme: ColorScheme) { const nameMargin = 8; const sidePadding = 12; - let layer = colorScheme.lowest.middle; + let layer = colorScheme.middle; const contactButton = { background: background(layer, "on"), diff --git a/styles/src/styleTree/contactNotification.ts b/styles/src/styleTree/contactNotification.ts index 0908d8035dec41f396a2e01aa75a4c9f4b8a0b22..e0b967203d1f72a3eb2fd40c6f88786e6376aafc 100644 --- a/styles/src/styleTree/contactNotification.ts +++ b/styles/src/styleTree/contactNotification.ts @@ -5,7 +5,7 @@ const avatarSize = 12; const headerPadding = 8; export default function contactNotification(colorScheme: ColorScheme): Object { - let layer = colorScheme.middle.bottom; + let layer = colorScheme.lowest; return { headerAvatar: { height: avatarSize, diff --git a/styles/src/styleTree/contactsPopover.ts b/styles/src/styleTree/contactsPopover.ts index be792a1981cc79128acfe6cf8e3ffb3c5807d0b2..50a82517370b258c072f09caf075fa0ee29de1d3 100644 --- a/styles/src/styleTree/contactsPopover.ts +++ b/styles/src/styleTree/contactsPopover.ts @@ -2,14 +2,14 @@ import { ColorScheme } from "../themes/common/colorScheme"; import { background, border, text } from "./components"; export default function contactsPopover(colorScheme: ColorScheme) { - let layer = colorScheme.middle.middle; + let layer = colorScheme.middle; const sidePadding = 12; return { background: background(layer), cornerRadius: 6, padding: { top: 6 }, margin: { top: -6 }, - shadow: colorScheme.middle.shadow, + shadow: colorScheme.popoverShadow, border: border(layer), width: 300, height: 400, diff --git a/styles/src/styleTree/contextMenu.ts b/styles/src/styleTree/contextMenu.ts index fcdf855e56afd58a82598ca82a4155627747ee3f..440ef5b439d60a035c5822a7be55ba2baca4b4ac 100644 --- a/styles/src/styleTree/contextMenu.ts +++ b/styles/src/styleTree/contextMenu.ts @@ -2,13 +2,12 @@ import { ColorScheme } from "../themes/common/colorScheme"; import { background, border, borderColor, text } from "./components"; export default function contextMenu(colorScheme: ColorScheme) { - let elevation = colorScheme.middle; - let layer = elevation.bottom; + let layer = colorScheme.lowest; return { background: background(layer), cornerRadius: 10, padding: 4, - shadow: elevation.shadow, + shadow: colorScheme.popoverShadow, border: border(layer), keystrokeMargin: 30, item: { diff --git a/styles/src/styleTree/editor.ts b/styles/src/styleTree/editor.ts index dd6c5bead7dab3dd97e33f597f4e49164f7bfef5..3b961b7dc057a7369ff1a9c5202eb20d4097e8fd 100644 --- a/styles/src/styleTree/editor.ts +++ b/styles/src/styleTree/editor.ts @@ -15,8 +15,7 @@ import { import hoverPopover from "./hoverPopover"; export default function editor(colorScheme: ColorScheme) { - let elevation = colorScheme.lowest; - let layer = elevation.top; + let layer = colorScheme.highest; const autocompleteItem = { cornerRadius: 6, @@ -48,88 +47,88 @@ export default function editor(colorScheme: ColorScheme) { const syntax = { primary: { - color: elevation.ramps.neutral(1).hex(), + color: colorScheme.ramps.neutral(1).hex(), weight: fontWeights.normal, }, comment: { - color: elevation.ramps.neutral(0.71).hex(), + color: colorScheme.ramps.neutral(0.71).hex(), weight: fontWeights.normal, }, punctuation: { - color: elevation.ramps.neutral(0.86).hex(), + color: colorScheme.ramps.neutral(0.86).hex(), weight: fontWeights.normal, }, constant: { - color: elevation.ramps.green(0.5).hex(), + color: colorScheme.ramps.green(0.5).hex(), weight: fontWeights.normal, }, keyword: { - color: elevation.ramps.blue(0.5).hex(), + color: colorScheme.ramps.blue(0.5).hex(), weight: fontWeights.normal, }, function: { - color: elevation.ramps.yellow(0.5).hex(), + color: colorScheme.ramps.yellow(0.5).hex(), weight: fontWeights.normal, }, type: { - color: elevation.ramps.cyan(0.5).hex(), + color: colorScheme.ramps.cyan(0.5).hex(), weight: fontWeights.normal, }, constructor: { - color: elevation.ramps.blue(0.5).hex(), + color: colorScheme.ramps.blue(0.5).hex(), weight: fontWeights.normal, }, variant: { - color: elevation.ramps.blue(0.5).hex(), + color: colorScheme.ramps.blue(0.5).hex(), weight: fontWeights.normal, }, property: { - color: elevation.ramps.blue(0.5).hex(), + color: colorScheme.ramps.blue(0.5).hex(), weight: fontWeights.normal, }, enum: { - color: elevation.ramps.orange(0.5).hex(), + color: colorScheme.ramps.orange(0.5).hex(), weight: fontWeights.normal, }, operator: { - color: elevation.ramps.orange(0.5).hex(), + color: colorScheme.ramps.orange(0.5).hex(), weight: fontWeights.normal, }, string: { - color: elevation.ramps.orange(0.5).hex(), + color: colorScheme.ramps.orange(0.5).hex(), weight: fontWeights.normal, }, number: { - color: elevation.ramps.green(0.5).hex(), + color: colorScheme.ramps.green(0.5).hex(), weight: fontWeights.normal, }, boolean: { - color: elevation.ramps.green(0.5).hex(), + color: colorScheme.ramps.green(0.5).hex(), weight: fontWeights.normal, }, predictive: { - color: elevation.ramps.neutral(0.57).hex(), + color: colorScheme.ramps.neutral(0.57).hex(), weight: fontWeights.normal, }, title: { - color: elevation.ramps.yellow(0.5).hex(), + color: colorScheme.ramps.yellow(0.5).hex(), weight: fontWeights.bold, }, emphasis: { - color: elevation.ramps.blue(0.5).hex(), + color: colorScheme.ramps.blue(0.5).hex(), weight: fontWeights.normal, }, "emphasis.strong": { - color: elevation.ramps.blue(0.5).hex(), + color: colorScheme.ramps.blue(0.5).hex(), weight: fontWeights.bold, }, linkUri: { - color: elevation.ramps.green(0.5).hex(), + color: colorScheme.ramps.green(0.5).hex(), weight: fontWeights.normal, underline: true, }, linkText: { - color: elevation.ramps.orange(0.5).hex(), + color: colorScheme.ramps.orange(0.5).hex(), weight: fontWeights.normal, italic: true, }, @@ -152,11 +151,11 @@ export default function editor(colorScheme: ColorScheme) { widthEm: 0.16, cornerRadius: 0.05, }, - documentHighlightReadBackground: elevation.ramps + documentHighlightReadBackground: colorScheme.ramps .neutral(0.5) .alpha(0.2) .hex(), // TODO: This was blend - documentHighlightWriteBackground: elevation.ramps + documentHighlightWriteBackground: colorScheme.ramps .neutral(0.5) .alpha(0.4) .hex(), // TODO: This was blend * 2 @@ -178,67 +177,69 @@ export default function editor(colorScheme: ColorScheme) { colorScheme.players[7], ], autocomplete: { - background: background(elevation.bottom), + background: background(colorScheme.lowest), cornerRadius: 8, padding: 4, margin: { left: -14, }, - border: border(elevation.bottom), - shadow: elevation.above.shadow, - matchHighlight: elevation.above.ramps.blue(0.5).hex(), + border: border(colorScheme.lowest), + shadow: colorScheme.popoverShadow, + matchHighlight: foreground(colorScheme.lowest, "accent"), item: autocompleteItem, hoveredItem: { ...autocompleteItem, - background: background(elevation.bottom, "hovered"), + matchHighlight: foreground(colorScheme.lowest, "accent", "hovered"), + background: background(colorScheme.lowest, "hovered"), }, selectedItem: { ...autocompleteItem, - background: background(elevation.bottom, "active"), + matchHighlight: foreground(colorScheme.lowest, "accent", "active"), + background: background(colorScheme.lowest, "active"), }, }, diagnosticHeader: { - background: background(elevation.middle), + background: background(colorScheme.middle), iconWidthFactor: 1.5, textScaleFactor: 0.857, - border: border(elevation.middle, { + border: border(colorScheme.middle, { bottom: true, top: true, }), code: { - ...text(elevation.middle, "mono", { size: "sm" }), + ...text(colorScheme.middle, "mono", { size: "sm" }), margin: { left: 10, }, }, message: { - highlightText: text(elevation.middle, "sans", { + highlightText: text(colorScheme.middle, "sans", { size: "sm", weight: "bold", }), - text: text(elevation.middle, "sans", { size: "sm" }), + text: text(colorScheme.middle, "sans", { size: "sm" }), }, }, diagnosticPathHeader: { - background: background(elevation.middle), + background: background(colorScheme.middle), textScaleFactor: 0.857, - filename: text(elevation.middle, "mono", { size: "sm" }), + filename: text(colorScheme.middle, "mono", { size: "sm" }), path: { - ...text(elevation.middle, "mono", { size: "sm" }), + ...text(colorScheme.middle, "mono", { size: "sm" }), margin: { left: 12, }, }, }, - errorDiagnostic: diagnostic(elevation.middle, "negative"), - warningDiagnostic: diagnostic(elevation.middle, "warning"), - informationDiagnostic: diagnostic(elevation.middle, "accent"), - hintDiagnostic: diagnostic(elevation.middle, "warning"), - invalidErrorDiagnostic: diagnostic(elevation.middle, "base"), - invalidHintDiagnostic: diagnostic(elevation.middle, "base"), - invalidInformationDiagnostic: diagnostic(elevation.middle, "base"), - invalidWarningDiagnostic: diagnostic(elevation.middle, "base"), - hoverPopover: hoverPopover(elevation.above), + errorDiagnostic: diagnostic(colorScheme.middle, "negative"), + warningDiagnostic: diagnostic(colorScheme.middle, "warning"), + informationDiagnostic: diagnostic(colorScheme.middle, "accent"), + hintDiagnostic: diagnostic(colorScheme.middle, "warning"), + invalidErrorDiagnostic: diagnostic(colorScheme.middle, "base"), + invalidHintDiagnostic: diagnostic(colorScheme.middle, "base"), + invalidInformationDiagnostic: diagnostic(colorScheme.middle, "base"), + invalidWarningDiagnostic: diagnostic(colorScheme.middle, "base"), + hoverPopover: hoverPopover(colorScheme), linkDefinition: { color: syntax.linkUri.color, underline: syntax.linkUri.underline, diff --git a/styles/src/styleTree/hoverPopover.ts b/styles/src/styleTree/hoverPopover.ts index 67b619890f87fa42cfb9972d50097855bb94c107..ab4beee11b2a0001b8656a5232b173918a987411 100644 --- a/styles/src/styleTree/hoverPopover.ts +++ b/styles/src/styleTree/hoverPopover.ts @@ -1,8 +1,8 @@ -import { Elevation } from "../themes/common/colorScheme"; +import { ColorScheme } from "../themes/common/colorScheme"; import { background, border, text } from "./components"; -export default function HoverPopover(elevation: Elevation) { - let layer = elevation.middle; +export default function HoverPopover(colorScheme: ColorScheme) { + let layer = colorScheme.middle; let baseContainer = { background: background(layer), cornerRadius: 8, @@ -12,7 +12,7 @@ export default function HoverPopover(elevation: Elevation) { top: 4, bottom: 4, }, - shadow: elevation.shadow, + shadow: colorScheme.popoverShadow, border: border(layer), margin: { left: -8, @@ -40,6 +40,6 @@ export default function HoverPopover(elevation: Elevation) { padding: { top: 4 }, }, prose: text(layer, "sans", { size: "sm" }), - highlight: elevation.ramps.neutral(0.5).alpha(0.2).hex(), // TODO: blend was used here. Replace with something better + highlight: colorScheme.ramps.neutral(0.5).alpha(0.2).hex(), // TODO: blend was used here. Replace with something better }; } diff --git a/styles/src/styleTree/incomingCallNotification.ts b/styles/src/styleTree/incomingCallNotification.ts index f0eb6c3bf5e2cd90bb0e98ef354f3a7a007a44f6..2540e5e78a16c52a373984f5f6a47f5077b17ae3 100644 --- a/styles/src/styleTree/incomingCallNotification.ts +++ b/styles/src/styleTree/incomingCallNotification.ts @@ -2,7 +2,7 @@ import { ColorScheme } from "../themes/common/colorScheme"; import { background, border, text } from "./components"; export default function incomingCallNotification(colorScheme: ColorScheme): Object { - let layer = colorScheme.middle.middle; + let layer = colorScheme.middle; const avatarSize = 48; return { windowHeight: 74, diff --git a/styles/src/styleTree/picker.ts b/styles/src/styleTree/picker.ts index 3e126f4f2e8c82dc592b9b91d2d940769a951c50..4d0b89a1599d4e6ef120492b5b4ee3f3d91f4516 100644 --- a/styles/src/styleTree/picker.ts +++ b/styles/src/styleTree/picker.ts @@ -2,12 +2,11 @@ import { ColorScheme } from "../themes/common/colorScheme"; import { background, border, text } from "./components"; export default function picker(colorScheme: ColorScheme) { - let elevation = colorScheme.highest; - let layer = elevation.top; + let layer = colorScheme.highest; return { background: background(layer), border: border(layer), - shadow: elevation.shadow, + shadow: colorScheme.modalShadow, cornerRadius: 12, padding: { bottom: 4, diff --git a/styles/src/styleTree/projectDiagnostics.ts b/styles/src/styleTree/projectDiagnostics.ts index 32127a84c7a3069dc329aa0bca53048b80d00f39..c80a5e1052a4973bc37a1cf7771038de70423e1e 100644 --- a/styles/src/styleTree/projectDiagnostics.ts +++ b/styles/src/styleTree/projectDiagnostics.ts @@ -2,7 +2,7 @@ import { ColorScheme } from "../themes/common/colorScheme"; import { background, text } from "./components"; export default function projectDiagnostics(colorScheme: ColorScheme) { - let layer = colorScheme.lowest.top; + let layer = colorScheme.highest; return { background: background(layer), tabIconSpacing: 4, diff --git a/styles/src/styleTree/projectPanel.ts b/styles/src/styleTree/projectPanel.ts index e90fd05598dd8f058f745aa435ecb25dfafee1d1..9b906c893f8321c223664ed0087cf9c20957fd5b 100644 --- a/styles/src/styleTree/projectPanel.ts +++ b/styles/src/styleTree/projectPanel.ts @@ -2,7 +2,7 @@ import { ColorScheme } from "../themes/common/colorScheme"; import { background, foreground, text } from "./components"; export default function projectPanel(colorScheme: ColorScheme) { - let layer = colorScheme.lowest.middle; + let layer = colorScheme.middle; return { background: background(layer), padding: { left: 12, right: 12, top: 6, bottom: 6 }, diff --git a/styles/src/styleTree/projectSharedNotification.ts b/styles/src/styleTree/projectSharedNotification.ts index 4c40544c03f3a9706caa02772218bdec974b6b26..05542ca20c3aded4be4f01ec20d76a830289763e 100644 --- a/styles/src/styleTree/projectSharedNotification.ts +++ b/styles/src/styleTree/projectSharedNotification.ts @@ -2,14 +2,13 @@ import { ColorScheme } from "../themes/common/colorScheme"; import { background, border, text } from "./components"; export default function projectSharedNotification(colorScheme: ColorScheme): Object { - let elevation = colorScheme.middle; - let layer = elevation.middle; + let layer = colorScheme.middle; const avatarSize = 48; return { windowHeight: 74, windowWidth: 380, - background: background(layer,), + background: background(layer), ownerContainer: { padding: 12, }, diff --git a/styles/src/styleTree/search.ts b/styles/src/styleTree/search.ts index a9a8a18821219465bb54a9d897eaa3c069c2e8c8..b494c237cccf2b3c365241f2284513f9eba4ee22 100644 --- a/styles/src/styleTree/search.ts +++ b/styles/src/styleTree/search.ts @@ -2,7 +2,7 @@ import { ColorScheme } from "../themes/common/colorScheme"; import { background, border, text } from "./components"; export default function search(colorScheme: ColorScheme) { - let layer = colorScheme.lowest.top; + let layer = colorScheme.highest; // Search input const editor = { diff --git a/styles/src/styleTree/statusBar.ts b/styles/src/styleTree/statusBar.ts index 7af530b2731f0d1df51f92c99cb9ff311cf8341c..bd9a9e2f00a95b179c7f93d2c42005afabecb9b5 100644 --- a/styles/src/styleTree/statusBar.ts +++ b/styles/src/styleTree/statusBar.ts @@ -2,7 +2,7 @@ import { ColorScheme } from "../themes/common/colorScheme"; import { background, border, foreground, text } from "./components"; export default function statusBar(colorScheme: ColorScheme) { - let layer = colorScheme.lowest.bottom; + let layer = colorScheme.lowest; const statusContainer = { cornerRadius: 6, diff --git a/styles/src/styleTree/tabBar.ts b/styles/src/styleTree/tabBar.ts index 01ea3b3dd7196b3b14e361b3ff6ffb35f5074b7b..bd6070e0ed9aa8bb9eb6560487b90d2d6aab6334 100644 --- a/styles/src/styleTree/tabBar.ts +++ b/styles/src/styleTree/tabBar.ts @@ -5,9 +5,8 @@ import { text, border, background, foreground } from "./components"; export default function tabBar(colorScheme: ColorScheme) { const height = 32; - let elevation = colorScheme.lowest; - let activeLayer = elevation.top; - let layer = elevation.middle; + let activeLayer = colorScheme.highest; + let layer = colorScheme.middle; const tab = { height, @@ -70,7 +69,7 @@ export default function tabBar(colorScheme: ColorScheme) { ...activePaneActiveTab, background: withOpacity(tab.background, 0.95), border: undefined as any, - shadow: elevation.above.shadow, + shadow: colorScheme.popoverShadow, }; return { diff --git a/styles/src/styleTree/terminal.ts b/styles/src/styleTree/terminal.ts index a32a976fbfa0a32969be2596f8434342f6c9d4f3..2f5c34e5b8d124c0a6dbdc64541b1b3ce55bccaa 100644 --- a/styles/src/styleTree/terminal.ts +++ b/styles/src/styleTree/terminal.ts @@ -1,6 +1,6 @@ -import { Elevation } from "../themes/common/colorScheme"; +import { ColorScheme } from "../themes/common/colorScheme"; -export default function terminal(elevation: Elevation, cursor_color: string) { +export default function terminal(colorScheme: ColorScheme) { /** * Colors are controlled per-cell in the terminal grid. * Cells can be set to any of these more 'theme-capable' colors @@ -9,44 +9,44 @@ export default function terminal(elevation: Elevation, cursor_color: string) { * https://en.wikipedia.org/wiki/ANSI_escape_code#Colors */ return { - black: elevation.ramps.neutral(0).hex(), - red: elevation.ramps.red(0.5).hex(), - green: elevation.ramps.green(0.5).hex(), - yellow: elevation.ramps.yellow(0.5).hex(), - blue: elevation.ramps.blue(0.5).hex(), - magenta: elevation.ramps.magenta(0.5).hex(), - cyan: elevation.ramps.cyan(0.5).hex(), - white: elevation.ramps.neutral(1).hex(), - brightBlack: elevation.ramps.neutral(0.4).hex(), - brightRed: elevation.ramps.red(0.25).hex(), - brightGreen: elevation.ramps.green(0.25).hex(), - brightYellow: elevation.ramps.yellow(0.25).hex(), - brightBlue: elevation.ramps.blue(0.25).hex(), - brightMagenta: elevation.ramps.magenta(0.25).hex(), - brightCyan: elevation.ramps.cyan(0.25).hex(), - brightWhite: elevation.ramps.neutral(1).hex(), + black: colorScheme.ramps.neutral(0).hex(), + red: colorScheme.ramps.red(0.5).hex(), + green: colorScheme.ramps.green(0.5).hex(), + yellow: colorScheme.ramps.yellow(0.5).hex(), + blue: colorScheme.ramps.blue(0.5).hex(), + magenta: colorScheme.ramps.magenta(0.5).hex(), + cyan: colorScheme.ramps.cyan(0.5).hex(), + white: colorScheme.ramps.neutral(1).hex(), + brightBlack: colorScheme.ramps.neutral(0.4).hex(), + brightRed: colorScheme.ramps.red(0.25).hex(), + brightGreen: colorScheme.ramps.green(0.25).hex(), + brightYellow: colorScheme.ramps.yellow(0.25).hex(), + brightBlue: colorScheme.ramps.blue(0.25).hex(), + brightMagenta: colorScheme.ramps.magenta(0.25).hex(), + brightCyan: colorScheme.ramps.cyan(0.25).hex(), + brightWhite: colorScheme.ramps.neutral(1).hex(), /** * Default color for characters */ - foreground: elevation.ramps.neutral(1).hex(), + foreground: colorScheme.ramps.neutral(1).hex(), /** * Default color for the rectangle background of a cell */ - background: elevation.ramps.neutral(0).hex(), - modalBackground: elevation.ramps.neutral(0.1).hex(), + background: colorScheme.ramps.neutral(0).hex(), + modalBackground: colorScheme.ramps.neutral(0.1).hex(), /** * Default color for the cursor */ - cursor: cursor_color, - dimBlack: elevation.ramps.neutral(1).hex(), - dimRed: elevation.ramps.red(0.75).hex(), - dimGreen: elevation.ramps.green(0.75).hex(), - dimYellow: elevation.ramps.yellow(0.75).hex(), - dimBlue: elevation.ramps.blue(0.75).hex(), - dimMagenta: elevation.ramps.magenta(0.75).hex(), - dimCyan: elevation.ramps.cyan(0.75).hex(), - dimWhite: elevation.ramps.neutral(0.6).hex(), - brightForeground: elevation.ramps.neutral(1).hex(), - dimForeground: elevation.ramps.neutral(0).hex(), + cursor: colorScheme.players[0].cursor, + dimBlack: colorScheme.ramps.neutral(1).hex(), + dimRed: colorScheme.ramps.red(0.75).hex(), + dimGreen: colorScheme.ramps.green(0.75).hex(), + dimYellow: colorScheme.ramps.yellow(0.75).hex(), + dimBlue: colorScheme.ramps.blue(0.75).hex(), + dimMagenta: colorScheme.ramps.magenta(0.75).hex(), + dimCyan: colorScheme.ramps.cyan(0.75).hex(), + dimWhite: colorScheme.ramps.neutral(0.6).hex(), + brightForeground: colorScheme.ramps.neutral(1).hex(), + dimForeground: colorScheme.ramps.neutral(0).hex(), }; } diff --git a/styles/src/styleTree/tooltip.ts b/styles/src/styleTree/tooltip.ts index c6551f02fa428a05065c6e1dad37cbb40f62f59f..5a43b1ef4c6c5ce277f1ad275f932eda5154c750 100644 --- a/styles/src/styleTree/tooltip.ts +++ b/styles/src/styleTree/tooltip.ts @@ -2,14 +2,13 @@ import { ColorScheme } from "../themes/common/colorScheme"; import { background, border, text } from "./components"; export default function tooltip(colorScheme: ColorScheme) { - let elevation = colorScheme.middle; - let layer = colorScheme.middle.middle; + let layer = colorScheme.middle; return { background: background(layer), border: border(layer), padding: { top: 4, bottom: 4, left: 8, right: 8 }, margin: { top: 6, left: 6 }, - shadow: elevation.shadow, + shadow: colorScheme.popoverShadow, cornerRadius: 6, text: text(layer, "sans", { size: "xs" }), keystroke: { diff --git a/styles/src/styleTree/updateNotification.ts b/styles/src/styleTree/updateNotification.ts index d0922a475650297e685a68dca1987435271e0860..08c0b0843074160c962c0cb0e623c1f486603c76 100644 --- a/styles/src/styleTree/updateNotification.ts +++ b/styles/src/styleTree/updateNotification.ts @@ -4,7 +4,7 @@ import { foreground, text } from "./components"; const headerPadding = 8; export default function updateNotification(colorScheme: ColorScheme): Object { - let layer = colorScheme.middle.middle; + let layer = colorScheme.middle; return { message: { ...text(layer, "sans", { size: "xs" }), diff --git a/styles/src/styleTree/workspace.ts b/styles/src/styleTree/workspace.ts index 9641e3f92ff89183dadca4d47189a3f1f6b24268..4b5ee4d0dea1a1c5ba46730b76fe29aac5dba141 100644 --- a/styles/src/styleTree/workspace.ts +++ b/styles/src/styleTree/workspace.ts @@ -11,8 +11,7 @@ import statusBar from "./statusBar"; import tabBar from "./tabBar"; export default function workspace(colorScheme: ColorScheme) { - const elevation = colorScheme.lowest; - const layer = elevation.bottom; + const layer = colorScheme.lowest; const titlebarPadding = 6; const titlebarButton = { cornerRadius: 6, @@ -28,7 +27,7 @@ export default function workspace(colorScheme: ColorScheme) { hover: { ...text(layer, "sans", "hovered", { size: "xs" }), background: background(layer, "hovered"), - border: border(elevation.top, "hovered"), + border: border(layer, "hovered"), }, }; const avatarWidth = 18; @@ -44,12 +43,12 @@ export default function workspace(colorScheme: ColorScheme) { ...text(layer, "sans", { size: "lg" }), }, externalLocationMessage: { - background: background(elevation.middle, "accent"), - border: border(elevation.middle, "accent"), + background: background(colorScheme.middle, "accent"), + border: border(colorScheme.middle, "accent"), cornerRadius: 6, padding: 12, margin: { bottom: 8, right: 8 }, - ...text(elevation.middle, "sans", "accent", { size: "xs" }), + ...text(colorScheme.middle, "sans", "accent", { size: "xs" }), }, leaderBorderOpacity: 0.7, leaderBorderWidth: 2.0, @@ -166,20 +165,20 @@ export default function workspace(colorScheme: ColorScheme) { toolbar: { height: 34, - background: background(elevation.top), - border: border(elevation.top, { bottom: true }), + background: background(colorScheme.highest), + border: border(colorScheme.highest, { bottom: true }), itemSpacing: 8, navButton: { - color: foreground(elevation.top, "on"), + color: foreground(colorScheme.highest, "on"), iconWidth: 12, buttonWidth: 24, cornerRadius: 6, hover: { - color: foreground(elevation.top, "on", "hovered"), - background: background(elevation.top, "on", "hovered"), + color: foreground(colorScheme.highest, "on", "hovered"), + background: background(colorScheme.highest, "on", "hovered"), }, disabled: { - color: foreground(elevation.top, "on", "disabled"), + color: foreground(colorScheme.highest, "on", "disabled"), }, }, padding: { left: 8, right: 8, top: 4, bottom: 4 }, @@ -194,11 +193,11 @@ export default function workspace(colorScheme: ColorScheme) { }, notification: { margin: { top: 10 }, - background: background(elevation.above.middle), + background: background(colorScheme.middle), cornerRadius: 6, padding: 12, - border: border(elevation.above.middle), - shadow: elevation.above.shadow, + border: border(colorScheme.middle), + shadow: colorScheme.popoverShadow, }, notifications: { width: 400, @@ -207,14 +206,14 @@ export default function workspace(colorScheme: ColorScheme) { dock: { initialSizeRight: 640, initialSizeBottom: 480, - wash_color: withOpacity(background(elevation.top), 0.5), + wash_color: withOpacity(background(colorScheme.highest), 0.5), panel: { - border: border(elevation.top), + border: border(colorScheme.highest), }, maximized: { margin: 32, - border: border(elevation.above.top, { overlay: true }), - shadow: elevation.above.shadow, + border: border(colorScheme.highest, { overlay: true }), + shadow: colorScheme.modalShadow, }, }, }; diff --git a/styles/src/themes/common/colorScheme.ts b/styles/src/themes/common/colorScheme.ts index c0118a67c3bef6256d5a111090b4aa799ad9f335..1b2c2cf7e89dc0a0f678370be3ed55709a3a2a46 100644 --- a/styles/src/themes/common/colorScheme.ts +++ b/styles/src/themes/common/colorScheme.ts @@ -4,9 +4,14 @@ export interface ColorScheme { name: string; isLight: boolean; - lowest: Elevation; - middle: Elevation; - highest: Elevation; + lowest: Layer; + middle: Layer; + highest: Layer; + + ramps: RampSet; + + popoverShadow: Shadow; + modalShadow: Shadow; players: Players; } @@ -27,17 +32,6 @@ export interface Players { "7": Player; } -export interface Elevation { - ramps: RampSet; - - bottom: Layer; - middle: Layer; - top: Layer; - - above?: Elevation; - shadow?: Shadow; -} - export interface Shadow { blur: number; color: string; diff --git a/styles/src/themes/common/ramps.ts b/styles/src/themes/common/ramps.ts index cb8f3c3dce216dc24bd07e6f9f55fc161dae4ad7..81b94bdb84f665b033354077c36255364adfb13f 100644 --- a/styles/src/themes/common/ramps.ts +++ b/styles/src/themes/common/ramps.ts @@ -1,11 +1,9 @@ import chroma, { Color, Scale } from "chroma-js"; import { ColorScheme, - Elevation, Layer, Player, RampSet, - Shadow, Style, Styles, StyleSet, @@ -23,7 +21,7 @@ export function createColorScheme( colorRamps: { [rampName: string]: Scale } ): ColorScheme { // Chromajs scales from 0 to 1 flipped if isLight is true - let baseRamps: typeof colorRamps = {}; + let ramps: RampSet = {} as any; // Chromajs mutates the underlying ramp when you call domain. This causes problems because // we now store the ramps object in the theme so that we can pull colors out of them. @@ -33,73 +31,66 @@ export function createColorScheme( // function to any in order to get the colors back out from the original ramps. if (isLight) { for (var rampName in colorRamps) { - baseRamps[rampName] = chroma.scale( + (ramps as any)[rampName] = chroma.scale( colorRamps[rampName].colors(100).reverse() ); } - baseRamps.neutral = chroma.scale(colorRamps.neutral.colors(100).reverse()); + ramps.neutral = chroma.scale(colorRamps.neutral.colors(100).reverse()); } else { for (var rampName in colorRamps) { - baseRamps[rampName] = chroma.scale(colorRamps[rampName].colors(100)); + (ramps as any)[rampName] = chroma.scale(colorRamps[rampName].colors(100)); } - baseRamps.neutral = chroma.scale(colorRamps.neutral.colors(100)); + ramps.neutral = chroma.scale(colorRamps.neutral.colors(100)); } - let baseSet = { - neutral: baseRamps.neutral, - red: baseRamps.red, - orange: baseRamps.orange, - yellow: baseRamps.yellow, - green: baseRamps.green, - cyan: baseRamps.cyan, - blue: baseRamps.blue, - violet: baseRamps.violet, - magenta: baseRamps.magenta, - }; - - let lowest = elevation(resampleSet(baseSet, evenSamples(0, 1))); + let lowest = lowestLayer(ramps); + let middle = middleLayer(ramps); + let highest = highestLayer(ramps); - let middle = elevation(resampleSet(baseSet, evenSamples(0.08, 1)), { + let popoverShadow = { blur: 4, - color: baseSet + color: ramps .neutral(isLight ? 7 : 0) .darken() .alpha(0.2) .hex(), // TODO used blend previously. Replace with something else offset: [1, 2], - }); - lowest.above = middle; + }; - let highest = elevation(resampleSet(baseSet, evenSamples(0.16, 1)), { + let modalShadow = { blur: 16, - color: baseSet + color: ramps .neutral(isLight ? 7 : 0) .darken() .alpha(0.2) .hex(), // TODO used blend previously. Replace with something else offset: [0, 2], - }); - middle.above = highest; + }; let players = { - "0": player(baseSet.blue), - "1": player(baseSet.green), - "2": player(baseSet.magenta), - "3": player(baseSet.orange), - "4": player(baseSet.violet), - "5": player(baseSet.cyan), - "6": player(baseSet.red), - "7": player(baseSet.yellow), + "0": player(ramps.blue), + "1": player(ramps.green), + "2": player(ramps.magenta), + "3": player(ramps.orange), + "4": player(ramps.violet), + "5": player(ramps.cyan), + "6": player(ramps.red), + "7": player(ramps.yellow), }; return { name, isLight, + ramps, + lowest, middle, highest, + popoverShadow, + modalShadow, + players, }; } @@ -111,47 +102,7 @@ function player(ramp: Scale): Player { }; } -function evenSamples(min: number, max: number): number[] { - return Array.from(Array(101).keys()).map( - (i) => (i / 100) * (max - min) + min - ); -} - -function resampleSet(ramps: RampSet, samples: number[]): RampSet { - return { - neutral: resample(ramps.neutral, samples), - red: resample(ramps.red, samples), - orange: resample(ramps.orange, samples), - yellow: resample(ramps.yellow, samples), - green: resample(ramps.green, samples), - cyan: resample(ramps.cyan, samples), - blue: resample(ramps.blue, samples), - violet: resample(ramps.violet, samples), - magenta: resample(ramps.magenta, samples), - }; -} - -function resample(scale: Scale, samples: number[]): Scale { - let newColors = samples.map((sample) => scale(sample)); - return chroma.scale(newColors); -} - -function elevation( - ramps: RampSet, - shadow?: Shadow -): Elevation { - return { - ramps, - - bottom: bottomLayer(ramps), - middle: middleLayer(ramps), - top: topLayer(ramps), - - shadow, - }; -} - -function bottomLayer(ramps: RampSet): Layer { +function lowestLayer(ramps: RampSet): Layer { return { base: buildStyleSet(ramps.neutral, 0.2, 1), variant: buildStyleSet(ramps.neutral, 0.2, 0.7), @@ -175,7 +126,7 @@ function middleLayer(ramps: RampSet): Layer { }; } -function topLayer(ramps: RampSet): Layer { +function highestLayer(ramps: RampSet): Layer { return { base: buildStyleSet(ramps.neutral, 0, 1), variant: buildStyleSet(ramps.neutral, 0, 0.7), From caec9c1f450f82c239ca88d7304b93ad94184440 Mon Sep 17 00:00:00 2001 From: K Simmons Date: Wed, 19 Oct 2022 13:13:50 -0700 Subject: [PATCH 48/50] fixed issue in testbench --- crates/theme_testbench/src/theme_testbench.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/theme_testbench/src/theme_testbench.rs b/crates/theme_testbench/src/theme_testbench.rs index ac78cce1c93c0286a5412e5193d83ebe828a58f7..17b6248671d0a80397a5231fccdb207f3b272acb 100644 --- a/crates/theme_testbench/src/theme_testbench.rs +++ b/crates/theme_testbench/src/theme_testbench.rs @@ -268,7 +268,7 @@ impl View for ThemeTestbench { Self::render_ramps(color_scheme) .contained() .with_margin_right(10.) - .flex(0.2, false) + .flex(0.1, false) .boxed(), ) .with_child( @@ -288,6 +288,7 @@ impl View for ThemeTestbench { .flex(1., true) .boxed(), ) + .flex(1., false) .boxed(), ) .boxed() From b7c439f4c44db03eaff27906b1526d442ff78516 Mon Sep 17 00:00:00 2001 From: K Simmons Date: Wed, 19 Oct 2022 13:39:46 -0700 Subject: [PATCH 49/50] Fixup some theme inconsistencies and incorrect layer selections --- styles/src/styleTree/editor.ts | 14 +++++++------- styles/src/styleTree/picker.ts | 2 +- styles/src/styleTree/workspace.ts | 10 +++++----- styles/src/themes/cave.ts | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/styles/src/styleTree/editor.ts b/styles/src/styleTree/editor.ts index 3b961b7dc057a7369ff1a9c5202eb20d4097e8fd..c94b6d81d214967d24b1752e16fc4dca13f858c9 100644 --- a/styles/src/styleTree/editor.ts +++ b/styles/src/styleTree/editor.ts @@ -177,25 +177,25 @@ export default function editor(colorScheme: ColorScheme) { colorScheme.players[7], ], autocomplete: { - background: background(colorScheme.lowest), + background: background(colorScheme.middle), cornerRadius: 8, padding: 4, margin: { left: -14, }, - border: border(colorScheme.lowest), + border: border(colorScheme.middle), shadow: colorScheme.popoverShadow, - matchHighlight: foreground(colorScheme.lowest, "accent"), + matchHighlight: foreground(colorScheme.middle, "accent"), item: autocompleteItem, hoveredItem: { ...autocompleteItem, - matchHighlight: foreground(colorScheme.lowest, "accent", "hovered"), - background: background(colorScheme.lowest, "hovered"), + matchHighlight: foreground(colorScheme.middle, "accent", "hovered"), + background: background(colorScheme.middle, "hovered"), }, selectedItem: { ...autocompleteItem, - matchHighlight: foreground(colorScheme.lowest, "accent", "active"), - background: background(colorScheme.lowest, "active"), + matchHighlight: foreground(colorScheme.middle, "accent", "active"), + background: background(colorScheme.middle, "active"), }, }, diagnosticHeader: { diff --git a/styles/src/styleTree/picker.ts b/styles/src/styleTree/picker.ts index 4d0b89a1599d4e6ef120492b5b4ee3f3d91f4516..30608eeb9ed23186098f78720c0d41938bea90f0 100644 --- a/styles/src/styleTree/picker.ts +++ b/styles/src/styleTree/picker.ts @@ -2,7 +2,7 @@ import { ColorScheme } from "../themes/common/colorScheme"; import { background, border, text } from "./components"; export default function picker(colorScheme: ColorScheme) { - let layer = colorScheme.highest; + let layer = colorScheme.lowest; return { background: background(layer), border: border(layer), diff --git a/styles/src/styleTree/workspace.ts b/styles/src/styleTree/workspace.ts index 4b5ee4d0dea1a1c5ba46730b76fe29aac5dba141..dc3744415967c923848a9b68390dcf4fe6012ae5 100644 --- a/styles/src/styleTree/workspace.ts +++ b/styles/src/styleTree/workspace.ts @@ -21,13 +21,13 @@ export default function workspace(colorScheme: ColorScheme) { left: 8, right: 8, }, - ...text(layer, "sans", { size: "xs" }), - background: background(layer), + ...text(layer, "sans", "variant", { size: "xs" }), + background: background(layer, "variant"), border: border(layer), hover: { - ...text(layer, "sans", "hovered", { size: "xs" }), - background: background(layer, "hovered"), - border: border(layer, "hovered"), + ...text(layer, "sans", "variant", "hovered", { size: "xs" }), + background: background(layer, "variant", "hovered"), + border: border(layer, "variant", "hovered"), }, }; const avatarWidth = 18; diff --git a/styles/src/themes/cave.ts b/styles/src/themes/cave.ts index 3914fb03d714124a2e65d64112b7ec748e70a4c7..f13b9f028a26f7e8ce9fc131c4f00a225f3b85ae 100644 --- a/styles/src/themes/cave.ts +++ b/styles/src/themes/cave.ts @@ -15,7 +15,7 @@ export const dark = createColorScheme(`${name}-dark`, false, { "#e2dfe7", "#efecf4", ]) - .domain([0, 0.3, 0.45, 0.6, 0.65, 0.7, 0.85, 1]), + .domain([0, 0.15, 0.45, 0.6, 0.65, 0.7, 0.85, 1]), red: colorRamp(chroma("#be4678")), orange: colorRamp(chroma("#aa573c")), yellow: colorRamp(chroma("#a06e3b")), From 2aa2e5af7a80d6b54cd8e87b33801585b311c0a1 Mon Sep 17 00:00:00 2001 From: K Simmons Date: Wed, 19 Oct 2022 13:45:00 -0700 Subject: [PATCH 50/50] fix issue with text component and adjust layer selections some more --- styles/src/styleTree/components.ts | 3 ++- styles/src/styleTree/contextMenu.ts | 2 +- styles/src/styleTree/workspace.ts | 10 +++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/styles/src/styleTree/components.ts b/styles/src/styleTree/components.ts index 3062a73130cb1a9641086af32bc3b49221e9538d..7776c4f14fe272cdc6c0d2ea571be93572194f2c 100644 --- a/styles/src/styleTree/components.ts +++ b/styles/src/styleTree/components.ts @@ -123,7 +123,6 @@ export function text( properties?: TextProperties ) { let style = getStyle(layer, styleSetStyleOrProperties, styleOrProperties); - let size = fontSizes[properties?.size || "sm"]; if (typeof styleSetStyleOrProperties === "object") { properties = styleSetStyleOrProperties; @@ -132,6 +131,8 @@ export function text( properties = styleOrProperties; } + let size = fontSizes[properties?.size || "sm"]; + return { family: fontFamilies[fontFamily], color: style.foreground, diff --git a/styles/src/styleTree/contextMenu.ts b/styles/src/styleTree/contextMenu.ts index 440ef5b439d60a035c5822a7be55ba2baca4b4ac..49f3a3b472537ce50a0200ddd6f0ed2ced0d2e4d 100644 --- a/styles/src/styleTree/contextMenu.ts +++ b/styles/src/styleTree/contextMenu.ts @@ -2,7 +2,7 @@ import { ColorScheme } from "../themes/common/colorScheme"; import { background, border, borderColor, text } from "./components"; export default function contextMenu(colorScheme: ColorScheme) { - let layer = colorScheme.lowest; + let layer = colorScheme.middle; return { background: background(layer), cornerRadius: 10, diff --git a/styles/src/styleTree/workspace.ts b/styles/src/styleTree/workspace.ts index dc3744415967c923848a9b68390dcf4fe6012ae5..aced6d2a2ff4578bf2a1c7f593f22eb4f9f6f0cd 100644 --- a/styles/src/styleTree/workspace.ts +++ b/styles/src/styleTree/workspace.ts @@ -139,16 +139,16 @@ export default function workspace(colorScheme: ColorScheme) { }, toggleContactsButton: { cornerRadius: 6, - color: foreground(layer), + color: foreground(layer, "variant"), iconWidth: 8, buttonWidth: 20, active: { - background: background(layer, "active"), - color: foreground(layer, "active"), + background: background(layer, "variant", "active"), + color: foreground(layer, "variant", "active"), }, hover: { - background: background(layer, "hovered"), - color: foreground(layer, "hovered"), + background: background(layer, "variant", "hovered"), + color: foreground(layer, "variant", "hovered"), }, }, toggleContactsBadge: {