textual/docs/examples/guide/css/nesting02.py
Will McGugan b2fe0a76c2
nested (#3946)
* nested

* remove debug

* patch scope

* fix nested

* docs

* clarification

* docstring

* fix test

* remove debug

* copy

* fix example

* wording

* Apply suggestions from code review

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
Co-authored-by: Dave Pearson <davep@davep.org>

* highlighting

* wording

* wording

* check errors

* type checking:

* extra errors

* extra test [skip ci]

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
Co-authored-by: Dave Pearson <davep@davep.org>
2024-01-04 15:07:43 +00:00

19 lines
479 B
Python

from textual.app import App, ComposeResult
from textual.containers import Horizontal
from textual.widgets import Static
class NestingDemo(App):
"""App with nested CSS."""
CSS_PATH = "nesting02.tcss"
def compose(self) -> ComposeResult:
with Horizontal(id="questions"):
yield Static("Yes", classes="button affirmative")
yield Static("No", classes="button negative")
if __name__ == "__main__":
app = NestingDemo()
app.run()