[bslib 0.6+ / Bootstrap 5.3+] .navbar-dark
class ignored and navbar text is now the wrong colour
#2387
Labels
front end 🌷
General HTML, CSS, and JS issues
Hi! Noticed a regression recently when rebuilding a few of my pkgdown sites - the text for a dark navbar header has regressed to being black text against dark header 🙃
Screenshots
Research
I did some digging and I believe the problem to be related to bslib upgrading to Bootstrap 5.3 as of bslib 0.6.0.
Bootstrap 5.3 docs suggest that
.navbar-dark
is now deprecated in favour of using a data attributedata-bs-theme="dark"
, which seems to facilitate client-side light/dark mode switching.I believe the fix is to update the BS5 navbar template here:
pkgdown/inst/BS5/templates/navbar.html
Lines 1 to 3 in 13d8d62
insteadas well (for backwards-compat with bslib <0.6), e.g.which should then resolve the problem:
Looked briefly at the PR for dark/light mode switching #2338 and I don't believe the proposed fix interferes with it, so I'm also going to go ahead with submitting a PR for expediency (and so I can use that branch as the GHA pkgdown version for my pkgdown sites in the meantime 😀)
Session Info
From recent GHA run here
The text was updated successfully, but these errors were encountered: