mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Border style (#2292)
* border styles * docs for border styles * fix tests * tests * tests and docs * changelog * implement auto * style information fix
This commit is contained in:
16
docs/examples/styles/border_title_colors.css
Normal file
16
docs/examples/styles/border_title_colors.css
Normal file
@@ -0,0 +1,16 @@
|
||||
Screen {
|
||||
align: center middle;
|
||||
}
|
||||
|
||||
Label {
|
||||
padding: 4 8;
|
||||
border: heavy red;
|
||||
|
||||
border-title-color: green;
|
||||
border-title-background: white;
|
||||
border-title-style: bold;
|
||||
|
||||
border-subtitle-color: magenta;
|
||||
border-subtitle-background: yellow;
|
||||
border-subtitle-style: italic;
|
||||
}
|
||||
19
docs/examples/styles/border_title_colors.py
Normal file
19
docs/examples/styles/border_title_colors.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.widgets import Label
|
||||
|
||||
|
||||
class BorderTitleApp(App):
|
||||
CSS_PATH = "border_title_colors.css"
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Label("Hello, World!")
|
||||
|
||||
def on_mount(self) -> None:
|
||||
label = self.query_one(Label)
|
||||
label.border_title = "Textual Rocks"
|
||||
label.border_subtitle = "Textual Rocks"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = BorderTitleApp()
|
||||
app.run()
|
||||
Reference in New Issue
Block a user