Closed
Description
Rich theme (and Rich in general) is not being supported with Tabs
widget using v2.0.0
. Also, emojis are not working anymore.
I tried to use from_markup
, but it isn't working:
def on_mount(self) -> None:
self.query_one(Tabs).add_tab(Text.from_markup("[special_red]Special Red Again"))
Error:
AttributeError: 'Text' object has no attribute 'translate'
MRE:
from rich.text import Text
from rich.theme import Theme as RichTheme
from textual.app import App, ComposeResult
from textual.widgets import Tabs
NAMES = [
"[special_red]Special Red",
"[red]Red",
"[yellow]Yellow",
":skull: Skull",
]
class MREApp(App):
def __init__(self):
super().__init__()
theme = RichTheme(
{
"special_red": "#ff5e5e",
}
)
self.console.push_theme(theme)
def compose(self) -> ComposeResult:
yield Tabs(*NAMES)
if __name__ == "__main__":
app = MREApp()
app.run()
Metadata
Metadata
Assignees
Labels
No labels