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

Customize style of shiny app module gallery #50

Open
milen-sage opened this issue Sep 12, 2022 · 7 comments
Open

Customize style of shiny app module gallery #50

milen-sage opened this issue Sep 12, 2022 · 7 comments
Labels
enhancement New feature or request

Comments

@milen-sage
Copy link

@rchai has demonstrated how to apply consistent styles across a collection of shiny modules. Let's have the shiny module gallery have a similar customization option.

@andrewelamb andrewelamb transferred this issue from Sage-Bionetworks/projectlive.modules Sep 12, 2022
@andrewelamb andrewelamb self-assigned this Sep 12, 2022
@rrchai
Copy link

rrchai commented Sep 14, 2022

here is the dcamodules.

Note
There is a bug about saving theme_config.rds has not been fixed.

@andrewelamb
Copy link
Collaborator

Thanks @rrchai. I thought this was going to be it's own library?

@andrewelamb
Copy link
Collaborator

@rrchai What is the name of the module I want to use?

@rrchai
Copy link

rrchai commented Sep 14, 2022

@andrewelamb Sorry for the confusion. The styling feature is only a function as part of the dcamodules library for now, i.e put use_dca(theme="sage") in the dashboardBody.

I could make the styling function as a separated package if it's our priority, but would need more time - probably not until next sprint. We might need to think about what the stylings we would need to enable customization for multi-tenant apps.

Alternatively, we could use an existing function - fresh and I could build on the top of fresh to create more customizable stylings if needed.

@andrewelamb
Copy link
Collaborator

@rrchai It's ok for now.

What options are currently available for the theme argument?

@rrchai
Copy link

rrchai commented Sep 14, 2022

For now, it has three predefined themes, c(default", "sage", "htan").

There are also variables listed in this doc available for you to customize:

custom_theme <- list(
    "primary" = "blue",
    "accent" = "red",
    "dark" = NULL,
    "light" = NULL,
    "success" = NULL,
    "info" = NULL,
    "warning" = NULL,
    "danger" = NULL,
    "white" = NULL,
    "black" = NULL,
    "font" = NULL,
    "link-font-cl" = NULL,
    "content-bg-cl" = NULL,
    "content-font-cl" = NULL,
    "header-bg-cl" = NULL,
    "header-font-cl" = NULL,
    "sidebar-bg-cl" = NULL,
    "sidebar-font-cl" = NULL,
    "sidebar-bg-select-cl" = NULL,
    "sidebar-font-select-cl" = NULL,
    "sidebar-bg-hover-cl" = NULL,
    "sidebar-font-hover-cl" = NULL,
    "footer-bg-cl" = NULL,
    "footer-font-cl" = NULL,
    "waiter-bg-cl" = NULL,
    "waiter-font-cl" = NULL
  )

You could manually change ones of variables and save as rds. Then, use use_dca(theme=<path-to-rds>) to change styles. Another way is to use showcase() to define color in live, but it's working due to a bug.

It's still under development. Please feel free to let me know if there are any issues or improvements!

@andrewelamb
Copy link
Collaborator

I'm having an issue installing dcamodules.

@andrewelamb andrewelamb removed their assignment Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants