-
-
Notifications
You must be signed in to change notification settings - Fork 993
Closed
Labels
Description
Given this code:
from textual import __version__
from textual.app import App, ComposeResult
from textual.widgets import Static
class BrokenClassesApp(App[None]):
CSS = """
Screen {
align: center middle;
}
Static {
width: 50%;
height: 50%;
border: solid;
}
Screen.go-red Static {
background: red;
}
"""
def compose(self) -> ComposeResult:
yield Static(f"This should have a red background\n\nTextual {__version__}")
def on_mount(self) -> None:
self.screen.set_class(True, "go-red")
if __name__ == "__main__":
BrokenClassesApp().run()
in Textual 0.44.x the result was as I'd expect:
but as of 0.45 it seems the class no longer applies:
Flagging @willmcgugan for triage as this seems like an unintended consequence of some of the CSS performance tweaks.