Skip to content

Commit

Permalink
fix nav-chapter buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
0x70b1a5 committed Feb 8, 2024
1 parent 4b32cd1 commit 52325ed
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ edit-url-template = "https://github.com/uqbar-dao/kinode-book/edit/main/{path}"

[output.html.fold]
enable = true
level = 0
level = 1
5 changes: 4 additions & 1 deletion theme/book.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,10 @@ function playground_text(playground, hidden = true) {
themePopup.querySelectorAll('.theme-selected').forEach(function (el) {
el.classList.remove('theme-selected');
});
themePopup.querySelector("button#" + get_theme()).classList.add('theme-selected');
const theme = themePopup.querySelector("button#" + get_theme())
if (theme && theme.classList) {
theme.classList.add('theme-selected');
}
}

function hideThemes() {
Expand Down
12 changes: 10 additions & 2 deletions theme/css/chrome.css
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ a > .hljs {
flex-direction: column;

transition: color 0.5s, background-color 0.5s;

margin: calc(6 * var(--page-padding)) var(--page-padding);
border-radius: var(--page-padding);
}

.nav-chapters:hover {
Expand Down Expand Up @@ -561,11 +564,11 @@ ul#searchresults span.teaser em {
opacity: 0.68;
position: absolute;
left: -2em;
color: var(--links);
color: var(--sidebar-fg);
}

.chapter li > a.toggle div {
transition: transform 0.5s;
transition: all 0.5s;
}

/* collapse the section */
Expand All @@ -581,6 +584,7 @@ ul#searchresults span.teaser em {

.chapter li.expanded > a.toggle div {
transform: rotate(90deg);
color: var(--links);
}

.spacer {
Expand Down Expand Up @@ -667,4 +671,8 @@ ul#searchresults span.teaser em {
h1 {
font-size: 3em;
}

.nav-chapters {
margin: 0;
}
}
10 changes: 5 additions & 5 deletions theme/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

<link rel="icon" href="{{ path_to_root }}favicon.svg">
<link rel="shortcut icon" href="{{ path_to_root }}favicon.png">
<link rel="stylesheet" href="{{ path_to_root }}css/variables.css?ver=2">
<link rel="stylesheet" href="{{ path_to_root }}css/general.css?ver=2">
<link rel="stylesheet" href="{{ path_to_root }}css/chrome.css?ver=2">
<link rel="stylesheet" href="{{ path_to_root }}css/variables.css?ver=3">
<link rel="stylesheet" href="{{ path_to_root }}css/general.css?ver=3">
<link rel="stylesheet" href="{{ path_to_root }}css/chrome.css?ver=3">
{{#if print_enable}}
<link rel="stylesheet" href="{{ path_to_root }}css/print.css" media="print">
{{/if}}
Expand Down Expand Up @@ -315,8 +315,8 @@
{{/if}}

<script src="{{ path_to_root }}clipboard.min.js"></script>
<script src="{{ path_to_root }}highlight.js"></script>
<script src="{{ path_to_root }}book.js"></script>
<script src="{{ path_to_root }}highlight.js?ver=3"></script>
<script src="{{ path_to_root }}book.js?ver=3"></script>

<!-- Custom JS scripts -->
{{#each additional_js}}
Expand Down

0 comments on commit 52325ed

Please sign in to comment.