Open MichaelRFox opened 3 months ago
Wonderful, you have created your first issue for clean-jsdoc-theme. Someone will talk to you soon!
So I figured out a workaround for the JavaScript issue (rather embarrassed about this). It was simply to enclose the code in a window.onload
event. Still seems a bit kludgy, but seems to work.
window.onload = function (event) {
tippy('.github', {
content: 'Github repo',
placement: 'top',
delay: 500
})
tippy('.npm', {
content: 'NPM repo',
placement: 'top',
delay: 500
})
}
Hi @MichaelRFox! I am glad that you figured out a workaround for this.
To fix the css I would recommend you to increase the specificity. So to updated the hover colour of navbar item you could do something as follows:
.navbar-container .navbar-item:hover {
/* My custom css. */
}
Alternatively, feel free to suggest some ideas.
Currently, clean-jsdoc-theme loads custom CSS and JavaScript files near the beginning of the
<head>
section of index.js. Since custom CSS files are loaded before clean-jsdoc-theme.min.css, conflicting styles in clean-jsdoc-theme.min.css override those in a custom CSS file.In my use case I have loaded an octocat svg file to customize my menu link to my GitHub page. In my custom CSS file I use the svg as a
mask-image
with a background-color ofcurrentColor
to accommodate theme toggling, However, the.nav-bar-item:hover
background style from clean-jsdoc-theme.min.css overrides my custom hover style. I managed a work around my using!important,
but this is admittedly clumsy.Here is a portion of my jsdocConfig.json:
And here is my custom CSS:
In my second use case I would like to add a tooltip to my menu items to mirror the right-menu-items by including the following Javascript:
However, since my custom JavaScript is loaded before tippy.js it can't access it. I haven't yet figured out a workaround for this yet.
I think that loading custom CSS and JavaScript files at the end of the
<head>
section would be an easy solution. Anyone competent enough to create custom CSS and JavaScript for their docs should be able to prevent the unintended consequences of reusing variables, functions, and selectors from the index.html file, etc. (perhaps a disclaimer in your documentation).