From 4aad7cda8958aeb5df399a8edfc62be7905ba4a0 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: Tue, 20 Dec 2022 17:29:57 +0000 Subject: [PATCH] Add example for link color. --- docs/examples/styles/link_color.css | 11 +++++++++++ docs/examples/styles/link_color.py | 25 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 docs/examples/styles/link_color.css create mode 100644 docs/examples/styles/link_color.py diff --git a/docs/examples/styles/link_color.css b/docs/examples/styles/link_color.css new file mode 100644 index 000000000..949af7078 --- /dev/null +++ b/docs/examples/styles/link_color.css @@ -0,0 +1,11 @@ +#lbl1, #lbl2 { + link-color: red; /* (1)! */ +} + +#lbl3 { + link-color: hsl(60,100%,50%) 50%; +} + +#lbl4 { + link-color: $accent; +} diff --git a/docs/examples/styles/link_color.py b/docs/examples/styles/link_color.py new file mode 100644 index 000000000..85cd36c18 --- /dev/null +++ b/docs/examples/styles/link_color.py @@ -0,0 +1,25 @@ +from textual.app import App +from textual.widgets import Label + + +class LinkColorApp(App): + def compose(self): + yield Label( + "Visit the [link=https://textualize.io]Textualize[/link] website.", + id="lbl1", # (1)! + ) + yield Label( + "Click [@click=app.bell]here[/] for the bell sound.", + id="lbl2", # (2)! + ) + yield Label( + "You can also click [@click=app.bell]here[/] for the bell sound.", + id="lbl3", # (3)! + ) + yield Label( + "[@click=app.quit]Exit this application.[/]", + id="lbl4", # (4)! + ) + + +app = LinkColorApp(css_path="link_color.css")