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

Text opacity isn't considered in component classes if color is inherited #3467

Closed
rodrigogiraoserrao opened this issue Oct 5, 2023 · 1 comment · Fixed by #4747
Closed
Labels
bug Something isn't working

Comments

@rodrigogiraoserrao
Copy link
Contributor

As a follow-up to #3415, there are edge cases that aren't handled yet.
When TCSS sets text opacity for a component class associated with the toggle button or the tree and that TCSS doesn't set color, text opacity isn't accounted for:

from textual.app import App, ComposeResult
from textual.widgets import Checkbox


class ComponentClassesOpacity(App[None]):
    CSS = """
    Widget {
        color: white;
    }
    Checkbox > .toggle--label {
        text-opacity: 0%;
    }
    """

    def compose(self) -> ComposeResult:
        yield Checkbox("this should be invisible")


if __name__ == "__main__":
    ComponentClassesOpacity(watch_css=True).run()
@rodrigogiraoserrao rodrigogiraoserrao added the bug Something isn't working label Oct 5, 2023
@rodrigogiraoserrao rodrigogiraoserrao changed the title Text opacity isn't considered in component classes if color isn't defined Text opacity isn't considered in component classes if color is inherited Oct 5, 2023
Copy link

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
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant