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

Style(bgcolor="$success") results in an exception, same with Text("value", "bgcolor: $success") #4608

Closed
arcivanov opened this issue Jun 5, 2024 · 3 comments

Comments

@arcivanov
Copy link

Is it possible to use common variables in constructed Styles and Texts?

@darrenburns
Copy link
Member

No - those are Rich objects and are unaware of Textual CSS.

You could grab the values from the variables like this:

self.app.get_css_variables()

Although internally in Textual we generally use component classes when bridging from Textual CSS to Rich objects.

@Textualize Textualize deleted a comment from github-actions bot Jun 5, 2024
@arcivanov
Copy link
Author

Thank you!

Copy link

github-actions bot commented Jun 6, 2024

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

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

No branches or pull requests

2 participants