The bug
Trying to use a TextAreaTheme with a base_style doesn't seem to work, TextArea._set_theme() seems to expect that a Style object has a color attribute which isn't the case.
Either it should be a RichStyle or maybe it wants to use base_style.foreground?
from textual.app import App, ComposeResult
from textual.style import Style
from textual.widgets import TextArea
from textual.widgets.text_area import TextAreaTheme
class MyTextArea(TextArea):
MY_THEME = TextAreaTheme(name="mytheme", base_style=Style("white", "default"))
def on_mount(self) -> None:
self.register_theme(self.MY_THEME)
self.theme = "mytheme"
class MyTUI(App):
def compose(self) -> ComposeResult:
yield MyTextArea()
if __name__ == "__main__":
MyTUI().run()
->
.../tester.py:11 in on_mount
AttributeError: 'Style' object has no attribute 'color'
The bug
Trying to use a
TextAreaThemewith abase_styledoesn't seem to work,TextArea._set_theme()seems to expect that a Style object has acolorattribute which isn't the case.Either it should be a RichStyle or maybe it wants to use
base_style.foreground?->