From 14f0240d6a0d068bcdb807843670da6abdfeaea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Gir=C3=A3o=20Serr=C3=A3o?= <5621605+rodrigogiraoserrao@users.noreply.github.com> Date: Wed, 4 Jan 2023 17:09:58 +0000 Subject: [PATCH] Add example for (background) scrollbar active/hover. --- docs/examples/styles/scrollbars2.css | 8 ++++++++ docs/examples/styles/scrollbars2.py | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 docs/examples/styles/scrollbars2.css create mode 100644 docs/examples/styles/scrollbars2.py diff --git a/docs/examples/styles/scrollbars2.css b/docs/examples/styles/scrollbars2.css new file mode 100644 index 000000000..4e7fa8145 --- /dev/null +++ b/docs/examples/styles/scrollbars2.css @@ -0,0 +1,8 @@ +Screen { + scrollbar-background: blue; + scrollbar-background-active: red; + scrollbar-background-hover: purple; + scrollbar-color: cyan; + scrollbar-color-active: yellow; + scrollbar-color-hover: pink; +} diff --git a/docs/examples/styles/scrollbars2.py b/docs/examples/styles/scrollbars2.py new file mode 100644 index 000000000..988b87130 --- /dev/null +++ b/docs/examples/styles/scrollbars2.py @@ -0,0 +1,19 @@ +from textual.app import App +from textual.widgets import Label + +TEXT = """I must not fear. +Fear is the mind-killer. +Fear is the little-death that brings total obliteration. +I will face my fear. +I will permit it to pass over me and through me. +And when it has gone past, I will turn the inner eye to see its path. +Where the fear has gone there will be nothing. Only I will remain. +""" + + +class Scrollbar2App(App): + def compose(self): + yield Label(TEXT * 10) + + +app = Scrollbar2App(css_path="scrollbars2.css")