Skip to content

Commit

Permalink
closes netbox-community#16907: changed default widget color to primar…
Browse files Browse the repository at this point in the history
…y color
  • Loading branch information
Andrew Gormley authored and Andrew Gormley committed Jul 15, 2024
1 parent e7e538c commit bb2dbe6
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
2 changes: 2 additions & 0 deletions netbox/extras/choices.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ class DashboardWidgetColorChoices(ChoiceSet):
GRAY = 'gray'
BLACK = 'black'
WHITE = 'white'
NETBOXTEAL = 'primary'

CHOICES = (
(BLUE, _('Blue')),
Expand All @@ -291,6 +292,7 @@ class DashboardWidgetColorChoices(ChoiceSet):
(GRAY, _('Gray')),
(BLACK, _('Black')),
(WHITE, _('White')),
(NETBOXTEAL, _('NetBox Teal')),
)


Expand Down
5 changes: 2 additions & 3 deletions netbox/extras/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'width': 4,
'height': 5,
'title': 'Bookmarks',
'color': 'orange',
'color': 'primary',
},
{
'widget': 'extras.ObjectCountsWidget',
Expand All @@ -46,7 +46,7 @@
'width': 4,
'height': 2,
'title': 'Welcome!',
'color': 'green',
'color': 'primary',
'config': {
'content': (
'This is your personal dashboard. Feel free to customize it by rearranging, resizing, or removing '
Expand Down Expand Up @@ -128,7 +128,6 @@
'width': 12,
'height': 5,
'title': 'Change Log',
'color': 'blue',
'config': {
'model': 'core.objectchange',
'page_size': 25,
Expand Down
2 changes: 1 addition & 1 deletion netbox/project-static/dist/netbox.css

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions netbox/project-static/styles/overrides/_tabler.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pre {
@include color-mode(dark, true) {
--#{$prefix}alert-color: darken(var(--#{$prefix}warning),10%);
--#{$prefix}link-color: #{$bright-teal};
--#{$prefix}primary-rgb: 0,242,212;
--#{$prefix}secondary: #{$gray-400};
}
}
Expand All @@ -69,6 +70,16 @@ pre {
// Dark mode overrides
body[data-bs-theme=dark] {

// Change content color when primary teal changes with theme
.bg-primary, {
.card-title,a,i {
color: $rich-black!important;
}
}
.text-bg-primary {
color: $rich-black!important;
}

// Altering background colors
.card {
background: $rich-black!important;
Expand Down
7 changes: 2 additions & 5 deletions netbox/project-static/styles/transitional/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,9 @@ body[data-bs-theme=dark] {

// Adjust dark table link color without affecting buttons and badges
table {
a:not(.btn) {
a:not(.btn,.badge a) {
color: $bright-teal;
}
.badge a {
color: inherit;
}
// Stops table headers from appearing as primary link color
th.orderable a {
color: var(--#{$prefix}body-color);
Expand All @@ -79,7 +76,7 @@ body[data-bs-theme=dark] {

table.object-list {
a {
color: var(--#{$prefix}body-color);
color: var(--#{$prefix}body-color)!important;
}
}
}

0 comments on commit bb2dbe6

Please sign in to comment.