diff --git a/sandbox/basic.css b/sandbox/basic.css index 16e2220e4..3f78e4bca 100644 --- a/sandbox/basic.css +++ b/sandbox/basic.css @@ -40,7 +40,7 @@ App > Screen { background: $primary-darken-2; color: $text-primary-darken-2 ; border-right: outer $primary-darken-3; - content-align: center middle; + content-align: center middle; } #sidebar .user { @@ -168,7 +168,7 @@ OptionItem { height: 3; background: $primary; border-right: outer $primary-darken-2; - border-left: hidden; + border-left: blank; content-align: center middle; } @@ -223,4 +223,4 @@ Success { .horizontal { layout: horizontal -} \ No newline at end of file +} diff --git a/sandbox/horizontal.css b/sandbox/horizontal.css index 7e2f78dcc..1980ad5f4 100644 --- a/sandbox/horizontal.css +++ b/sandbox/horizontal.css @@ -7,12 +7,14 @@ Horizontal { .test { width: auto; height: auto; - + height: 5; background: white 50%; - border:solid green; + /* border:solid green; */ + border-right: outer green; + border-left: outer blue; padding: 0; margin:3; align: center middle; - box-sizing: content-box; -} \ No newline at end of file + box-sizing: border-box; +} diff --git a/src/textual/_border.py b/src/textual/_border.py index 9f060a45d..b720fd5ff 100644 --- a/src/textual/_border.py +++ b/src/textual/_border.py @@ -22,7 +22,7 @@ OUTER = 2 BORDER_CHARS: dict[EdgeType, tuple[str, str, str]] = { # Each string of the tuple represents a sub-tuple itself: - # - 1st string represents `(top1, top2, top3)` + # - 1st string represents (top1, top2, top3) # - 2nd string represents (mid1, mid2, mid3) # - 3rd string represents (bottom1, bottom2, bottom3) "": (" ", " ", " "), @@ -128,7 +128,7 @@ class Border: This is analogous to Rich's `Box` but more flexible. Different borders may be applied to each of the four edges, and more advanced borders can be achieved through - varions combinations of Widget and parent background colors. + various combinations of Widget and parent background colors. """ @@ -150,12 +150,8 @@ class Border: (bottom, bottom_color), (left, left_color), ) = edge_styles - self._sides: tuple[EdgeType, EdgeType, EdgeType, EdgeType] = ( - top or "none", - right or "none", - bottom or "none", - left or "none", - ) + self._sides: tuple[EdgeType, EdgeType, EdgeType, EdgeType] + self._sides = (top, right, bottom, left) from_color = Style.from_color self._styles = ( @@ -204,6 +200,7 @@ class Border: def __rich_console__( self, console: "Console", options: "ConsoleOptions" ) -> "RenderResult": + top, right, bottom, left = self._sides style = console.get_style(self.inner_style) outer_style = console.get_style(self.outer_style)