changed to CSS_PATH

This commit is contained in:
Will McGugan
2022-09-18 22:02:08 +01:00
parent f2c5e6ce78
commit d0293c2c89
80 changed files with 261 additions and 741 deletions

View File

@@ -43,6 +43,6 @@ class ColorApp(App):
self.screen.styles.animate("background", message.color, duration=0.5)
app = ColorApp()
if __name__ == "__main__":
app = ColorApp()
app.run()

View File

@@ -15,6 +15,8 @@ from textual.widgets import Static, TextInput
class DictionaryApp(App):
"""Searches ab dictionary API as-you-type."""
CSS_PATH = "dictionary.css"
def compose(self) -> ComposeResult:
yield TextInput(placeholder="Search for a word")
yield Vertical(Static(id="results", fluid=False), id="results-container")
@@ -38,6 +40,6 @@ class DictionaryApp(App):
self.query_one("#results", Static).update(JSON(results))
app = DictionaryApp(css_path="dictionary.css")
if __name__ == "__main__":
app = DictionaryApp()
app.run()