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

[Doc] Theme revamp: styling changes #42231

Merged
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
2 changes: 2 additions & 0 deletions doc/source/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ html[data-theme='dark'] {
--pst-color-text-muted: #b3b9c4;
--heading-color: #ffffff;
--base-pygments-code-color: #cccccc;
--pst-color-link-hover: #cce0ff;
}

html[data-theme='light'] {
Expand All @@ -33,6 +34,7 @@ html[data-theme='light'] {
--pst-color-text-muted: #454f59;
--heading-color: #161a1d;
--base-pygments-code-color: #cccccc;
--pst-color-link-hover: #09326c;
}

nav.bd-links li > a:hover {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

.tab-pane pre {
margin: 0;
padding: 0;
padding: 0.5em 1em;
peytondmurray marked this conversation as resolved.
Show resolved Hide resolved
max-height: 252px;
overflow-y: auto;
animation: fadeEffect 1s; /* Fading effect takes 1 second */
Expand Down
52 changes: 52 additions & 0 deletions doc/source/_static/js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
function animateTabs() {
const tabs = Array.from(document.getElementById('v-pills-tab').children);
const contentTabs = Array.from(
document.getElementById('v-pills-tabContent').children,
);

tabs.forEach((item, index) => {
item.onclick = () => {
tabs.forEach((tab, i) => {
if (i === index) {
item.classList.add('active');
} else {
tab.classList.remove('active');
}
});
contentTabs.forEach((tab, i) => {
if (i === index) {
tab.classList.add('active', 'show');
} else {
tab.classList.remove('active', 'show');
}
});
};
});
}

function updateHighlight() {
const {theme} = document.documentElement.dataset;
['dark', 'light'].forEach((title) => {
const stylesheet = document.querySelector(`link[title="${title}"]`);
if (title === theme) {
stylesheet.removeAttribute('disabled');
} else {
stylesheet.setAttribute('disabled', 'disabled');
}
});
}

function setHighlightListener() {
const observer = new MutationObserver((mutations) => updateHighlight());
observer.observe(document.documentElement, {
attributes: true,
attributeFilter: ['data-theme'],
});
}

document.addEventListener('DOMContentLoaded', animateTabs);
document.addEventListener('DOMContentLoaded', () => {
hljs.highlightAll();
updateHighlight();
});
document.addEventListener('DOMContentLoaded', setHighlightListener);
48 changes: 0 additions & 48 deletions doc/source/_static/js/splash.js

This file was deleted.

Loading
Loading