diff --git a/docs/examples/styles/link_hover_style.css b/docs/examples/styles/link_hover_style.css new file mode 100644 index 000000000..169e69d29 --- /dev/null +++ b/docs/examples/styles/link_hover_style.css @@ -0,0 +1,11 @@ +#lbl1, #lbl2 { + link-hover-style: bold italic; /* (1)! */ +} + +#lbl3 { + link-hover-style: reverse strike; +} + +#lbl4 { + link-hover-style: bold; +} diff --git a/docs/examples/styles/link_hover_style.py b/docs/examples/styles/link_hover_style.py new file mode 100644 index 000000000..6a6ef3dba --- /dev/null +++ b/docs/examples/styles/link_hover_style.py @@ -0,0 +1,25 @@ +from textual.app import App +from textual.widgets import Label + + +class LinkHoverStyleApp(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 = LinkHoverStyleApp(css_path="link_hover_style.css")