Fixes #20044: Elevations stuck in light mode #685

Closed
opened 2026-04-05 17:10:11 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @UnknownTy on 12/25/2025

Fixes: #20044

Modifies colorMode.ts to properly select the svg elements and updates their class when switching modes.
Also adds:

  • htmx:afterSwap event listener to automatically update svg color mode when loaded into a page
    • Without this, elevations loaded after the page loads will not be updated and will remain stuck in light mode. For example the list of rack elevations side by side.
  • $rich-black-light; to svg's .scss to align with dark mode's background
Examples

Pre-Change: pre-change-elevation Post-Change: post-change-elevation

*Originally created by @UnknownTy on 12/25/2025* ### Fixes: #20044 <!-- Please include a summary of the proposed changes below. --> Modifies `colorMode.ts` to properly select the `svg` elements and updates their class when switching modes. Also adds: - `htmx:afterSwap` event listener to automatically update svg color mode when loaded into a page - Without this, elevations loaded _after_ the page loads will not be updated and will remain stuck in light mode. For example the list of rack elevations side by side. - `$rich-black-light;` to svg's `.scss` to align with dark mode's background <details><summary>Examples</summary> <p> Pre-Change: <img width="298" height="366" alt="pre-change-elevation" src="https://github.com/user-attachments/assets/73f12471-52d6-4c57-a20f-0d39977341e8" /> Post-Change: <img width="302" height="369" alt="post-change-elevation" src="https://github.com/user-attachments/assets/c70a7286-8ef8-414a-b5b7-a7e03895446e" /> </p> </details>
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#685