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

Add light/dark mode toggle switch #608

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
template:
bootstrap: 5
light-switch: true
bootswatch: pulse
bslib:
pkgdown-nav-height: 100px
Expand Down Expand Up @@ -31,7 +32,7 @@ navbar:
type: light
structure:
left: [tutorials, explanation, how-to-guides, reference, news, faq]
right: [search, github, twitter, mastodon]
right: [search, github, twitter, mastodon, lightswitch]
components:
tutorials:
text: Tutorials
Expand Down
13 changes: 10 additions & 3 deletions pkgdown/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
}

.navbar {
--bs-primary-rgb: 123, 124, 210;
background: var(--primary-color);
}

.navbar a.dropdown-item:hover {
.navbar a.dropdown-item:hover {
background-color: var(--primary-color);
}

Expand All @@ -17,13 +17,20 @@

.navbar .navbar-nav .nav-item > .nav-link {
color: rgba(255, 255, 255, 0.8);

&:hover {
background-color: var(--primary-color);
color: #fff;
}
}

.navbar .navbar-nav .nav-item .dropdown-menu .dropdown-item {
&.active, &:hover {
background-color: var(--primary-color);
color: #fff;
}
}

.navbar-brand {
--bs-navbar-brand-color: #fff;

Expand Down
Loading