mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Add example for link hover color.
This commit is contained in:
11
docs/examples/styles/link_hover_color.css
Normal file
11
docs/examples/styles/link_hover_color.css
Normal file
@@ -0,0 +1,11 @@
|
||||
#lbl1, #lbl2 {
|
||||
link-hover-color: red; /* (1)! */
|
||||
}
|
||||
|
||||
#lbl3 {
|
||||
link-hover-color: hsl(60,100%,50%) 50%;
|
||||
}
|
||||
|
||||
#lbl4 {
|
||||
link-hover-color: black;
|
||||
}
|
||||
25
docs/examples/styles/link_hover_color.py
Normal file
25
docs/examples/styles/link_hover_color.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from textual.app import App
|
||||
from textual.widgets import Label
|
||||
|
||||
|
||||
class LinkHoverColorApp(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 = LinkHoverColorApp(css_path="link_hover_color.css")
|
||||
Reference in New Issue
Block a user