Add example with all border types.

This commit is contained in:
Rodrigo Girão Serrão
2022-12-15 16:15:30 +00:00
parent 3a83c26779
commit e70f271afc
2 changed files with 97 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
#ascii {
border: ascii $accent;
}
#blank {
border: blank $accent;
}
#dashed {
border: dashed $accent;
}
#double {
border: double $accent;
}
#heavy {
border: heavy $accent;
}
#hidden {
border: hidden $accent;
}
#hkey {
border: hkey $accent;
}
#inner {
border: inner $accent;
}
#none {
border: none $accent;
}
#outer {
border: outer $accent;
}
#round {
border: round $accent;
}
#solid {
border: solid $accent;
}
#tall {
border: tall $accent;
}
#vkey {
border: vkey $accent;
}
#wide {
border: wide $accent;
}
Grid {
grid-size: 3 5;
align: center middle;
grid-gutter: 1 2;
}
Label {
width: 20;
height: 3;
content-align: center middle;
}

View File

@@ -0,0 +1,26 @@
from textual.app import App
from textual.containers import Grid
from textual.widgets import Label
class AllBordersApp(App):
def compose(self):
yield Grid(
Label("ascii", id="ascii"),
Label("blank", id="blank"),
Label("dashed", id="dashed"),
Label("double", id="double"),
Label("heavy", id="heavy"),
Label("hidden/none", id="hidden"),
Label("hkey", id="hkey"),
Label("inner", id="inner"),
Label("none", id="none"),
Label("outer", id="outer"),
Label("round", id="round"),
Label("solid", id="solid"),
Label("tall", id="tall"),
Label("vkey", id="vkey"),
Label("wide", id="wide"),
)
app = AllBordersApp(css_path="border_all.css")