File size: 1,134 Bytes
5b76e0f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Scrollbar-gutter

The `scrollbar-gutter` rule allows authors to reserve space for the vertical scrollbar.

Setting the value to `stable` prevents unwanted layout changes when the scrollbar becomes visible.

## Syntax

```
scrollbar-gutter: [auto|stable];
```

### Values

| Value            | Description                                      |
|------------------|--------------------------------------------------|
| `auto` (default) | No space is reserved for the vertical scrollbar. |
| `stable`         | Space is reserved for the vertical scrollbar.    |

## Example

In the example below, notice the gap reserved for the scrollbar on the right side of the
terminal window.

=== "scrollbar_gutter.py"

    ```python
    --8<-- "docs/examples/styles/scrollbar_gutter.py"
    ```

=== "scrollbar_gutter.css"

    ```scss
    --8<-- "docs/examples/styles/scrollbar_gutter.css"
    ```

=== "Output"

    ```{.textual path="docs/examples/styles/scrollbar_gutter.py"}
    ```

## CSS

```sass
/* Reserve space for vertical scrollbar */
scrollbar-gutter: stable;
```

## Python

```python
self.styles.scrollbar_gutter = "stable"
```