Values sections added to CSS properties docs

This commit is contained in:
Darren Burns
2022-08-30 11:49:11 +01:00
parent db216d1535
commit 92f15abc42
13 changed files with 121 additions and 99 deletions

View File

@@ -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;
}

View File

@@ -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)