|
@@ -62,6 +62,8 @@ def query(selector: str) -> Query:
|
|
To manipulate elements like the document body, you can use the `ui.query` function.
|
|
To manipulate elements like the document body, you can use the `ui.query` function.
|
|
With the query result you can add classes, styles, and attributes like with every other UI element.
|
|
With the query result you can add classes, styles, and attributes like with every other UI element.
|
|
This can be useful for example to change the background color of the page (e.g. `ui.query('body').classes('bg-green')`).
|
|
This can be useful for example to change the background color of the page (e.g. `ui.query('body').classes('bg-green')`).
|
|
|
|
+
|
|
|
|
+ :param selector: the CSS selector (e.g. "body", "#my-id", ".my-class", "div > p")
|
|
"""
|
|
"""
|
|
for element in get_client().elements.values():
|
|
for element in get_client().elements.values():
|
|
if isinstance(element, Query) and element._props['selector'] == selector:
|
|
if isinstance(element, Query) and element._props['selector'] == selector:
|