Skip to content

Commit

Permalink
Merge pull request #4171 from TomJGooding/docs-events-add-tcss-to-on-…
Browse files Browse the repository at this point in the history
…decorator-examples

docs(events): add tcss to on decorator examples
  • Loading branch information
willmcgugan authored Feb 16, 2024
2 parents 8007c8f + c680bd7 commit 2b3c71c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/guide/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ In the following example we have three buttons, each of which does something dif

1. The message handler is called when any button is pressed

=== "on_decorator.tcss"

```python title="on_decorator.tcss"
--8<-- "docs/examples/events/on_decorator.tcss"
```

=== "Output"

```{.textual path="docs/examples/events/on_decorator01.py"}
Expand All @@ -233,6 +239,12 @@ The following example uses the decorator approach to write individual message ha
2. Matches the button with class names "toggle" *and* "dark"
3. Matches the button with an id of "quit"

=== "on_decorator.tcss"

```python title="on_decorator.tcss"
--8<-- "docs/examples/events/on_decorator.tcss"
```

=== "Output"

```{.textual path="docs/examples/events/on_decorator02.py"}
Expand Down

0 comments on commit 2b3c71c

Please sign in to comment.