mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Values sections added to CSS properties docs
This commit is contained in:
@@ -2,23 +2,14 @@ Screen {
|
||||
background: lightcoral;
|
||||
}
|
||||
|
||||
#left_pane {
|
||||
background: red;
|
||||
width: 20
|
||||
overflow: scroll scroll;
|
||||
}
|
||||
|
||||
#middle_pane {
|
||||
background: green;
|
||||
width: 140;
|
||||
}
|
||||
|
||||
#right_pane {
|
||||
background: blue;
|
||||
width: 30;
|
||||
}
|
||||
|
||||
.box {
|
||||
.box1 {
|
||||
background: orangered;
|
||||
height: 12;
|
||||
width: 30;
|
||||
}
|
||||
|
||||
.box2 {
|
||||
background: blueviolet;
|
||||
height: 6;
|
||||
width: 12;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
|
||||
from rich.console import RenderableType
|
||||
|
||||
from textual import events
|
||||
@@ -23,17 +21,20 @@ class Box(Widget, can_focus=True):
|
||||
|
||||
class JustABox(App):
|
||||
def compose(self) -> ComposeResult:
|
||||
self.box = Box()
|
||||
self.box = Box(classes="box1")
|
||||
yield self.box
|
||||
yield Box(classes="box2")
|
||||
|
||||
def key_a(self):
|
||||
self.animator.animate(
|
||||
self.box.styles,
|
||||
"opacity",
|
||||
value=0.0,
|
||||
duration=2.0,
|
||||
on_complete=self.box.remove,
|
||||
)
|
||||
self.box.styles.display = "none"
|
||||
# self.box.styles.visibility = "hidden"
|
||||
# self.animator.animate(
|
||||
# self.box.styles,
|
||||
# "opacity",
|
||||
# value=0.0,
|
||||
# duration=2.0,
|
||||
# on_complete=self.box.remove,
|
||||
# )
|
||||
|
||||
async def on_key(self, event: events.Key) -> None:
|
||||
await self.dispatch_key(event)
|
||||
|
||||
Reference in New Issue
Block a user