Files
textual/docs/examples/styles/text_align.py
Dave Pearson 414096233b Make all styles reference examples capable of being run standalone
Also move the declarations of the stylesheets into the app classes.

See #3650
2023-11-08 14:37:01 +00:00

27 lines
718 B
Python

from textual.app import App
from textual.containers import Grid
from textual.widgets import Label
TEXT = (
"I must not fear. Fear is the mind-killer. Fear is the little-death that "
"brings total obliteration. I will face my fear. I will permit it to pass over "
"me and through me."
)
class TextAlign(App):
CSS_PATH = "text_align.tcss"
def compose(self):
yield Grid(
Label("[b]Left aligned[/]\n" + TEXT, id="one"),
Label("[b]Center aligned[/]\n" + TEXT, id="two"),
Label("[b]Right aligned[/]\n" + TEXT, id="three"),
Label("[b]Justified[/]\n" + TEXT, id="four"),
)
if __name__ == "__main__":
app = TextAlign()
app.run()