FlowFuse / FlowFuse/node-red-dashboard

Custom page-scoped css only applied on page after page is loaded

Open
#1,682 1 comment 0 reactions 0 assignees View on GitHub
needs-triage type:bug
Dominant language
HTML
Stars
355
Forks
82
Avg merge
4d 23h
Merged PRs (30d)
24

Description

### Current Behavior

https://discourse.nodered.org/t/custom-css-layout-loads-with-a-delay-in-dashboard-2-0/96657

I need my own custom layout, so I'm specifying each page's layout (with flexbox or grid) in a page-scoped CSS template node. My problem is that when I'm navigating from one page to another, the custom css layout loads only after the page is showing itself, which causes that user can see that it "glitches".

### Expected Behavior

It would be reasonable if the specific CSS gets applied to the page immediately.

### Steps To Reproduce

[css_loading_example.json](https://github.com/user-attachments/files/19825716/css_loading_example.json)

When navigating to page2 with the button, you may be able to see that for a moment, group1 and group2 are next to each other, and only after that moment will group2 be under group1. You might not see it with your own eyes, it depends on the performance of the computer. Running on my PC, I only saw it when recorder with super-slow motion. But it is clearly visible on a raspberry pi for example.

### Environment

- Dashboard version: 1.23.0
- Node-RED version: 4.0.9
- Node.js version: 22.12.0
- npm version: 10.9.0
- Platform/OS: Windows / Linux (tried on both, this example flow was generated from Node-Red running on Windows 11)
- Browser: Google Chrome 135.0.7049.96 64-bit (Windows), Chromium (Linux)

### Have you provided an initial effort estimate for this issue?

I am not a FlowFuse team member

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.