Skip to content

Consider ampersand in queries #3512

Open
@willmcgugan

Description

@willmcgugan

It may be nice to add a syntax to queries which refers to the current widget.

For instance, if I want to get the immediate child of a widget, I could do this:

self.query("& > Child")

Currently that's rather awkward to implement.

We can also extend this to the CSS itself. i.e. ini a CSS or DEFAULT_CSS. For instance the following would style the widget without the need to specify its type again:

DEFAULT_CSS = """
& { border: heavy red}
"""

Currently, you have to do this:

DEFAULT_CSS = """
MyWidget { border: heavy red}
"""

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions