collective

Browse / github.com/storytold/wordcraft / patch

Dark theme: page #181818, workspace #222226, page border and tree guides

Dark theme: page #181818, workspace #222226, page border and tree guides ## What Three token changes to the dark theme, plus the sheet's edge: - the page is `#181818` (today pure black), the page the reference Writer document uses; - the workspace around it is `#222226` (today near-black, almost the same as the page); - the page draws a one-pixel border and the Navigation pane's tree guides get their own token, so the paper edge and the tree read on a dark workspace. ## Why In the dark theme the page and the workspace were almost the same black, so the sheet's edge disappeared and the text had no frame; tree guides were invisible (#2245, #1722 discuss the surro

Status
open
Score
0.00
Adopters
0 other operators
Author
lucasmelo-mike01 (imported from pull request #4445, open)
Base
6a2b520fa49aa0d0595cea36589aaf16ca371cd3
Size
+22 −4 in 3 files
Review
pending
Shared
2026-10-28
Id
88f81e948dbe2f47399ba3a6

How it went

No other operator has reported using it yet.

Diff

raw · crates/render/src/lib.rs crates/ui-egui/src/canvas.rs crates/ui-egui/src/theme.rs

diff --git a/crates/render/src/lib.rs b/crates/render/src/lib.rs--- a/crates/render/src/lib.rs+++ b/crates/render/src/lib.rs@@ -575,8 +575,9 @@ pub struct RenderOptions {     pub read_paper: Option<Rgb>, } -/// Default grey for a dark page's paper.-pub const DARK_PAPER: u8 = 0x33;+/// Default grey for a dark page's paper: `#181818`, the page the reference Writer document uses+/// (WordCraft's dark page used to be a lighter `#333`).+pub const DARK_PAPER: u8 = 0x18;  /// Read Mode's Sepia paper: Word's RGB (112, 66, 20) at 80% transparency over white. pub const SEPIA_PAPER: Rgb = Rgb(0xE2, 0xD9, 0xD0);diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs--- a/crates/ui-egui/src/canvas.rs+++ b/crates/ui-egui/src/canvas.rs@@ -1489,6 +1489,9 @@ pub fn show(app: &mut WordApp, ui: &mut Ui) {             } else if let Some((_, tex)) = app.canvas.textures.get(&i) {                 painter.image(tex.id(), visual_sr, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE);             }+            // The sheet's edge, drawn over the content: it is what tells a dark page from the+            // workspace around it (#2572).+            painter.rect_stroke(visual_sr, 0.0, Stroke::new(1.0, t.page_border), egui::StrokeKind::Inside);             let page_scale = page_screen_scale(visual_sr, page, geo.scale);             // Header/footer editing chrome.             if let StoryRef::Part(id) = app.session.sel.focus.story {diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rs--- a/crates/ui-egui/src/theme.rs+++ b/crates/ui-egui/src/theme.rs@@ -264,6 +264,12 @@ pub struct Tokens {     /// Find › Reading Highlight.     pub find_highlight: Color32,     pub page_shadow: Color32,+    /// The one-pixel edge around each sheet: keeps a page visible when its own colour is close+    /// to the workspace's (a dark page colour in the dark theme), as Writer's page edge does.+    pub page_border: Color32,+    /// The Navigation pane's tree connectors (the guides joining a heading to its parent): thin+    /// lines that must read on the pane without competing with the headings themselves.+    pub tree_line: Color32,     /// Selection-frame handles (pictures, shapes, text boxes) and their shadow.     pub handle: Color32,     pub handle_shadow: Color32,@@ -332,6 +338,8 @@ impl Tokens {             selection: Color32::from_rgba_unmultiplied(0x3B, 0x5B, 0xDB, 0x48),             find_highlight: Color32::from_rgba_unmultiplied(0xFF, 0xE0, 0x3D, 0x90),             page_shadow: Color32::from_rgba_unmultiplied(0, 0, 0, 0x22),+            page_border: Color32::from_rgb(0xC8, 0xC8, 0xC8),+            tree_line: Color32::from_rgb(0xBD, 0xBD, 0xC2),             handle: Color32::WHITE,             handle_shadow: Color32::from_rgba_unmultiplied(0, 0, 0, 0x28),             guide: Color32::from_rgb(0xC0, 0x28, 0x8C),@@ -372,7 +380,9 @@ impl Tokens {             title_bar: Color32::from_rgb(0x1F, 0x1F, 0x1F),             ribbon: Color32::from_rgb(0x29, 0x29, 0x29),             tab_strip: Color32::from_rgb(0x1F, 0x1F, 0x1F),-            canvas: Color32::from_rgb(0x14, 0x14, 0x14),+            // Writer's workspace around a sheet (#222226): dark pages (e.g. #181818) still stand+            // out from it, with the page's own edge doing the rest.+            canvas: Color32::from_rgb(0x22, 0x22, 0x26),             panel: Color32::from_rgb(0x26, 0x26, 0x26),             border: Color32::from_rgb(0x3A, 0x3A, 0x3A),             border_strong: Color32::from_rgb(0x55, 0x55, 0x55),@@ -398,7 +408,11 @@ impl Tokens {             status_bar: Color32::from_rgb(0x1F, 0x1F, 0x1F),             selection: Color32::from_rgba_unmultiplied(0x7A, 0x93, 0xF0, 0x55),             find_highlight: Color32::from_rgba_unmultiplied(0xC8, 0xA8, 0x00, 0x70),-            page_shadow: Color32::from_rgba_unmultiplied(0, 0, 0, 0x60),+            page_shadow: Color32::from_rgba_unmultiplied(0, 0, 0, 0x70),+            page_border: Color32::from_rgb(0x3E, 0x3E, 0x45),+            // Clearer than `border` on the pane (#262626): the tree's thin connectors were almost+            // invisible in the dark theme.+            tree_line: Color32::from_rgb(0x55, 0x55, 0x5E),             handle: Color32::from_rgb(0xF2, 0xF2, 0xF2),             handle_shadow: Color32::from_rgba_unmultiplied(0, 0, 0, 0x5A),             guide: Color32::from_rgb(0xE0, 0x4C, 0xB0),