Skip to content

Commit

Permalink
docs: use more specific selector for version styles (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
werne2j authored Dec 1, 2021
1 parent 643be01 commit 947668d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
6 changes: 3 additions & 3 deletions docs/assets/versions.css
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ div[data-md-component=announce]>div#announce-msg>a{
display: unset !important;
}

.rst-versions .rst-other-versions dd a {
#rtd-version-item {
cursor: pointer !important;
display: block !important;
outline: none !important;
Expand All @@ -175,11 +175,11 @@ div[data-md-component=announce]>div#announce-msg>a{
font-weight: unset !important;
}

.rst-other-versions a:focus,.rst-other-versions a:hover {
#rtd-version-item:focus,#rtd-version-item:hover {
color: var(--md-accent-fg-color) !important;
}

.rst-other-versions a:focus {
#rtd-version-item:focus {
background-color: var(--md-default-fg-color--lightest) !important;
}

Expand Down
13 changes: 5 additions & 8 deletions docs/assets/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,15 @@ setTimeout(function() {
caret.classList.add('dropdown-caret')
div.querySelector('.rst-current-version').appendChild(caret);

var items = document.querySelectorAll('.rst-versions .rst-other-versions dd a');
for (var i = 0, item; item = items[i]; i++) {
item.setAttribute('id','rtd-version-item');
}

var currentVersion = document.getElementsByClassName("rst-current-version");
//if currentVersion[0].innerText.includes(":") {
currentVersion[0].innerText = currentVersion[0].innerText.split(':')[1].trim()
// }

}

var CSSLink = document.createElement('link');
CSSLink.rel='stylesheet';
CSSLink.href = 'assets/versions.css';
document.getElementsByTagName('head')[0].appendChild(CSSLink);

var script = document.createElement('script');
script.src = 'https://argocd-vault-plugin.readthedocs.io/_/api/v2/footer_html/?'+
'callback=' + callbackName + '&project=argocd-vault-plugin&page=&theme=mkdocs&format=jsonp&docroot=docs&source_suffix=.md&version=' + (window['READTHEDOCS_DATA'] || { version: 'latest' }).version;
Expand Down

0 comments on commit 947668d

Please sign in to comment.