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

Cosmos style issue with nav_menu #25

Closed
corey-dawson opened this issue Feb 7, 2024 · 3 comments · Fixed by #26
Closed

Cosmos style issue with nav_menu #25

corey-dawson opened this issue Feb 7, 2024 · 3 comments · Fixed by #26

Comments

@corey-dawson
Copy link

corey-dawson commented Feb 7, 2024

Cosmos style has undesirable results when using Python Shiny's nav_menu as seen below. The issue is:

  1. nav_menu ribbon is light gray
  2. nav items color is white (almost cant see)

image of issue

Note that the nav items are there, just very hard to see. Only one item highlights black on hover
image

code to see issue

from shiny import App, Inputs, Outputs, Session, reactive, render, ui
import shinyswatch

app_ui = ui.page_navbar(
    shinyswatch.theme.cosmo(),
    ui.nav_menu(
        "Config",
        ui.nav_panel(
            "Config 1"
        ),
        ui.nav_panel(
            "Config 2"
        ),
    ),
    ui.nav_menu(
        "Results",
        ui.nav_panel(
            "Results 1"
        ),
        ui.nav_panel(
            "Results 2"
        ),        
    )
)

def server(input: Inputs, output: Outputs, session: Session):
    print("do stuff")
    
app = App(app_ui, server)

In addition to any possible fix, can you provide CSS that can be used to overwrite this navbar behavior (only the navbar menu at the top) of the theme for the short-term? I tried overwriting the class .nav with the same background color as the buttons, however, was not successful in getting the full nav bar background color to change. The rest of the theme is spot on for me. Thanks in advance!

.nav {background-color: #373a3c}
@corey-dawson
Copy link
Author

Additionally, using the nav_menu, whether in a page_navbar or in a navset_bar, has troublesome styling with many of the themes

@Rebekah-Chuang
Copy link

Hi I'm having the same issue, the text colors are too bright in most themes.

@schloerke
Copy link
Collaborator

Looks like an upstream fix is coming. Will need to update dependencies once posit-dev/py-shiny#1124 lands

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 a pull request may close this issue.

3 participants