You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I generally recommend against ANSI themes for reasons I guess you have encountered. Some users have default themes, or even configured themes, that make some color combinations difficult to read. Your app may be illegible if a user has a light theme. And a whole host of other issues.
The 16-color ANSI theme is an archaic holdover from days when that's all monitors could display. It is a terrible color system, and there is good reason why there is nothing like it on desktop or web apps.
My personal opinion is that ANSI themes barely work for CLIs, and are awful for TUIs. You loose way too much.
That said, yes Textual can do better here. And we can make it easier for projects that want to use ANSI themes.
It's not quite as simple as adding an "ansi" option to Textual's color system. Yes, I can replace the color system with ANSI colors, but that won't make everything work in ANSI mode. ANSI doesn't support transparency. Other feature that look good with 16.7 million colors, look terrible with ANSI. Most widgets would need some level of custom CSS. There is already some custom CSS for widgets in ansi mode, but we would need some more work there.
It also might not make everything work perfectly in Vibe. You may still need some additional customization.
An alternative approach would be for Vibe to supply alternative styles for an ANSI mode in addition the default Textual themes. I would do this by adding a class to app, say "-vibe-ansi", then wrapping your ansi rules like this:
That would allow you to toggle between ANSI and truecolor themes with app.set_class(use_ansi, "-vibe-ansi"). That may be the quickest way to get what you are looking for.
There is plenty nuance here. Suggest we also jump on a call for this one.
Activity
TomJGooding commentedon Apr 15, 2026
Textual actually does have an ANSI theme which you can enable with
ansi_color. Unfortunately since ANSI themes aren't recommended, this isn't well-documented and definitely has some bugs.willmcgugan commentedon Apr 16, 2026
I generally recommend against ANSI themes for reasons I guess you have encountered. Some users have default themes, or even configured themes, that make some color combinations difficult to read. Your app may be illegible if a user has a light theme. And a whole host of other issues.
The 16-color ANSI theme is an archaic holdover from days when that's all monitors could display. It is a terrible color system, and there is good reason why there is nothing like it on desktop or web apps.
My personal opinion is that ANSI themes barely work for CLIs, and are awful for TUIs. You loose way too much.
That said, yes Textual can do better here. And we can make it easier for projects that want to use ANSI themes.
It's not quite as simple as adding an "ansi" option to Textual's color system. Yes, I can replace the color system with ANSI colors, but that won't make everything work in ANSI mode. ANSI doesn't support transparency. Other feature that look good with 16.7 million colors, look terrible with ANSI. Most widgets would need some level of custom CSS. There is already some custom CSS for widgets in ansi mode, but we would need some more work there.
It also might not make everything work perfectly in Vibe. You may still need some additional customization.
An alternative approach would be for Vibe to supply alternative styles for an ANSI mode in addition the default Textual themes. I would do this by adding a class to app, say "-vibe-ansi", then wrapping your ansi rules like this:
That would allow you to toggle between ANSI and truecolor themes with
app.set_class(use_ansi, "-vibe-ansi"). That may be the quickest way to get what you are looking for.There is plenty nuance here. Suggest we also jump on a call for this one.
github-actions commentedon Apr 30, 2026
I hope I solved your issue!
Consider sponsoring my work to continue to maintain and develop Textual.