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

Add input_dark_mode component #134

Merged
merged 12 commits into from
May 1, 2024
Merged

Add input_dark_mode component #134

merged 12 commits into from
May 1, 2024

Conversation

skaltman
Copy link
Collaborator

No description provided.

@skaltman skaltman marked this pull request as ready for review April 10, 2024 21:18
@skaltman skaltman removed the request for review from gregswinehart April 11, 2024 18:54
@github-actions github-actions bot temporarily deployed to pr-134 April 11, 2024 19:41 Destroyed
Copy link
Collaborator

@gregswinehart gregswinehart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you so much @skaltman

@github-actions github-actions bot temporarily deployed to pr-134 April 11, 2024 22:40 Destroyed
@github-actions github-actions bot temporarily deployed to pr-134 April 11, 2024 22:43 Destroyed
Copy link
Contributor

@gadenbuie gadenbuie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great start, thank you @skaltman!

I do think we should consider adding a variation for the very common use of ui.input_dark_mode() in a ui.page_navbar(). It would be helpful to show the pattern of using ui.nav_spacer() to push the dark mode switch to the right.

If you don't have bandwidth for that at the moment, we can follow up in another PR.

@skaltman
Copy link
Collaborator Author

I do think we should consider adding a variation for the very common use of ui.input_dark_mode() in a ui.page_navbar(). It would be helpful to show the pattern of using ui.nav_spacer() to push the dark mode switch to the right.

I can add this variation! Thanks @gadenbuie

@skaltman
Copy link
Collaborator Author

@gadenbuie I added the navbar variation, but am having trouble getting it to work in Shiny Express. Do you mind writing that code, or pointing me to an example? I'm specifically confused about where to add the ui.nav_spacer() in a Shiny Express app.

@github-actions github-actions bot temporarily deployed to pr-134 April 16, 2024 18:40 Destroyed
@gadenbuie
Copy link
Contributor

@skaltman It turns out I recently added an example that was just released today. The example in ui.page_opts() should give you a good place to start (or you probably could just copy the example from there).

@github-actions github-actions bot temporarily deployed to pr-134 April 17, 2024 17:59 Destroyed
@skaltman
Copy link
Collaborator Author

Thanks for pointing me to that example @gadenbuie. I added the express version of the variation, and this PR is ready for review.

I did notice that the preview version of the variation doesn't show how the spacer pushes the dark mode switch to the right, however, because of the small screen width. Let me know if there's something I should do about that.

@github-actions github-actions bot temporarily deployed to pr-134 April 17, 2024 18:26 Destroyed
@garrettgman
Copy link
Collaborator

@gregswinehart and @gadenbuie just want to doublecheck if there's anything else you need on our end. I can't wait to see this on the site :)

@github-actions github-actions bot temporarily deployed to pr-134 May 1, 2024 19:20 Destroyed
@gadenbuie
Copy link
Contributor

Thanks for the nudge @garrettgman, this fell off my radar.

the preview version of the variation doesn't show how the spacer pushes the dark mode switch to the right

I added a little feature to scale the iframe down a bit (or at least I tried, I have to wait for the preview here to see if it worked).

I also adjusted the examples to use ui.nav_control() instead of ui.nav_panel(). nav_control() adds a button or text to the navbar without creating a linked panel.

@github-actions github-actions bot temporarily deployed to pr-134 May 1, 2024 19:56 Destroyed
@gadenbuie
Copy link
Contributor

It works!
image

Thanks again @skaltman!

@gadenbuie gadenbuie merged commit 6370ac0 into main May 1, 2024
1 check passed
@gadenbuie gadenbuie deleted the input_dark_mode-component branch May 1, 2024 20:18
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.

4 participants