Skip to content
Discussion options

You must be logged in to vote

For question 1, something like this should do the trick:

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

class SwitchSliderColourApp(App[None]):

    CSS = """
    Switch > .switch--slider {
        color: red;
    }

    Switch.-on > .switch--slider {
        color: yellow;
    }
    """

    def compose(self) -> ComposeResult:
        yield Switch()

if __name__ == "__main__":
    SwitchSliderColourApp().run()

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@jessebot
Comment options

Answer selected by jessebot
Comment options

You must be logged in to vote
3 replies
@jessebot
Comment options

@davep
Comment options

@jessebot
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants