mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Merge branch 'css' into docs-intro
This commit is contained in:
20
docs/examples/styles/content_align.css
Normal file
20
docs/examples/styles/content_align.css
Normal file
@@ -0,0 +1,20 @@
|
||||
#box1 {
|
||||
content-align: left top;
|
||||
background: red;
|
||||
}
|
||||
|
||||
#box2 {
|
||||
content-align: center middle;
|
||||
background: green;
|
||||
}
|
||||
|
||||
#box3 {
|
||||
content-align: right bottom;
|
||||
background: blue;
|
||||
}
|
||||
|
||||
Static {
|
||||
height: 1fr;
|
||||
padding: 1;
|
||||
color: white;
|
||||
}
|
||||
13
docs/examples/styles/content_align.py
Normal file
13
docs/examples/styles/content_align.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from textual.app import App
|
||||
from textual.widgets import Static
|
||||
|
||||
|
||||
class ContentAlignApp(App):
|
||||
def compose(self):
|
||||
yield Static("With [i]content-align[/] you can...", id="box1")
|
||||
yield Static("...[b]Easily align content[/]...", id="box2")
|
||||
yield Static("...Horizontally [i]and[/] vertically!", id="box3")
|
||||
|
||||
|
||||
app = ContentAlignApp(css_path="content_align.css")
|
||||
app.run()
|
||||
8
docs/examples/styles/scrollbar_gutter.css
Normal file
8
docs/examples/styles/scrollbar_gutter.css
Normal file
@@ -0,0 +1,8 @@
|
||||
Screen {
|
||||
scrollbar-gutter: stable;
|
||||
}
|
||||
|
||||
#text-box {
|
||||
color: floralwhite;
|
||||
background: darkmagenta;
|
||||
}
|
||||
18
docs/examples/styles/scrollbar_gutter.py
Normal file
18
docs/examples/styles/scrollbar_gutter.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from textual.app import App
|
||||
from textual.widgets import Static
|
||||
|
||||
TEXT = """I must not fear.
|
||||
Fear is the mind-killer.
|
||||
Fear is the little-death that brings total obliteration.
|
||||
I will face my fear.
|
||||
I will permit it to pass over me and through me.
|
||||
And when it has gone past, I will turn the inner eye to see its path.
|
||||
Where the fear has gone there will be nothing. Only I will remain."""
|
||||
|
||||
|
||||
class ScrollbarGutterApp(App):
|
||||
def compose(self):
|
||||
yield Static(TEXT, id="text-box")
|
||||
|
||||
|
||||
app = ScrollbarGutterApp(css_path="scrollbar_gutter.css")
|
||||
Reference in New Issue
Block a user