mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
added tint and offset
This commit is contained in:
30
docs/styles/offset.md
Normal file
30
docs/styles/offset.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# Offset
|
||||
|
||||
The `offset` rule adds an offset to the widget's position.
|
||||
|
||||
## Example
|
||||
|
||||
=== "offset.py"
|
||||
|
||||
```python
|
||||
--8<-- "docs/examples/styles/offset.py"
|
||||
```
|
||||
|
||||
=== "Output"
|
||||
|
||||
```{.textual path="docs/examples/styles/offset.py"}
|
||||
```
|
||||
|
||||
## CSS
|
||||
|
||||
```sass
|
||||
/* Move the widget 2 cells in the x direction, and 4 in the y direction. */
|
||||
offset: 2 4;
|
||||
```
|
||||
|
||||
## Python
|
||||
|
||||
```python
|
||||
# Move the widget 2 cells in the x direction, and 4 in the y direction.
|
||||
widget.styles.offset = (2, 4)
|
||||
```
|
||||
Reference in New Issue
Block a user