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

user-selectable theme toggle button missing? #492

Closed
havok2063 opened this issue Jan 31, 2024 · 3 comments
Closed

user-selectable theme toggle button missing? #492

havok2063 opened this issue Jan 31, 2024 · 3 comments

Comments

@havok2063
Copy link
Collaborator

The server setting '--theme-variant-user-selectable` is default set to True. However I don't see a user input button to toggle between light/dark themes loaded anywhere on the page. Do I need to add an explicit component to get it to show up?

import solara

@solara.component
def Page():
    with solara.Sidebar():
        solara.Info('side info')
    with solara.Column():
        solara.Info('Main Area')

I do see this button in the solara jinja template though.

                <v-list-item v-if="theme.variant_user_selectable">
                    <v-btn-toggle v-model="themeVariantIndex" tile group mandatory>
                        <v-btn value="light" icon>
                            <v-icon>mdi-white-balance-sunny</v-icon>
                        </v-btn>
                        <v-btn>
                            <v-icon>mdi-weather-night</v-icon>
                        </v-btn>
                        <v-btn>
                            <v-icon>mdi-theme-light-dark</v-icon>
                        </v-btn>
                    </v-btn-toggle>
                </v-list-item>
@iisakkirotko
Copy link
Collaborator

Hey!

I think the menu never shows up because the activator isn't defined.

That said, we are working on a feature that should add theme selecting in #494

@havok2063
Copy link
Collaborator Author

oh yeah I see now the activator is commented out. Great, I will take a look at the PR.

@maartenbreddels
Copy link
Contributor

Hi Brian,

From version 1.28 you can indeed now add this component, see https://solara.dev/docs/changelog and https://solara.dev/apps/scatter

Hope this is sufficient for your needs and we can close the issue. Otherwise feel free to re-open.

Regards,

Maarten

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

3 participants