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

[REVIEW] Merge common js & css code #286

Merged
merged 6 commits into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
91 changes: 91 additions & 0 deletions assets/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -508,3 +508,94 @@ are added in post-processing.
}
}
}


/* Mirrors the change in:
* https://github.com/sphinx-doc/sphinx/pull/5976
* which is not showing up in our theme.
*/
.classifier:before {
font-style: normal;
margin: 0.5em;
content: ":";
}

/* Fix for text wrap in sphinx tables:
* https://rackerlabs.github.io/docs-rackspace/tools/rtd-tables.html
*/
@media screen and (min-width: 767px) {

.wy-table-responsive table td {
/* !important prevents the common CSS stylesheets from overriding
this as on RTD they are loaded after this stylesheet */
white-space: normal !important;
}

.wy-table-responsive {
overflow: visible !important;
}
}


table.io-supported-types-table {
text-align: center
}

table.io-supported-types-table thead{
text-align: center !important;
}

:root {

--pst-color-active-navigation: 114, 83, 237;
--pst-color-navbar-link: 77, 77, 77;
--pst-color-navbar-link-hover: var(--pst-color-active-navigation);
--pst-color-navbar-link-active: var(--pst-color-active-navigation);
--pst-color-sidebar-link: 77, 77, 77;
--pst-color-sidebar-link-hover: var(--pst-color-active-navigation);
--pst-color-sidebar-link-active: var(--pst-color-active-navigation);
--pst-color-sidebar-expander-background-hover: 244, 244, 244;
--pst-color-sidebar-caption: 77, 77, 77;
--pst-color-toc-link: 119, 117, 122;
--pst-color-toc-link-hover: var(--pst-color-active-navigation);
--pst-color-toc-link-active: var(--pst-color-active-navigation);

}

/* Used to make special-table scrollable when it overflows */
.special-table-wrapper {
width: 100%;
overflow: auto !important;
}

.special-table td, .special-table th {
border: 1px solid #dee2e6;
}

/* Needed to resolve https://github.com/executablebooks/jupyter-book/issues/1611 */
.output.text_html {
overflow: auto;
}

html[data-theme="light"] {
galipremsagar marked this conversation as resolved.
Show resolved Hide resolved
--pst-color-primary: rgb(19, 6, 84);
--pst-color-text-base: rgb(51, 51, 51);

--pst-color-primary: rgb(19, 6, 84);

--pst-color-link: rgb(0, 91, 129);
galipremsagar marked this conversation as resolved.
Show resolved Hide resolved
--pst-color-secondary: rgb(227, 46, 0);
--pst-table-background-color: transparent;
}


html[data-theme="dark"] {
--pst-color-primary: rgb(221, 221, 221);
galipremsagar marked this conversation as resolved.
Show resolved Hide resolved
--pst-color-inline-code: rgb(248, 6, 204);
--pst-table-background-color: var(--pst-color-text-muted);

}
galipremsagar marked this conversation as resolved.
Show resolved Hide resolved

div.cell_output table{
background: var(--pst-table-background-color);
}
galipremsagar marked this conversation as resolved.
Show resolved Hide resolved
21 changes: 21 additions & 0 deletions assets/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,24 @@ document.addEventListener("click", function(e) {
closeOpenedMenusExcept();
}
});

function update_switch_theme_button() {
current_theme = document.documentElement.dataset.mode;
galipremsagar marked this conversation as resolved.
Show resolved Hide resolved
if (current_theme == "light") {
document.getElementById("theme-switch").title = "Switch to auto theme";
} else if (current_theme == "auto") {
document.getElementById("theme-switch").title = "Switch to dark theme";
} else {
document.getElementById("theme-switch").title = "Switch to light theme";
}
}

$(document).ready(function() {
var observer = new MutationObserver(function(mutations) {
update_switch_theme_button();
})
observer.observe(document.documentElement, {
attributes: true,
attributeFilter: ['data-theme']
});
});