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

New render protocol #5197

Open
wants to merge 49 commits into
base: main
Choose a base branch
from
Open

New render protocol #5197

wants to merge 49 commits into from

Conversation

willmcgugan
Copy link
Collaborator

@willmcgugan willmcgugan commented Oct 29, 2024

This adds a new system for rendering content. Previously Textual uses Rich Renderables.

Now we have a textual.visual.Visual which is a replacement for the renderable protocol, which allows for layered alpha colors via the Content class.

This is backwards compatible in that Textual you can still return a renderable via the render() method, which will be wrapped in a textual.visual.RichVisual class.

This is a large change, but only the OptionList actively uses Visuals currently.

In the future, there will be a Visual markup language, like console markup, but supporting alpha transparency and CSS variables. For instance, you could do this:

return "[$accent on blue %20]Hello, World![/]"

We don't have that yet, and there are still gaps in functionality, so this will remain undocumented for now.

@willmcgugan willmcgugan changed the title WIP new content class New render protocol Nov 13, 2024
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.

1 participant