From b0ee65e922fa81675143780fec476beba43d8a6f Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 18 May 2026 23:36:24 +0000 Subject: [PATCH] =?UTF-8?q?feat(ui):=20warm=20editorial=20redesign=20?= =?UTF-8?q?=E2=80=94=20Fraunces=20+=20Geist=20+=20stone=20palette?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lifts ideas from the ``datatools_layout_redesign.html`` mockup (artistic licence, not literal). Two changes: 1. ``.streamlit/config.toml`` ``[theme]`` block — cream paper bg (#fafaf7), warm sidebar (#f5f4ef), stone ink (#1c1917), burnt orange primary (#c2410c). Streamlit threads these through its chrome (focus rings, file-uploader accents, link colors). 2. ``_DESIGN_TOKENS_CSS`` injected by ``hide_streamlit_chrome`` on every page. Imports Fraunces (display serif), Geist (body sans), Geist Mono. Restyles, scoped through ``--dt-*`` custom properties: - Page surface + sidebar — warm cream backgrounds, soft warm borders, no harsh white. - Sidebar nav — section labels in tiny uppercase tracking, nav items with soft hover, active item as a white pill with subtle shadow. - Typography — H1/H2/H3 in Fraunces with tightened tracking; body Geist; inline code Geist Mono with orange-on-cream chip. - Buttons — primary = dark ink (``#1c1917``) with white text; secondary = paper surface with warm border; disabled = muted cream. - Containers / expanders — editorial cards: 14px radius, 1px warm border, faint shadow, warm-cream summary headers. - File uploader — cream dropzone with dashed border + per-file paper chips. - Alerts — soft tinted fills (info=sky, success=mint, warn=amber, error=rose) over the kind-specific palette. - Inputs, tabs, dataframes — paper surfaces with rounded warm borders. Verified at 1920x1050 + 1400x900 on home page (empty + with file uploaded + with findings rendered) and Clean Text tool page; no regressions in the white-bar fix from 65b663b. Co-Authored-By: Claude Opus 4.7 (1M context) --- .streamlit/config.toml | 14 ++ src/gui/components/_legacy.py | 314 ++++++++++++++++++++++++++++++++++ 2 files changed, 328 insertions(+) diff --git a/.streamlit/config.toml b/.streamlit/config.toml index fa008c6..554fbcb 100644 --- a/.streamlit/config.toml +++ b/.streamlit/config.toml @@ -9,3 +9,17 @@ gatherUsageStats = false # reads "Limit 1024MB per file" — matches the analyzer + gate's stated # 1 GB efficiency target. See docs/REQUIREMENTS.md §1.1. maxUploadSize = 1024 + +# Warm, editorial palette inspired by the +# ``datatools_layout_redesign.html`` mockup — cream paper background, +# stone ink, burnt-orange accent. Streamlit reads these on startup and +# threads them through its widget chrome (file uploader, focus rings, +# primary buttons, links). Heavier visual restyling rides on the CSS +# in ``_legacy.py:_DESIGN_TOKENS_CSS``. +[theme] +base = "light" +primaryColor = "#c2410c" +backgroundColor = "#fafaf7" +secondaryBackgroundColor = "#f5f4ef" +textColor = "#1c1917" +font = "sans serif" diff --git a/src/gui/components/_legacy.py b/src/gui/components/_legacy.py index 3aed7ec..93323cb 100644 --- a/src/gui/components/_legacy.py +++ b/src/gui/components/_legacy.py @@ -137,6 +137,319 @@ hr { margin-top: 0.4rem !important; margin-bottom: 0.4rem !important; } """ +# Warm editorial palette + typography, lifted from the +# ``datatools_layout_redesign.html`` mockup. Applied on every page via +# ``hide_streamlit_chrome``. Tokens are scoped through CSS custom +# properties so individual rules read cleanly and a future tweak only +# has to touch the ``:root`` block. +_DESIGN_TOKENS_CSS = """ + +""" + + def hide_streamlit_chrome(*, gate_license: bool = True) -> None: """Inject CSS to hide Streamlit's default header, menu, and footer. @@ -154,6 +467,7 @@ def hide_streamlit_chrome(*, gate_license: bool = True) -> None: can render its own form without recursion. """ st.markdown(_HIDE_CHROME_CSS, unsafe_allow_html=True) + st.markdown(_DESIGN_TOKENS_CSS, unsafe_allow_html=True) # Stamp a session-start record into the audit log the first time # any page renders. Idempotent — subsequent calls are no-ops. # Wrapped because a broken audit log MUST NOT take the GUI down.