Skip to content

Comments

feat: Use bslib's navbar Sass variables, if present#2847

Merged
jayhesselberth merged 3 commits intor-lib:mainfrom
gadenbuie:feat/use-bslib-navbar-sass-vars
Jan 29, 2025
Merged

feat: Use bslib's navbar Sass variables, if present#2847
jayhesselberth merged 3 commits intor-lib:mainfrom
gadenbuie:feat/use-bslib-navbar-sass-vars

Conversation

@gadenbuie
Copy link
Contributor

@gadenbuie gadenbuie commented Jan 28, 2025

bslib patches Bootstrap to add three Sass variables: $navbar-bg, $navbar-light-bg and $navbar-dark-bg (see e.g. bslib's Boostrap 5 _variables.scss file).

This PR updates pkgdown's Sass so that $pkgdown-navbar-bg and $pkgdown-navbar-bg-dark inherit the (default) values from bslib so that the same Sass variables can be used in Shiny, Quarto and pkgdown.

This change shouldn't affect anyone who is already using the pkgdown Sass variables as these will take precedence over bslib's navbar bg vars.

Fixes #2703

@jayhesselberth
Copy link
Collaborator

Could you add a news bullet? THanks

@gadenbuie
Copy link
Contributor Author

gadenbuie commented Jan 29, 2025

Could you add a news bullet? THanks

Sure! I also updated the documentation in the customise article to

  1. Inform that navbar.bg and navbar.type only take effect when template.light-switch: false.
  2. Describe the available Sass variables for selecting navbar background colors when template.light-switch: true.

@remlapmot
Copy link
Contributor

This is great - this pretty much closes my request in issue #2703, so you might like to add that as a linked issue.

@jayhesselberth jayhesselberth merged commit 18cca45 into r-lib:main Jan 29, 2025
16 checks passed
@jayhesselberth
Copy link
Collaborator

Thanks!

@gadenbuie gadenbuie deleted the feat/use-bslib-navbar-sass-vars branch January 29, 2025 16:19
Bisaloo added a commit to epiverse-trace/epiversetheme that referenced this pull request Jan 30, 2025
Bisaloo added a commit to epiverse-trace/epiversetheme that referenced this pull request Apr 28, 2025
Bisaloo added a commit to epiverse-trace/epiversetheme that referenced this pull request Apr 28, 2025
Bisaloo added a commit to epiverse-trace/epiversetheme that referenced this pull request Apr 28, 2025
Bisaloo added a commit to epiverse-trace/epiversetheme that referenced this pull request Apr 28, 2025
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.

Consider documenting pkgdown-navbar-bg and pkgdown-navbar-bg-dark as needed to set navbar color with a bootswatch theme with light-switch enabled

3 participants