rstudio / rstudio/bslib

Some `bs_theme` arguments are seemingly ignored by `page_sidebar`

Open
#1,123 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
SCSS
Stars
569
Forks
72
Avg merge
1d 2h
Merged PRs (30d)
5

Description

Describe the problem

To be honest this is a null issue as it's fine to just use page_navbar(), but did lose me some time to work around.

Doesn't work:

library(bslib)
ui <- page_sidebar(
    title = "Cool app",
    theme = bs_theme(
        preset = "flatly",
        primary = "#95a5a6",
        success = "#3F2A56"
    ),
    sidebar = sidebar()
)
server <- function(input, output) {}
shinyApp(ui, server)

But page_navbar() works:

library(bslib)
ui <- page_navbar(
    title = "Cool app",
    theme = bs_theme(
        preset = "flatly",
        primary = "#95a5a6",
        success = "#3F2A56"
    ),
    sidebar = sidebar()
)
server <- function(input, output) {}
shinyApp(ui, server)

And other arguments (from the documentation) work with page_sidebar:

library(bslib)
ui <- page_sidebar(
    title = "Cool app",
    theme = bs_theme(
        bootswatch = "darkly",
        base_font = font_google("Inter"),
        navbar_bg = "#25443B"
    ),
    sidebar = sidebar()
)
server <- function(input, output) {}
shinyApp(ui, server)
Session Info

R version 4.4.1
bslib: 0.8.0

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the page_sidebar() and bs_theme() entry points, then compare their behavior with page_navbar() using the examples in the issue. Verify the preset, primary, and success arguments against the working bootswatch, font, and navbar_bg example; done means those arguments visibly affect page_sidebar() as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
bootstrap, r
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.