From d1738cffb589c923d537e01d392c51640b6292f0 Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Wed, 26 Jan 2022 11:24:03 +0000 Subject: [PATCH] Revert dev sandbox --- examples/dev_sandbox.css | 11 +++-------- examples/dev_sandbox.py | 21 ++++++++------------- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/examples/dev_sandbox.css b/examples/dev_sandbox.css index 30e37d779..efafe797e 100644 --- a/examples/dev_sandbox.css +++ b/examples/dev_sandbox.css @@ -1,8 +1,8 @@ -/* CSS file for dev_sandbox.py */ +/* CSS file for basic.py */ App > View { - layout: vertical; - text: on #6e06c2; + docks: side=left/1; + text: on #20639b; } Widget:hover { @@ -36,11 +36,6 @@ Widget:hover { #content { text: white on #20639b; border-bottom: hkey #0f2b41; - offset-y: -3; -} - -#content.-content-visible { - visibility: hidden; } #footer { diff --git a/examples/dev_sandbox.py b/examples/dev_sandbox.py index 1782695fc..6da7068cb 100644 --- a/examples/dev_sandbox.py +++ b/examples/dev_sandbox.py @@ -1,28 +1,23 @@ -from rich.console import RenderableType -from rich.panel import Panel - from textual.app import App from textual.widget import Widget -class PanelWidget(Widget): - def render(self) -> RenderableType: - return Panel("hello world!", title="Title", height=4) - - class BasicApp(App): - """Sandbox application used for testing/development by Textual developers""" + """A basic app demonstrating CSS""" def on_load(self): """Bind keys here.""" self.bind("tab", "toggle_class('#sidebar', '-active')") self.bind("a", "toggle_class('#header', '-visible')") - self.bind("c", "toggle_class('#content', '-content-visible')") def on_mount(self): """Build layout here.""" - self.mount(header=PanelWidget(), content=PanelWidget(), footer=PanelWidget()) - self.view.refresh_layout() + self.mount( + header=Widget(), + content=Widget(), + footer=Widget(), + sidebar=Widget(), + ) -BasicApp.run(log="textual.log") +BasicApp.run(css_file="dev_sandbox.css", watch_css=True, log="textual.log")