Skip to content

App theme doesn't apply to markup in Static widget #5747

@flisk

Description

@flisk

Between Textual v1.0.0 and v2.0.0, markup in Static widgets stopped using the colors set by the app theme. Here's a simple reproducer:

from textual.app import App, ComposeResult
from textual.widgets import Static


class PrideApp(App):

    def compose(self) -> ComposeResult:
        yield Static("""
        [red]red[/]
        [blue]blue[/]
        [green]green[/]
        """)


if __name__ == "__main__":
    PrideApp().run()

When you compare the results of running this with Textual v1.0.0 and v2.0.0, the text colors will not be consistent with the app theme on v2.0.0 and onwards.

I've bisected this locally with the application this started happening on: the last known good commit was 32a2624, and the first bad one was a745cda. I can't test against 6d3d64d because the code in that commit doesn't run due to a missing module that was only added in the subsequent commit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions