Replies: 1 comment 3 replies
-
Can you provide a code example to show what you mean? For example, this code: from textual.app import App, ComposeResult
class ExampleApp(App):
CSS = """
Screen{
background: Red;
}
"""
if __name__ == "__main__":
ExampleApp().run() Results in this error message:
|
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
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, when setting colors in Textual, the color name must be provided in uppercase to be recognised. While using a lowercase color name (eg.
"red"
) results in an error.Some solutions I would suggest is:
"red"
,"Red"
and"RED"
would result in the same color.ColorParseError
exception. So when an unrecognized color string is provided, the error message could check if it a lowercase version of the color matches a known uppercase color and suggests it.For example instead of
ColorParseError: "'red' is not a valid color"
we could haveColorParseError: "'red' is not a valid color. Did you mean 'Red'"
This small improvement would make working with the amasing system of Textual even smoother. Thank you so much.
Beta Was this translation helpful? Give feedback.
All reactions