[PR #13753] [MERGED] Fixes #12219: Ensure dashboard widget heading text has sufficient contrast #14248

Closed
opened 2025-12-29 23:23:25 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/13753
Author: @jeremystretch
Created: 9/13/2023
Status: Merged
Merged: 9/13/2023
Merged by: @jeremystretch

Base: developHead: 12219-widget-colors


📝 Commits (2)

  • 478bb2b Fixes #12219: Ensure dashboard widget heading text has sufficient contrast in both light & dark modes
  • 712c893 Change foreground color for teal background

📊 Changes

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

View changed files

📝 netbox/extras/dashboard/widgets.py (+17 -0)
📝 netbox/templates/extras/dashboard/widget.html (+7 -3)

📄 Description

Fixes: #12219

  • Introduces the fg_color property on DashboardWidget to return white or black as appropriate given the assigned background color
  • Modifies the widget template to use that color for all heading elements

dashboard_light
dashboard_dark


🔄 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/13753 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 9/13/2023 **Status:** ✅ Merged **Merged:** 9/13/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `12219-widget-colors` --- ### 📝 Commits (2) - [`478bb2b`](https://github.com/netbox-community/netbox/commit/478bb2b7dd9289d5ead15cf8752cf3ff6cfdc006) Fixes #12219: Ensure dashboard widget heading text has sufficient contrast in both light & dark modes - [`712c893`](https://github.com/netbox-community/netbox/commit/712c893a1566e184082fb5b7bb71b1928b48b57d) Change foreground color for teal background ### 📊 Changes **2 files changed** (+24 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/dashboard/widgets.py` (+17 -0) 📝 `netbox/templates/extras/dashboard/widget.html` (+7 -3) </details> ### 📄 Description ### Fixes: #12219 - Introduces the `fg_color` property on DashboardWidget to return white or black as appropriate given the assigned background color - Modifies the widget template to use that color for all heading elements ![dashboard_light](https://github.com/netbox-community/netbox/assets/13487278/c02d5033-f9ff-47cc-b48f-32f4f5728349) ![dashboard_dark](https://github.com/netbox-community/netbox/assets/13487278/f9ecf5c7-9120-40cf-bf41-edbca35198fa) --- <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-29 23:23:25 +01:00
adam closed this issue 2025-12-29 23:23:25 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14248