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 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
203 changes: 203 additions & 0 deletions assets/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -508,3 +508,206 @@ 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;
}

/* pydata-sphinx-theme light and dark mode theme color settings */
html[data-theme="light"] {
--pst-color-primary: rgb(114, 83, 237);
--pst-color-text-base: rgb(51, 51, 51);
--pst-color-secondary: rgb(227, 46, 0);
--pst-table-background-color: transparent;
}


html[data-theme="dark"] {
--pst-color-primary: rgb(114, 83, 237);
--pst-color-inline-code: rgb(248, 6, 204);
--pst-table-background-color: var(--pst-color-text-muted);
}

div.cell_output table{
background: var(--pst-table-background-color);
}


/*
* libcudf doxygen rules start
*
*/

/* sm-dox is the CSS class Doxygen uses for the main navigation menu bar */
.sm-dox {
background-image:none; /* override Doxygen background images */
background-color: #7306ff; /* rapids.ai menu background purple */
}

/* Menu links */
.sm-dox a,
.sm-dox a:focus,
.sm-dox a:hover,
.sm-dox a:active,
.sm-dox a.highlighted {
background-image:none; /* override Doxygen background images */
color: white; /* rapids.ai menu white font */
font-family:"Open Sans",sans-serif; /* rapids.ai menu font family */
/* rapids.ai uppercase menus, no decoration or shadows, 1em size */
text-decoration: none;
text-transform: uppercase;
text-shadow: none;
font-weight: normal;
font-size: 1em;
}

.sm-dox a:hover {
background-image:none; /* override Doxygen background images */
color: #a785e7; /* rapids.ai menu text hover color */
-webkit-transition: all 0.3s ease-in-out; /* rapids.ai menu fade when hover */
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}

/* These are the triangles to the right of menus that open up. Make them match the font/fade */
.sm-dox a span.sub-arrow {
border-top-color: white;
}

.sm-dox a:hover span.sub-arrow {
border-top-color: #a785e7; /* rapids.ai menu text hover color */
-webkit-transition: all 0.3s ease-in-out; /* rapids.ai menu fade when hover */
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}

/* sm-dox ul is the drop-down menus that appear when you mouse over hierarchical menus.
Make these white but highlight hovered items with rapids purple background and white text. */
.sm-dox ul a {
font-size: 1em;
}

.sm-dox ul a:hover {
background-image:none;
background-color: #7306ff;
font-size: 1em;
text-shadow: none;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}

/* Sub menu (underneath the main Doxygen bar) is a ul with class navpath that shows
the C++ class hierarchy.
*/
.navpath ul
{
font-size: 13px; /* Bigger than Doxygen default looks a bit better */
background-image:none; /* Override Doxygen gradient background image */
background-color: #FAF6FF; /* A nearly white RAPIDS purple background */
border-top:none; /* Override Doxygen top border for class hierarchy menu since
it doesn't match the menu above. */
}

/* Note we don't override the background on li tags here because we want to keep the ">"
background images Doxygen uses here as separators */
.navpath li.navelem {
background-color: #FAF6FF; /* A nearly white RAPIDS purple background */
}

/* Add some CSS to make class / function lists nicer in the presence of long templated names */

.directory td.entry {
white-space: normal; /* Allow text wrapping for long class names */
min-width: 512px; /* But don't wrap them too much. */

/* This indent and padding causes any long class names that are wrapped to be indented on
wrapped lines */
text-indent: -65px;
padding-left: 55px;
}

/* Prevent arrows from being negatively indented */
.arrow {
text-indent: 0px;
padding-left: 10px;
}

/* Prevent icons from being negatively indented */
.icona {
text-indent: 0px;
padding-left: 0px;
}

/*
* libcudf doxygen rules end
*
*/

22 changes: 22 additions & 0 deletions assets/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,25 @@ 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) return;
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']
});
});