Skip to content

Commit

Permalink
feat: add light/dark mode toggle button
Browse files Browse the repository at this point in the history
  • Loading branch information
sankhadeepdutta committed Aug 11, 2024
1 parent 5f54d0c commit ce89e36
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
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
15 changes: 13 additions & 2 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,7 +17,18 @@

.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 {
background-color: var(--primary-color);
color: #fff;
}
&:hover {
background-color: var(--primary-color);
color: #fff;
Expand Down

0 comments on commit ce89e36

Please sign in to comment.