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

Fix BS5 navbar template to get navbar.type: dark to work with bslib 0.6+ #2388

Merged
merged 5 commits into from
Feb 2, 2024
Merged

Conversation

tanho63
Copy link
Contributor

@tanho63 tanho63 commented Dec 21, 2023

Fixes #2387

Bootstrap 5.3 docs suggest that .navbar-dark is now deprecated in favour of using a data attribute data-bs-theme="dark", which seems to facilitate client-side light/dark mode switching.

In contrast to the proposed fix within the issue, this PR adds the new attribute without removing the old class, so as to maintain backwards compat with bslib <0.6

@tanho63 tanho63 changed the title bs5-navbar uses data-bs-theme="dark" instead of navbar-"dark" Fix BS5 navbar template to get navbar.type: dark to work with bslib 0.6+ Dec 21, 2023
@jayhesselberth
Copy link
Collaborator

I think we'd also need to bump the required bslib version to 0.6.1.

This merge will break existing configs.

@tanho63
Copy link
Contributor Author

tanho63 commented Dec 24, 2023

@jayhesselberth I ran a test with this branch + bslib 0.5.1 on https://ffsimulator.ffverse.com with this GHA setup / run

and I believe it works - the additional data-bs-theme attribute seems to have no effect under bslib 0.5, while under bslib 0.6+ the deprecated class seems to have no effect

@cpsievert
Copy link

This feels like the right change to me. And I'm pretty sure @tanho63 is right that the additional attribute will have no effect with earlier versions of bslib/Bootstrap

@jayhesselberth jayhesselberth merged commit 3979e7c into r-lib:main Feb 2, 2024
13 checks passed
@tanho63 tanho63 deleted the patch-1 branch February 2, 2024 16:00
SebKrantz pushed a commit to SebKrantz/pkgdown that referenced this pull request Jun 1, 2024
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.

[bslib 0.6+ / Bootstrap 5.3+] .navbar-dark class ignored and navbar text is now the wrong colour
3 participants