We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ca10ba commit 0c967a5Copy full SHA for 0c967a5
examples/breakpoints.py
@@ -8,14 +8,12 @@
8
A demonstration of how to make an app respond to the dimensions of the terminal.
9
10
Try resizing the terminal, then have a look at the source to see how it works!
11
-
12
-`ctrl+q` to quit.
13
14
"""
15
16
17
class BreakpointApp(App):
18
+ # A breakpoint consists of a width and a class name to set
19
HORIZONTAL_BREAKPOINTS = [
20
(0, "-narrow"),
21
(40, "-normal"),
@@ -24,10 +22,10 @@ class BreakpointApp(App):
24
22
]
25
23
26
CSS = """
27
- Screen {
28
- overflow-y: auto;
+ Screen {
29
Placeholder { padding: 2; }
30
Grid { grid-rows: auto; height: auto; }
+ # Change the styles according to the breakpoint classes
31
&.-narrow {
32
Grid { grid-size: 1; }
33
}
0 commit comments