[PR #21037] Fixes #20044: Elevations stuck in light mode #16130

Open
opened 2025-12-30 00:25:57 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/21037
Author: @UnknownTy
Created: 12/25/2025
Status: 🔄 Open

Base: mainHead: 20044-elevation-stuck-lightmode


📝 Commits (3)

  • 68e995d Fixes netbox-community#20044: Elevations stuck in light mode
  • c39f2c7 Change rack bg back and re-build static dist files
  • cef53be Rebuild dist using correct dependencies

📊 Changes

3 files changed (+24 additions, -9 deletions)

View changed files

📝 netbox/project-static/dist/netbox.js (+4 -4)
📝 netbox/project-static/dist/netbox.js.map (+3 -3)
📝 netbox/project-static/src/colorMode.ts (+17 -2)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/21037 **Author:** [@UnknownTy](https://github.com/UnknownTy) **Created:** 12/25/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `20044-elevation-stuck-lightmode` --- ### 📝 Commits (3) - [`68e995d`](https://github.com/netbox-community/netbox/commit/68e995d55194323ebaa5960bf54ac8ec970403b9) Fixes netbox-community#20044: Elevations stuck in light mode - [`c39f2c7`](https://github.com/netbox-community/netbox/commit/c39f2c7de548654f0f3d1353491531db0cfed55e) Change rack bg back and re-build static dist files - [`cef53be`](https://github.com/netbox-community/netbox/commit/cef53be815a6dc7ad80134371766bbfc0989a1c6) Rebuild dist using correct dependencies ### 📊 Changes **3 files changed** (+24 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `netbox/project-static/dist/netbox.js` (+4 -4) 📝 `netbox/project-static/dist/netbox.js.map` (+3 -3) 📝 `netbox/project-static/src/colorMode.ts` (+17 -2) </details> ### 📄 Description ### 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> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:25:57 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#16130