Popular Customisations
You can customise your docs using Custom CSS and Custom Javascript. Below are some of the most used customisations:
Hide version selector/picker
.customise.live .version-picker {
display: none;
}
Hide section/documentation selector/picker
.customise.live .section-picker-container {
display: none;
}
Make top navigation sticky
Only apply this customisation for the original UI. For Next UI, there's a setting under Project Settings > Customisations to enable it.
@media (min-width: 1024px) {
.customise.live .topnav-container {
position: fixed;
top: 0;
height: auto;
z-index: 10;
}
.customise.live .mega-container {
margin-top: 70px;
}
.customise.live .stick-top {
top: 70px !important;
}
}
When navigation is sticky, the scrolling behaviour must be modified in order for headings not to hide under the navigation when it is scrolled to. Add the following to Custom HEAD tags to modify scrolling offsets:
<script>
window.settings.apply({
scrolling: { // Modify values as needed, according to your navbar height.
scrollTopOffsetOnFragmentChange: {documentation: -90, apiReference: -50}
}
});
</script>
Decrease top navigation links font-size
Use if the titles are too long and they're breaking into two lines.
.customise.live .topnav-container .links {
font-size: 13px; /* Original is 14px */
}
.customise.live .topnav-container .links .link {
font-size: inherit;
}
Move index and table of contents to edges of screen
This is enabled by default now.
.customise.live .container.doc-container {
max-width: 100%;
}
.customise.live .container.doc-container > .row {
justify-content: space-between;
}
.customise.live .documentation {
padding-left: 0;
}
Set theme automatically according to user preferences
Place in Custom HEAD tags. Only use one of the if conditions.
<script>
// If your theme is set to dark by default, use the following IF condition.
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) {
window.setTheme('light');
}
// If your theme is set to light by default, use the following IF condition.
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
window.setTheme('dark');
}
</script>
Append contact us to search box on no results
Place in Custom HEAD tags.
<style>
.search-contact-us {
color: inherit;
font-size: inherit;
text-decoration: underline;
}
.search-contact-us:hover {
color: inherit;
}
</style>
<script>
document.addEventListener('onsearch', function (event) {
let searchEl = document.querySelector('.topnav .search');
setTimeout(() => {
if (!document.querySelector('.search-results-container .result')) {
document.querySelector('.search-results-container .count').innerHTML =
'No search results found. <a class="search-contact-us" href="/support-center/contact-us">Contact us?</a>';
}
});
});
</script>
Hide version warning banner for a specific version
Place in Custom HEAD tags.
<script>
document.addEventListener('onsectionchange', e => {
let versionWarningEl = document.querySelector('.version-warning');
if (!versionWarningEl) {
return;
}
if (window.getActiveVersion().slug === 'v4') {
console.log('Hiding banner');
versionWarningEl.classList.add('d-none');
} else {
versionWarningEl.classList.remove('d-none');
}
});
</script>
Collapse Section Picker into Dropdown on Next UI
Place in Custom CSS.
.customise.live .section-links-group {
display: none !important;
}
.customise.live app-section-picker.d-mobile {
display: inline-block !important;
}
@media (min-width: 768px) {
.customise.live .version-selector-group {
padding: 8px 0;
}
}
Blur Top Navigation Bar
Place is Custom CSS. You might need to handle light theme separately.
.customise.live .topnav-container {
background-color: transparent;
backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
border-bottom: 1px solid #44444433;
}
.customise.live .external-search.dark {
background: #00000033;
}