Node-RED Dashboard 3.6.6 – Mobile sidebar: multiline labels, font-size issue and working workaround
Hello Node-RED community,
I would like to share an issue we encountered while customising the mobile sidebar menu in Node-RED Dashboard 3.6.6.
After some debugging and testing, we found a working workaround that might also be useful for other users.
1. Environment
- Node-RED Dashboard 3.6.6
- Mozilla Firefox
- Google Chrome
- Raspberry Pi installation
- Mobile dashboard view
The same behaviour was initially observed in both Firefox and Chrome.
2. Initial problem: multiline menu labels were clipped
Longer menu labels were not displayed completely on smartphones.
The text was clipped because the menu entries did not expand sufficiently to accommodate multiple lines.
We inspected the DOM and found the following relevant structure:
<md-list-item>
<div class="md-button md-no-style">
<button class="md-no-style md-button">
</button>
<div class="md-list-item-inner">
<ui-icon></ui-icon>
<p style="margin-right:12px; min-width:120px;">
Wetterprognose (Smartphone Ansicht)
</p>
</div>
</div>
</md-list-item>
The original inline min-width:120px on the paragraph was particularly relevant.
3. First fix: allow menu entries to grow
We added CSS to the global ui_template using the option:
"Added to head section of page"
The following changes solved the clipping problem:
- Menu entries can grow automatically.
- Fixed height restrictions are removed.
- Text wrapping is enabled.
- Existing vertical spacing is preserved.
- The invisible button area adapts to the menu entry height.
The resulting menu labels were displayed completely.
4. Additional problem: mobile menu font size
We then wanted to reduce the mobile menu font size to approximately 13px.
However, CSS rules targeting the menu paragraphs did not produce the expected result.
Firefox DevTools showed:
- Menu paragraph: 16px
- Menu container: 16px
- md-list: 16px
- body: 16px
We also inspected app.min.css around line 3560 and found:
md-list-item.md-no-proxy.md-button,
md-list-item .md-no-style.md-button {
align-items: inherit;
border-radius: 0;
flex-direction: inherit;
font-size: inherit;
height: inherit;
margin: 0;
text-align: left;
text-transform: none;
white-space: normal;
width: 100%;
}
The font-size: inherit declaration passes the inherited font size to the menu container.
CSS-only attempts using more specific selectors and !important did not solve the problem.
5. Debugging: direct JavaScript test
We then tested setting the font size directly on the menu paragraphs using Firefox's developer console:
document.querySelectorAll(
'md-sidenav md-list-item .md-list-item-inner p'
).forEach(element => {
element.style.setProperty(
'font-size',
'13px',
'important'
);
});
This worked immediately.
The computed font size changed from 16px to 13px and remained stable during subsequent checks.
The selector matched 14 menu labels in our installation.
This gave us a reliable way to customise the menu font size without affecting other dashboard elements.
6. Complete working workaround
We integrated the successful JavaScript approach into our existing global ui_template.
The following is the complete code currently working in our installation.
It preserves the CSS adjustments for multiline labels and adds a MutationObserver to handle menu elements created later.
<style>
/* ================================================== */
/* NODE-RED DASHBOARD 3.6.6 – MOBILE SIDEBAR */
/* Display multiline menu labels completely */
/* ================================================== */
@media screen and (max-width: 959px) {
/* Allow menu entries to grow automatically */
body.nr-dashboard-theme md-sidenav md-list > md-list-item {
height: auto !important;
min-height: 48px !important;
max-height: none !important;
overflow: visible !important;
}
/* Inner menu container */
body.nr-dashboard-theme md-sidenav
md-list-item > .md-button.md-no-style {
height: auto !important;
min-height: 48px !important;
max-height: none !important;
padding-top: 6px !important;
padding-bottom: 6px !important;
box-sizing: border-box !important;
overflow: visible !important;
}
/* Area containing icon and text */
body.nr-dashboard-theme md-sidenav
md-list-item .md-list-item-inner {
display: flex !important;
align-items: center !important;
height: auto !important;
min-height: 36px !important;
max-height: none !important;
overflow: visible !important;
}
/* Allow menu labels to wrap */
body.nr-dashboard-theme md-sidenav
md-list-item .md-list-item-inner p {
flex: 1 1 auto !important;
min-width: 0 !important;
width: auto !important;
white-space: normal !important;
overflow: visible !important;
text-overflow: clip !important;
height: auto !important;
max-height: none !important;
line-height: 1.3 !important;
overflow-wrap: break-word !important;
word-break: normal !important;
}
/* Adapt invisible click area to menu item height */
body.nr-dashboard-theme md-sidenav
md-list-item > .md-button.md-no-style > button {
height: 100% !important;
min-height: 48px !important;
}
}
</style>
<script>
/* ================================================== */
/* MOBILE MENU – FONT SIZE */
/* Set font size directly on menu labels */
/* ================================================== */
(function() {
function menueSchriftAnpassen() {
var texte = document.querySelectorAll(
'body.nr-dashboard-theme md-sidenav md-list-item .md-list-item-inner p'
);
texte.forEach(function(element) {
if (
element.style.getPropertyValue('font-size') !== '13px' ||
element.style.getPropertyPriority('font-size') !== 'important'
) {
element.style.setProperty(
'font-size',
'13px',
'important'
);
}
});
}
/* Adjust existing menu labels */
menueSchriftAnpassen();
/* Also handle menu entries created later */
var beobachter = new MutationObserver(function() {
menueSchriftAnpassen();
});
beobachter.observe(document.documentElement, {
childList: true,
subtree: true
});
})();
</script>
7. Final result
The workaround successfully provides:
- Complete display of multiline menu labels.
- Mobile menu font size fixed at 13px.
- Existing vertical padding preserved.
- Other dashboard text remains unchanged.
- Newly created menu entries are also adjusted.
The solution has been tested in our installation and is working.
8. Questions for the community
We would appreciate feedback from the developers and other experienced Dashboard users:
- Is the inherited 16px font size in the mobile sidebar intentional?
- Is there a recommended CSS-only method to customise the menu font size?
- Could the Angular Material menu implementation or its DOM initialisation explain why our CSS-only overrides did not work?
- Is MutationObserver an appropriate approach here, or is there a more suitable lifecycle mechanism?
We are sharing this as a practical workaround, not as a confirmed fix for the underlying issue.
Hopefully this investigation and the working code will help other Node-RED users facing similar problems.
Best regards
Daniel

