From 39665fb11065e7c53661e6cb9c4abe4447431765 Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Fri, 26 Aug 2022 16:19:05 +0100 Subject: [PATCH] Help text for text align --- src/textual/css/_help_text.py | 28 +++++++--------------------- src/textual/css/_styles_builder.py | 2 +- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/src/textual/css/_help_text.py b/src/textual/css/_help_text.py index 70d36e28e..2dc87dd1b 100644 --- a/src/textual/css/_help_text.py +++ b/src/textual/css/_help_text.py @@ -9,7 +9,6 @@ from textual.css._help_renderables import Example, Bullet, HelpText from textual.css.constants import ( VALID_BORDER, VALID_LAYOUT, - VALID_EDGE, VALID_ALIGN_HORIZONTAL, VALID_ALIGN_VERTICAL, VALID_STYLE_FLAGS, @@ -649,7 +648,7 @@ def align_help_text() -> HelpText: ) -def text_align_help_text(context: str) -> HelpText: +def text_align_help_text() -> HelpText: """Help text to show when the user supplies an invalid value for the text-align property Returns: @@ -658,26 +657,13 @@ def text_align_help_text(context: str) -> HelpText: return HelpText( summary="Invalid value for the [i]text-align[/] property.", bullets=[ - *ContextSpecificBullets( - css=[ - Bullet( - f"The [i]text-align[/] property must be one of {friendly_list(VALID_TEXT_ALIGN)}", - examples=[ - Example("text-align: center;"), - Example("text-align: right;"), - ], - ) + Bullet( + f"The [i]text-align[/] property must be one of {friendly_list(VALID_TEXT_ALIGN)}", + examples=[ + Example("text-align: center;"), + Example("text-align: right;"), ], - inline=[ - Bullet( - f"The [i]text_align[/] property must be one of {friendly_list(VALID_TEXT_ALIGN)}", - examples=[ - Example("widget.styles.text_align = 'center'"), - Example("widget.styles.text_align = 'right'"), - ], - ) - ], - ).get_by_context(context) + ) ], ) diff --git a/src/textual/css/_styles_builder.py b/src/textual/css/_styles_builder.py index 9973e8f36..f94b966b6 100644 --- a/src/textual/css/_styles_builder.py +++ b/src/textual/css/_styles_builder.py @@ -629,7 +629,7 @@ class StylesBuilder: self.error( name, tokens[0], - text_align_help_text("css"), + text_align_help_text(), ) self.styles._rules["text_align"] = tokens[0].value