Skip to content

Inconsistent treatment of overlapping markup and TCSS #3421

@rodrigogiraoserrao

Description

@rodrigogiraoserrao

I created this issue to track the issue found and explained in #3415 (comment) in its generality.

As it stands, we treat markup and TCSS in inconsistent ways, as we can see below.
The label widget and the label of the checkbox have the same markup and the same TCSS and yet they look different:

Screenshot 2023-09-28 at 13 44 27

It's also arguable whether any of the two options are the correct one.

Code for the app above
from textual.app import App
from textual.widgets import Checkbox, Label


class CheckboxApp(App):
    CSS = """
    Checkbox > .toggle--label, Label {
        color: white;
        text-opacity: 50%;
    }
    """

    def compose(self):
        yield Checkbox("[red bold]This is just[/] some text.")
        yield Label("[red bold]This is just[/] some text.")


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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions