Replies: 1 comment 3 replies
-
If it helps, titles are processed for Rich markup: from textual.app import App, ComposeResult
from textual.containers import Container
from textual.widgets import Header, Footer
class BorderColourApp( App[ None ] ):
CSS = """
Screen {
align: center middle;
}
Container {
border: round red;
width: 40%;
height: 40%;
}
"""
def compose( self ) -> ComposeResult:
yield Header()
yield Container()
yield Footer()
def on_mount( self ):
self.query_one( Container ).border_title = "[green]This isn't red![/]"
self.query_one( Container ).border_subtitle = "[blue]Neither is this![/]"
if __name__ == "__main__":
BorderColourApp().run() |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be nice to be able to set the border (sub)title colors separately from the border color.
For example, a border could be colorized with
$primary
and the title(s) could be colorized with$secondary
.Maybe this could be
border-title-color: <color>
etc. in the CSS?Beta Was this translation helpful? Give feedback.
All reactions