Skip to content

16648 dashboard contrast issues #16824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion netbox/project-static/dist/netbox.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions netbox/project-static/styles/netbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

// Overrides of external libraries
@import 'overrides/bootstrap';
@import 'overrides/gridstack';
@import 'overrides/tabler';
@import 'overrides/tomselect';

Expand Down
12 changes: 12 additions & 0 deletions netbox/project-static/styles/overrides/_gridstack.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Altering dashboard card colors
.grid-stack {
.card-header {
// Default color of card header changes depending on theme
&.bg-default {
background: var(--tblr-bg-surface-secondary)!important;
}
a {
color: inherit!important;
}
}
}
4 changes: 4 additions & 0 deletions netbox/project-static/styles/overrides/_tabler.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ body[data-bs-theme=dark] {
.btn {
color: var(--#{$prefix}body-color);
}
// Stops table headers from appearing as primary link color
th.orderable a {
color: var(--#{$prefix}body-color);
}
}

// Adjusting text colors
Expand Down
6 changes: 3 additions & 3 deletions netbox/templates/extras/dashboard/widget.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
gs-id="{{ widget.id }}"
>
<div class="card grid-stack-item-content">
<div class="card-header text-{{ widget.fg_color }} bg-{{ widget.color|default:"secondary" }} px-2 py-1 d-flex flex-row">
<div class="card-header {% if widget.color %} text-{{ widget.fg_color }} {% endif %} bg-{{ widget.color|default:'default' }} px-2 py-1 d-flex flex-row">
<a href="#"
hx-get="{% url 'extras:dashboardwidget_config' id=widget.id %}"
hx-target="#htmx-modal-content"
data-bs-toggle="modal"
data-bs-target="#htmx-modal"
>
<i class="mdi mdi-cog text-{{ widget.fg_color }}"></i>
<i class="mdi mdi-cog {% if widget.color %} text-{{ widget.fg_color }} {% endif %}"></i>
</a>
<div class="card-title flex-fill text-center">
{% if widget.title %}
Expand All @@ -29,7 +29,7 @@
data-bs-toggle="modal"
data-bs-target="#htmx-modal"
>
<i class="mdi mdi-close text-{{ widget.fg_color }}"></i>
<i class="mdi mdi-close {% if widget.color %} text-{{ widget.fg_color }} {% endif %}"></i>
</a>
</div>
<div class="card-body p-2 pt-1 overflow-auto">
Expand Down