Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow ansi color #5000

Merged
merged 27 commits into from
Sep 17, 2024
Merged

allow ansi color #5000

merged 27 commits into from
Sep 17, 2024

Conversation

willmcgugan
Copy link
Collaborator

@willmcgugan willmcgugan commented Sep 13, 2024

Add a switch to allow ANSI color.

The rationale in https://textual.textualize.io/FAQ/#why-doesnt-textual-support-ansi-themes still stands. But for inline apps, it can be jarring to go full RGB. This PR adds an option to enable ansi colors, at the expense of any features that rely on color manipulation.

  • Adds an :ansi pseudo-selector, which matches when ansi colors are enabled.
  • Some widgets now have an -ansi-color class, so that ansi colors can be selectively applied.
  • Added an -ansi-scrollbar class to widgets, to render the scrollbar with ansi colors (if enabled).

@willmcgugan willmcgugan marked this pull request as draft September 13, 2024 19:37
@willmcgugan willmcgugan marked this pull request as ready for review September 17, 2024 09:35
Copy link
Member

@darrenburns darrenburns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few typos.

Probably worth adding at least a wee admonition (if not more) in the docs about this in the inline section?

docs/FAQ.md Show resolved Hide resolved
docs/FAQ.md Show resolved Hide resolved
questions/why-no-ansi-themes.question.md Outdated Show resolved Hide resolved
@willmcgugan willmcgugan merged commit 6043845 into main Sep 17, 2024
20 checks passed
@willmcgugan willmcgugan deleted the ansi-color branch September 17, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants