Skip to content

Border-subtitle-style

The border-subtitle-style style sets the text style of the border_subtitle.

Syntax

border-subtitle-style: <text-style>;

Example

The following examples demonstrates customization of the border color and text style rules.

BorderTitleApp  Textual Rocks ━━━━━━━━━━━━━ Hello, World! ━━━━━━━━━━━━━ Textual Rocks 

from textual.app import App, ComposeResult
from textual.widgets import Label


class BorderTitleApp(App):
    CSS_PATH = "border_title_colors.tcss"

    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()
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;
}

CSS

border-subtitle-style: bold underline;

Python

widget.styles.border_subtitle_style = "bold underline"

See also