Clarify theming of dropdown in dark mode
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- bootstrap, r, scss
- Domain
- documentation
Research direction
Start by building the example site with and without extra.scss, using the _pkgdown.yml configuration. Compare the generated navbar dropdown behavior with the dropdown-dark-* variables and inspect the linked bslib _variables.scss reference; done means the dark-mode dropdown respects those variables without custom SCSS, or the intended limitation is documented.
Written by the indexing model from the issue text.
Description
For some $dropdown- variables, {bslib} has light and dark mode variants.
When building a pkgdown site with light-switch: true, I expect the navbar dropdowns to respect the dropdown-dark-* variables defined in _pkgdown.yml. Instead, these variables appear to be ignored—dropdowns remain in light mode (no [data-bs-theme="dark"] applied) unless I add custom SCSS rules.
So far, I haven't understood why these variables are being ignored. I would appreciate understanding this and whether this is intended behavior or if we can change it.
The _pkgdown.yml and extra.scss files below can be used to illustrate the issue (colors may be sufficient for the actual purpose but not for real life). Build the site with and without extra.scss.
_pkgdown.yml:
url: ~
template:
light-switch: true
bslib:
version: 5
preset: default
# Make it obvious which mode we are in
body-bg: "#F0ECDA"
body-bg-dark: "#192D3C"
body-color: "#152740"
body-color-dark: "#F0F0F0"
navbar-light-bg: "#487F86"
navbar-dark-bg: "#96AAAA"
# What we care about in this issue
dropdown-link-hover-bg: "#797292"
dropdown-dark-link-hover-bg: "#23857A"
dropdown-link-active-bg: "rgba($dropdown-link-hover-bg, .4)"
dropdown-dark-link-active-bg: "rgba($dropdown-dark-link-hover-bg, .4)"
dropdown-link-active-color: "$body-color"
dropdown-dark-link-active-color: "$body-color-dark"
extra.scss
/*-- scss:rules --*/
[data-bs-theme="dark"] .dropdown-item {
color: $body-color-dark;
&.active, &:active {
background-color: rgba(#C88200,.4);
}
&:hover, &:focus {
background-color: #C88200;
}
}
- Dominant language
- R
- Stars
- 775
- Forks
- 355
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from r-lib/pkgdown
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
r-lib/pkgdepends#485 · 3 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
beginners blocker
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enviPathR OpenBuild Error Build OK Build Warning policies-accepted pre-review precheck-passed
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Bioconductor/BiocContributions#207 · 6 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
datacarpentry/semester-biology#1255 ·