Skip to content

Border-subtitle-color

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

Syntax

border-subtitle-color: (<color> | auto) [<percentage>];

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-color: red;

Python

widget.styles.border_subtitle_color = "red"

See also