-
Notifications
You must be signed in to change notification settings - Fork 826
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2128 from Textualize/fix-2063
Fix issues with watching CSS reloading
- Loading branch information
Showing
8 changed files
with
222 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* This file is purposefully empty. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from pathlib import Path | ||
|
||
from textual.app import App, ComposeResult | ||
from textual.containers import Container | ||
from textual.widgets import Label | ||
|
||
|
||
CSS_PATH = (Path(__file__) / "../hot_reloading_app.css").resolve() | ||
|
||
# Write some CSS to the file before the app loads. | ||
# Then, the test will clear all the CSS to see if the | ||
# hot reloading applies the changes correctly. | ||
CSS_PATH.write_text( | ||
""" | ||
Container { | ||
align: center middle; | ||
} | ||
Label { | ||
border: round $primary; | ||
padding: 3; | ||
} | ||
""" | ||
) | ||
|
||
|
||
class HotReloadingApp(App[None]): | ||
CSS_PATH = CSS_PATH | ||
|
||
def compose(self) -> ComposeResult: | ||
yield Container(Label("Hello, world!")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters