Skip to content

ToastRack positioning not working #6382

@WuerfelDev

Description

@WuerfelDev

ToastRack positioning does not seem to work. Like suggested in the docs I've added ToastRack { align: right top; } in my CSS. Below I've added it to the Toast example. But the ToastRack stays in its default bottom right position and the changed CSS does not seem to apply.

Code
#!/usr/bin/env python3
from textual.app import App

class ToastApp(App[None]):
    CSS = """
        ToastRack {
            align: right top;
        }
    """

    def on_mount(self) -> None:
        # Show an information notification.
        self.notify("It's an older code, sir, but it checks out.")

        # Show a warning. Note that Textual's notification system allows
        # for the use of Rich console markup.
        self.notify(
            "Now witness the firepower of this fully "
            "[b]ARMED[/b] and [i][b]OPERATIONAL[/b][/i] battle station!",
            title="Possible trap detected",
            severity="warning",
        )

        # Show an error. Set a longer timeout so it's noticed.
        self.notify("It's a trap!", severity="error", timeout=10)

        # Show an information notification, but without any sort of title.
        self.notify("It's against my programming to impersonate a deity.", title="")

if __name__ == "__main__":
    ToastApp().run()
Image

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